PyTorchKR Papers

최신 논문

총 26,098편
태그·기간 등 상세 필터

카테고리 탐색

로그인 후 이 카테고리 구독

arXiv:2611.35605v1cs.RO

What Transfers in Robot Learning? Taxonomy and Evidence from Domain Randomization to VLA Models

Transfer learning allows robots to reuse experience when target-specific data are expensive. This survey organizes a curated corpus of 232 works through November 2026 along two axes: five source-to-target gaps (simulation to reality, task to task, embodiment to embodiment, human to robot, and web to robot) and five forms of transferred knowledge (data, representations, parameters and policies, models and simulators, and task conditioning). Each gap is reviewed through its mechanisms, representative evidence, and failure modes. A classical domain-adaptation bound provides a diagnostic vocabulary, with explicit limits for closed-loop control. We grade one focal transfer claim from each of 185 papers on an E0-E4 comparison-control scale and provide the complete coding. Within the coded subset, 145 claims (78.4%) isolate the transferred artifact, while 15 (8.1%) additionally report dispersion; no independent replication meeting the stated definition was identified in the corpus. These findings concern reported comparisons rather than field-wide evidence quality. The modern pretrain, fine-tune, and post-train pipeline recombines classical transfer mechanisms while retaining their problems of source mismatch, negative transfer, and retention. Cross-gap synthesis links practical source selection to target-relevant coverage, compatible observation-action interfaces, matched adaptation budgets, and retention testing. Open problems include transferability prediction, harmful-mixture detection, physical validation of world models, and evaluation across laboratories.

arXiv:2611.35595v1cs.DB

ACTIS: Adaptive Cascade Tuning for Semantic Filters with Statistical Guarantees

Emerging semantic database systems use Large Language Models (LLMs) to evaluate natural language predicates during query processing. However, invoking an expensive frontier model for every tuple is prohibitively costly and induces high latency. Model cascades mitigate these limitations by using a cheap proxy to score all tuples, escalating only uncertain predictions to an expensive LLM oracle. To be deployed reliably, cascades are tuned on a sample of oracle-labeled tuples to satisfy precision and recall targets with high probability. Our comprehensive audit reveals that several existing tuning methods frequently violate these guarantees: state-of-the-art techniques are certified unsound on up to 90.5% of benchmarks and can miss accuracy targets by more than 70 percentage points. To improve efficiency and ensure soundness guarantees for semantic databases, we design ACTIS, an adaptive cascade tuning framework. ACTIS acquires oracle labels incrementally using anytime-valid tests with finite-sample safeguards, avoiding the over- or under-sampling pitfalls of a fixed pilot sample. A decoupled fixed-sequence search explores fine-grained threshold grids without conservative multiple-testing corrections, while a variance-minimizing importance sampling distribution reduces labels spent on uninformative negatives for selective queries. A value-of-information stopping rule halts tuning when additional oracle labeling costs exceed expected savings across the remaining workload. Across 42 benchmarks with cloud and local proxies, ACTIS matches or outperforms the only sound baseline on 39 of 42 settings, reducing oracle calls by up to 5.1$\times$.

arXiv:2611.35587v1cs.DC

Tree Speculative Decoding with In-Call KV Repair on a Commercial Static-Graph NPU

Tree speculative decoding verifies many draft branches in one target call, but common implementations assume dynamic query shapes and direct control over the KV cache. Static-graph NPUs offer neither: each compiled graph fixes its query length, and the runtime owns the physical KV layout. We propose a tree verifier for this setting that packs repair rows and tree rows into one fixed 32-row call. Per-token rotary tables and an ancestor mask express the tree, and an exact-watermark rule re-scores accepted tokens whose KV is out of canonical order inside the next call, so no separate cache-movement call is needed. On the Rebellions ATOM+ NPU with the DFlash drafter, removing chunk-boundary replay first raises the linear baseline from 59.3 to 92.3 tokens/s. In a pre-specified study on 120 GSM8K questions, the tree verifier with a grouped 32-row projection head beats the fastest linear baseline by 12.2% on Qwen3-4B (95% CI 10.7-13.8%) and by 13.2% on Qwen3-8B (CI 12.1-14.4%), and it cuts board energy per token by 10.0% and 11.1%. Changing the compiled verification shape also changes floating-point outputs on 55 of 120 questions for 4B and 9 for 8B, and a matched-prefix diagnostic traces the one lost 4B answer to the query-shape change alone.

arXiv:2611.35584v1cs.LG

Large Learning Rates Impair Length Generalization

Length generalization is the ability of sequence models to effectively process sequences longer than those seen during training. While the quadratic cost of attention prohibits transformers from processing arbitrarily long sequences, their most promising subquadratic alternatives, such as linear recurrent models, often fail beyond the training horizon. Despite its significance, our general understanding of length generalization remains limited. In this paper, we investigate how the learning rate determines which global minimum gradient descent converges to when these minima differ in their ability to generalize to arbitrarily long sequences. To this end, we study a single-layer linear recurrent neural network whose hidden dimension is large enough to realize any sequence of Markov parameters over a fixed training horizon. Our experiments show that sufficiently large learning rates induce edge-of-stability dynamics, and the resulting global minima exhibit worse length generalization than those reached at smaller learning rates, for which the dynamics remain outside this regime. Among runs that enter the edge-of-stability regime, larger learning rates further degrade length generalization, in contrast to the common view that large learning rates improve generalization. We observe that, among these runs, larger learning rates favor global minima whose recurrent weight matrices have a larger spectral radius restricted to the controllable and observable modes. To understand this phenomenon, we derive a closed-form expression for the maximum Hessian eigenvalue of the training loss at any global minimum.

arXiv:2611.35576v1cs.LG

A New Generalised Three-Dimensional Failure Criterion for In-Situ Stress Conditions

Three dimensional failure criteria are important for predicting rock failure under in-situ stresses, particularly in wellbore stability and sand-production applications. This study proposes a generalized threedimensional failure criterion that expresses the major principal stress at failure as a linear function of the intermediate and minor principal stresses. Unlike formulations that incorporate the intermediate principal stress through a weighted mean stress or mean average while assigning equal weights to the major and minor stresses, the proposed criterion introduces its contribution into the effective normal stress through unequal weighting coefficients. Derived from the Mohr Coulomb criterion, the formulation reduces to the conventional Mohr Coulomb criterion when the intermediate stress weighting parameter is zero. Triaxial compression data for eleven rock types are used to calibrate and evaluate the model. The calibrated weighting parameter K ranges from 0.03 to 0.38, indicating variations in the contribution of the intermediate principal stress. The criterion is assessed in Haigh Westergaard coordinates and compared with the New Extended Mohr Coulomb, Mogi Coulomb, and Drucker Prager criteria using the root mean square error (RMSE)and coefficient of determination (DC). The proposed criterion produces RMSE values of 5.13 to 36.62 MPa and DC values of 0.88 to 0.98.It yields lower RMSE values than the New Extended Mohr Coulomb and Drucker Prager criteria for all eleven rock types, while showing comparable or improved performance relative to the Mogi Coulomb criterion, depending on the rock type. For the illustrative parametersexamined, its deviatoric plane failure envelope is smaller, indicating a more conservative strength prediction. The proposed criterion provides a framework for representing three dimensional rock failure and hasapplication in wellborestability assessment.

arXiv:2611.35570v1stat.ME

Efficient Inference for Distributional Treatment Effects with Partially Observed Outcomes

We study the distributional treatment effect when a surrogate outcome is fully observed, but the primary outcome is observed only for a subsample. This setting arises naturally in model or agent evaluation, where automated judges make it inexpensive to score every high-dimensional response while human ratings are often available for only a small subsample. When evaluation scores are discrete or ordinal, a difference between cumulative distribution functions (CDFs) directly measures changes in the probability of low-quality outputs at each rating cutpoint. Building on prediction-powered inference and surrogate-assisted treatment-effect estimation, we develop a cross-fitted estimator that combines conditional CDFs with and without surrogate information. We establish a Gaussian-process limit and uniform confidence bands over outcome thresholds, identify the semiparametric efficiency bound, and characterize variance gains over estimators that reweight the labeled subsample by its known sampling probabilities or adjust for covariates without the surrogate. The construction does not require continuous output density or agreement between the surrogate and primary-outcome scales. Through simulation results and four real data applications, we demonstrate the effectiveness of our approach.

arXiv:2611.35567v1cs.LG

GEM-x: Exploration-driven Materials Discovery using Gaussian Mixtures and Ensemble Learning

Generative modeling offers a promising route to discovering crystalline materials beyond known databases, yet existing models often sample densely populated regions of composition-structure space, limiting novelty of the generated candidates. Here, we introduce GEM-x, a Gaussian mixture flow-matching framework that operates in a learned latent space and models the denoising velocity as a Gaussian mixture parametrized by a sparsely gated mixture-of-experts network, enabling multimodal, exploration-oriented sampling. We benchmark GEM-x against six leading generative models, including the All-atom Diffusion Transformer (ADiT), and assess the energetic plausibility of 1,000 generated candidates using r2SCAN density functional theory calculations. GEM-x generates stable or metastable, unique, and novel structures at a rate of 12.3%, compared with 9.6% for ADiT, representing a 28% relative improvement. This advantage is driven primarily by the generation of metastable, unique, and novel structures, for which GEM-x achieves a rate of 10.4% versus 7.1% for ADiT, a 46% relative improvement. Metastable phases are particularly attractive targets for materials discovery, as they can be experimentally realizable while offering functional properties superior to those of their thermodynamically stable counterparts. The findings suggest that exploration-driven generative modeling can expand the accessible materials landscape.

arXiv:2611.35566v1cs.AI

A Graph Learning Approach for Network-Wide Real-Time Traffic Flow Prediction During Wildfire Evacuations

Wildfire evacuations can cause abrupt network-wide traffic conditions, leading to congestion and safety risks for evacuees. Knowing the traffic conditions in advance can improve overall evacuation traffic management. However, limited availability of wildfire evacuation traffic data poses a challenge for training reliable traffic prediction models. It is therefore important to evaluate whether models trained on regular traffic data can generalize to unseen wildfire evacuations. This study develops a graph learning-based model using routinely available traffic data for network-wide real-time traffic flow prediction during wildfire evacuations. The framework integrates Graph Transformer (GT) and Long Short-Term Memory (LSTM) networks into a unified GT-LSTM framework. After constructing a detector network graph, a spatial fusion gate was introduced to combine local and upstream detector features. Additionally, a learnable detector embedding representation was integrated to capture location-specific traffic patterns. The model was trained using regular period traffic data from October-December 2024 and evaluated during the peak evacuation period of the Palisades and Eaton wildfires in Los Angeles on January 7-8, 2025. The model achieved RMSE of 292 and an R2 of 0.98 for next 1-hour prediction. Across the 1- to 6-hour prediction horizons, it achieved an overall RMSE of 435 and R2 of 0.96. The proposed model outperformed all state-of-the-art baseline models. Furthermore, ablation experiments confirmed that each major model component contributed to improving the prediction performance. The framework can help transportation agencies anticipate traffic congestion, identify potential bottlenecks, and implement proactive traffic management strategies to improve evacuation safety and efficiency.

arXiv:2611.35558v1cs.CL

Which Signal Should Select a Compressed LLM? An Empirical Study of Pre- and Post-Recovery Selection in Block-Replacement Search

Block-replacement compression of large language models distils cheaper replacements for every layer, searches for the combination that minimises a distillation objective measured before recovery, and then recovers the chosen model by fine-tuning. Within one pool of block-replacement candidates and a fixed recovery budget, we compare several selection signals, measured before and after a short recovery, with the candidates' downstream accuracy after full recovery. On Qwen2.5-1.5B (full fine-tuning and LoRA) and Qwen2.5-3B (LoRA), with nine kinds of searched structure at three latency budgets and task examples held out from every selection, the mean calibration KL that the search optimises is not significantly better than chance at ordering the strong candidates. On the 1.5B model, signals measured closer to the task decisions rank better, and zero-shot accuracy before recovery already orders the candidates; on the 3B model none of the pre-specified pre-recovery signals does. After 100 of the 2,000 recovery steps, zero-shot accuracy on held-out examples has the highest point estimate of ranking accuracy in all three settings, above the divergence and the training loss. An exploratory statistic, the concentration of the pre-recovery divergence on few tokens, also predicts the ranking and awaits independent confirmation. A surrogate corrected for compounding lowers the pre-recovery objective without improving the recovered model.

arXiv:2611.35555v1cs.LG

Where, What, and How to Forget: A Causal-Geometric Framework for Selective Capability Unlearning

Capability unlearning in large language models faces a fundamental tension: removing a targeted capability deeply enough to resist recovery while preserving unrelated functionality. Existing methods largely treat unlearning as an optimization problem, modifying broad parameter regions without accounting for how capabilities are represented and executed. We instead formulate capability unlearning as a causal-geometric intervention problem, asking where a capability is causally mediated, what representational structure supports it, and how it can be selectively modified while limiting interference. We introduce LOCUS (Localized Orthogonal Capability Unlearning through Subspaces), a three-stage framework combining hierarchical bidirectional causal localization, contrastive capability-subspace estimation, utility-aware geometric projection, and localized utility-orthogonal hardening. We evaluate LOCUS on Qwen3-8B, Gemma-3-4B-IT, and Phi-4-mini-instruct across biological, cybersecurity, and chemical capabilities from WMDP alongside broad retained-utility benchmarks. Across model families, LOCUS achieves competitive forgetting while retaining substantially more general utility than global optimization baselines, with gains growing under stronger forgetting. Mechanistic analyses show that capability effects concentrate in a restricted set of components and are captured by low-dimensional representation structure, while cross-domain evaluations show limited interference with other hazardous capabilities. Recovery experiments further show that LOCUS consistently slows recovery under representation steering, target-domain relearning, and adversarial LoRA fine-tuning, though strong adaptation can partially restore the capability. Overall, exploiting causal support and representational geometry enables more selective, recovery-resistant unlearning than broad parameter optimization.

arXiv:2611.35545v1cs.LG

EnzDecomp: Disentangling background reactivity from active-site selectivity in enzyme screens

Ethyl hexanoate and hexyl acetate differ in which side of the ester carries the longer chain. Of 146 esterases, 28 cleaved ethyl hexanoate and 29 cleaved hexyl acetate. Both look similar if any catalyst suffices. Selective linkers instead rely on the ten enzymes specific to ethyl hexanoate and the eleven specific to hexyl acetate. We asked if both sorts of entries could be predicted for enzymes and substrates held out of training. The same issue arises with epimers and enantiomers, where a reversal of enzymatic preference may accompany a change in configuration without any change in connectivity. For each of six enzyme families we had a matrix of compounds against related enzymes, with every entry from the same assay, including inactive pairs. An additive fit to these matrices already ranked substrates nearly as well as the best external model (within-enzyme average precision (AP) 0.468 versus 0.477 over 176 splits). Yet four SMILES-based predictors tied on 70.5-100% of unseen epimer or enantiomer cases. EnzDecomp fits substrate reactivity and then enzyme breadth, freezing each in turn. No docking is needed. We fit the residual using a fixed 3D pocket per enzyme, local 2D chiral bond patterns and quantum-chemical descriptors at candidate reaction sites, then center it on the training matrix. On 4,355 reversals this yielded the best native balanced accuracy (61.6%, rising to 80.1% on esterases). Accuracy on 780 unseen isomer cases was 66.3% (epimers 58.3%, enantiomers 61.6%, no ties). The full score led within-enzyme ranking on 152 non-random and 74 double-holdout splits (0.475 and 0.436 AP) and whole-library ranking on the HAD panel with <40%-identity enzyme clusters (0.302 pooled AP). Downstream training took 10.4 minutes per esterase split, 25-44 times faster than the docking and multimodal Transformer baselines.

arXiv:2611.35534v1cs.LG

SpecZip: Efficient Speculative Drafter Training on Compressed Hidden-State Caches

Recent speculative-decoding drafters such as EAGLE-3 and DFlash learn from the hidden states of the target model. Offline training computes and caches these hidden states once, and therefore needs 2-3x less GPU time than online training, which recomputes the hidden states at every step. For a standard training corpus, however, the BF16 cache takes 34-55 TB and does not fit on the local disk of an 8-GPU node. The cache can be compressed with methods developed for KV caches, but quantizers that spread bits equally across dimensions substantially shorten the acceptance length of the drafter. We trace this loss to two properties of the cache. First, as in a KV cache, 99% of the variance of target hidden states lies in 32% of the principal components, and compression must therefore allocate bits by variance. Second, unlike a KV cache, the cache is training data: the drafter learns without the low-variance components but receives the full hidden states at serving, causing a train-serve mismatch. Based on these observations, we propose SpecZip, a system for training drafters on a compressed cache. SpecZip compresses the cache with PCA and reverse water-filling (PCA-RWF), which allocates bits by variance without per-token scales and thus keeps more components at the same size, and can additionally project the removed components out of the first layer of the drafter. Because SpecZip decodes only the kept components on the GPU and overlaps the decoding with training, decompression adds almost no time to a training step. A 16x cache of 2.2-3.4 TB fits on a single node, and DFlash drafters trained on this cache retain 99-101% of the BF16 acceptance length across four targets, including a 122B Mixture-of-Experts (MoE) model. SpecZip thus enables offline training from a single local disk, with 1.95-3.25x higher training throughput than online training.

arXiv:2611.35529v1cs.LG

Endogenous Forgetting in RL Post-Training

A central challenge in scaling reinforcement learning (RL) for LLM post-training is how models continue to learn new behaviors while preserving previously acquired ones. We study endogenous forgetting---where a model loses previously accessible behaviors due to non-stationarity that arises because the evolving model determines the effective data distribution---as a potential barrier to scaling on-policy RL. We first isolate endogenous forgetting via a controlled experiment: we collect successful traces from an RL run and show that supervised learning on these traces in temporal order leads to substantially more forgetting and lower solution coverage than training with a shuffled order. We then investigate successful-trajectory replay as a way to mitigate endogenous forgetting. Across multiple reasoning tasks and model families, replay reduces forgetting and prompt-level performance oscillations, achieves comparable or higher final pass@1, and substantially improves solution coverage relative to standard RL.

arXiv:2611.35520v1cs.LG

Pessimistic-Behavior / Greedy-Target Q-Learning against Adversarial State Perturbations

Reinforcement learning agents can fail when an attacker perturbs their observations, even if the environment itself is unchanged. Belief-enriched pessimistic Q-learning defends against such attacks by tracking the set of states consistent with the agent's history and choosing the action whose worst-case value over that set is highest. It applies this worst-case reasoning in two places: in the Bellman target used to learn the Q-function, and in the rule used to choose actions at test time. Because both change at once, it is unclear which one provides the robustness, and the test-time search adds computation to every decision. We separate the two. We introduce PB-GT (pessimistic-behavior, greedy-target) Q-learning, which collects data with the pessimistic rule but learns and acts greedily, and we evaluate each learned Q-function under both test rules. On a tabular GridWorld, a continuous GridWorld, and CartPole, most of the robustness comes from the worst-case rule at test time. The pessimistic Bellman target adds a smaller gain on the tabular GridWorld, and training on adversarial data with a greedy target performs about like standard Q-learning. We also find that the worst-case rule can be overly cautious when no attacker is present, and we discuss when its extra computation is worth paying.

arXiv:2611.35519v1cs.CV

MapSelect: Mapping Preservation and Adapter Selection for Continual Multimodal Instruction Tuning

Continual multimodal instruction tuning enables multimodal large language models to acquire new capabilities, but sequential adaptation often degrades performance on earlier tasks. Existing methods retain task-wise language adapters, whose effective use also depends on the visual mapping and adapter selection. We investigate these factors through controlled projector and expert interventions and show that both can recover forgotten answers. Based on these observations, we propose MapSelect, which combines mapping preservation with adapter selection. History-Guided Mapping Adaptation (HMA) retains task-specific projector adapters and guides new updates with historical mapping directions. Selection-Guided Adapter Reuse (SAR) incorporates related historical language adapters during learning and maintains prompt-conditioned selection throughout each answer. Pretrained Subspace Guidance (PSG) further constrains language updates with pretrained weight directions. Experiments on UCIT and MLLM-DCL achieve Mean Final Accuracy of 74.52 and 66.28, respectively. Ablations and controlled comparisons demonstrate the benefits of visual adaptation, historical adapter reuse, and pretrained guidance for continual learning.

arXiv:2611.35517v1cs.LG

Universal scaling law

Scaling laws are the bedrock for foundation model training, yet standard scaling laws are largely restricted to evaluating cross-entropy loss at terminal checkpoints -- leaving the continuous dynamics of general observables under-explored. In this work, we establish universal scaling laws across large language models (LLM) and multi-modal language models (MMLM) that accurately characterize the any-time-any-scale trajectories of losses, evaluation metrics, and parameter norms. To establish this unified framework, we integrate three key pillars: conventional end-point scaling laws, convex optimization theory, and an enhanced collapse transformation. We systematically validate this framework across diverse model architectures, optimizers, training hyperparameters, compute regimes, and modalities, providing a principled recipe for universal scaling.

arXiv:2611.35498v1cs.LG

Sequential Cross Mapping for Dynamical Causal Inference and Critical Early Warning

Detecting critical transitions in complex biological systems is essential for understanding cell-fate decisions and anticipating disease deterioration. However, conventional early-warning methods primarily rely on molecular fluctuations and statistical correlations, and indirect causal dependencies and nonlinear interactions further complicate the reconstruction of underlying causal networks. To address these challenges, We propose sequential cross mapping (SCM), a framework that integrates delay-coordinate reconstruction, sequential locally weighted linear mapping, and partial correlation to infer direct causal interactions while eliminating indirect associations. Based on the reconstructed causal networks, we develop CDE to quantify dynamical fluctuations of causal networks, thereby identifying potential early-warning signals and dynamic causal biomarkers. Applications to simulated dynamical systems and real biological datasets demonstrate that this method effectively reconstruct direct causal networks and detect critical states. Furthermore, CDE enables the identification of candidate dynamic causal biomarkers associated with key biological processes, including cell differentiation, proliferation, and PI3K-Akt signaling. Overall, our approach provides a promising strategy for characterizing the dynamic evolution of molecular causal networks and identifying critical transitions in complex biological systems.

arXiv:2611.35486v1cs.LG

Graph Representation Learning and Its Applications to Integer-valued Parameter Estimation in Linear Models

Graph representation learning models complex relational structures by encoding graph data into vector representations. It also enables approximate solutions to computationally expensive optimization problems with inherent graph structures. Existing graph message passing methods rely on local aggregation operators determined by the Laplacian matrix and often fail to capture information from distant nodes. This thesis proposes a new class of graph Laplacians for adaptive message passing across different levels of graph homophily. The proposed methods outperform state-of-the-art baselines on six of seven benchmark datasets. This thesis then develops learning to optimize methods for integer-valued parameter estimation in linear models, with applications in MIMO communication systems, GPS positioning, and utilization control. The first study extends the Babai estimator to $L_2$-norm regularized estimators and proposes a learning-based method to maximize their success probabilities. The second study shows that the linear model admits a spectral graph convolutional form and proposes GCEPNet, an efficient graph-based estimator that reduces the computational bottleneck of an existing state-of-the-art estimator while matching or outperforming it. The final study proposes GDIM, a graph-based denoising diffusion estimator that addresses high latency and performance degradation in underdetermined linear models. GDIM achieves a more favorable accuracy-runtime trade-off and is effective in both overdetermined and underdetermined settings.

arXiv:2611.35471v1cs.LG

Interpretable Compound Flood Forecasting with Evidence-Graded Explanations

Learning-based compound flood models achieve high predictive accuracy, yet neither accuracy nor model-faithful explanations guarantee physical validity. Validating explanations against field observations is also difficult because extreme floods cannot be reproduced under controlled interventions. We introduce \emph{evidence grading}, a framework that assesses forecast explanations through model checks, observational diagnostics, and paired simulator runs sharing identical histories alongside untrained model controls, recording an explicit evidence class for each explanation type. We apply this framework to an interpretable forecasting system that predicts water levels from explicit future drivers across four architectures. Through one scenario interface, the system explains each forecast peak via three queries: driver attribution, scenario change, and minimum crossing rainfall (the least added rainfall needed to reach a high-water threshold). Across six flood regions on two continents, explicit scenario inputs largely preserve forecast skill. On a simulated coastal network, evidence grading shows that all four architectures learn the node ranking of rainfall impacts and recover 70\% to 97\% of the simulated rainfall response, a property accuracy alone cannot verify, while missing the inland propagation of coastal surge and control operations. Where observational checks cannot resolve driver responses in real systems, grading classifies explanations as \emph{not checkable}. Graded evidence thus systematically separates partially supported, contradicted, and uncheckable explanations for each architecture.

arXiv:2611.35421v1cs.LG

Explaining Deep EEG Emotion Classifiers with Central Counterfactuals

Counterfactual explanations of electroencephalography (EEG) deep learning models may provide actionable insights for downstream applications. However, they can be incompatible with target-class distributions and may produce unrealistic EEG patterns. We propose a framework for generating counterfactual explanations under distributional and physiological constraints. A joint variational classifier-decoder combines affect prediction and EEG reconstruction with adversarial regularization to reduce subject-specific information. The counterfactual objective combines target-class prediction loss, class-conditional density regularization, proximity penalties in latent and reconstructed feature spaces, and physiological constraints on decoded EEG. Typicality optimization aims to generate counterfactual explanations central to the learned target-class distribution in latent space and express the corresponding changes in interpretable EEG frequency-band features. On DREAMER, we averaged ten window probabilities per trial. In leave-one-subject-out evaluation, EEG reconstruction achieved $R^2\simeq0.47$ and trial-level recognition of self-reported emotion was above chance. For eligible, correctly classified trials, we decoded counterfactuals and re-encoded the resulting EEG windows. Full counterfactual optimization (CFO) combined typicality regularization with additional refinement and achieved decoded target-class validity of 67.3% for arousal and 88.8% for valence, versus 24.4% and 48.6% for base CFO. At the 10th-percentile Gaussian discrepancy cutoff for source target-class recordings, full CFO achieved acceptance rates of 40.1% for arousal and 58.4% for valence. Our counterfactual explanations revealed that both models were sensitive to EEG window edges. Edits confined to the first and last 250 ms of each six-second window preserved all 202 tested prediction flips across valence and arousal.