When researchers refine ideas with large language models over several turns, do the models preserve the original brief's constraints? We introduce DriftBench, a benchmark for constraint adherence in multi-turn LLM-assisted scientific ideation. It pairs 38 research briefs from 24 scientific domains, each with hard constraints and banned moves, with four interaction conditions and seven models from five providers (two open-weight), scored on 2,116 runs. Iterative pressure to improve a proposal raises structural complexity in every model and lowers adherence to the brief's hard constraints. A restatement probe shows that the constraints stay legible and reproducible on demand while the proposal departs from them. The knows-but-violates (KBV) rate, the share of pressure runs scored non-compliant on a hard constraint despite a correct restatement, exceeds 50% for most models. A crossed-judge design measures the judge offset. GPT-5.4 scores adherence 0.535 points lower than Opus 4.6 on the same runs. The design finds no judge-by-condition interaction on adherence, so the pressure effect on adherence is judge-stable while KBV levels and the bottom of the model ranking are not. Re-eliciting the brief at checkpoints lowers KBV for some models but not others, and complexity inflation persists. Blind human raters find more constraint violations than the LLM judge, so reported adherence is conservative. We release all briefs, prompts, rubrics, transcripts, and scores.
This paper introduces AutoREC, an open-source Python platform for developing, training and evaluating reinforcement learning (RL) agents that automatically generate equivalent circuit models (ECMs) from electrochemical impedance spectroscopy (EIS) data. Although ECMs are widely used to interpret EIS measurements, their identification typically relies on manual trial-and-error, requiring domain expertise and limiting scalability, particularly in autonomous experimental pipelines such as self-driving laboratories. In AutoREC, ECM generation is formulated as a Markov decision process in which an RL agent sequentially modifies a circuit topology based on the current state, available actions and feedback from the resulting model. The platform supports an end-to-end workflow encompassing EIS preprocessing with selectable impedance representations, agent setup and training, ECM generation for new measurements and visualization-based evaluation and analysis of agent decision-making. AutoREC implements a configurable Double Deep Q-Network agent with prioritized experience replay and a dedicated deadloop mitigation strategy for navigating the complex circuit-generation action space efficiently. To demonstrate the platform, we trained a representative agent on 1350 synthetic spectra from five reference circuit families, evaluated it on 150 held-out synthetic spectra and applied it to 32 previously unseen experimental spectra from battery, corrosion, oxygen evolution reaction and CO2 reduction systems. These case studies illustrate the end-to-end capabilities of AutoREC while revealing challenges associated with experimental complexity and limited training-data coverage. The demonstrated agent serves as a reference implementation; AutoREC provides an extensible foundation through which users can develop and evaluate agents tailored to their specific electrochemical systems and research objectives.
Drifting models are capable one-step generative models trained to follow a drifting field. The field combines attractive and repulsive softmax-weighted centroids over the data and current-generator distributions. In practice, only a minibatch of $n$ samples from each distribution is available, and each centroid is approximated by an empirical estimate. In this paper, we begin by showing that the minibatch centroid is in general a biased estimator of the target centroid, with a pointwise $O(1/n)$ bias arising from softmax self-normalization. Correcting this bias requires the expectation over the full distribution, which is intractable. We instead approximate the leading bias term from in-batch statistics and propose Analytical Bias Correction (ABC), a closed-form plug-in adjustment. We prove that ABC reduces the bias from $O(1/n)$ to $O(1/n^2)$, introduces no first-order increase in total variance, and preserves convex-hull containment of the corrected centroid. In practice, ABC requires only two additional lines of code and has negligible wall-time overhead under compiled execution. Toy experiments confirm the theoretical $O(1/n)$ and $O(1/n^2)$ scaling. On CIFAR-10, ABC reduces FID and trains faster, with the largest gains at small $n$, where the bias is most significant.
Safety is a key problem in reinforcement learning, especially during exploration. While safety filters are promising to address this issue, they are ill-suited for high- dimensional systems with unknown dynamics. We propose Dyna-style Safety Augmented Reinforcement Learning (Dyna-SAuR), a novel algorithm that learns a control policy as well as a safety filter requiring minimal domain knowledge by leveraging a learned uncertainty-aware dynamics model. A novel filter learning formulation requires the filter to avoid failures and areas of high model uncertainty. As joint deployment of the control policy and filter allows to safely collect data and improve the dynamics model, certain areas grow and filter conservatism decreases over time. Dyna-SAuR reduces failures compared to established safe RL baselines by two orders of magnitude on goal-reaching CartPole and MuJoCo Walker.
Recovering latent structure from count data has received considerable attention in network inference, particularly when one seeks both cross-group interactions and within-group similarity patterns in bipartite networks, which are widely used in ecology research. Such networks are often sparse and prone to imperfect detection. Existing models mainly focus on interaction recovery, while the induced similarity graphs are much less studied. Moreover, existing models for under-counted data place sparsity, if at all, on the detection model rather than on these graphs. To address these issues, we propose a nonnegative low-rank factorization framework that jointly estimates detection probabilities and promotes sparse within- and cross-group graphs through $\ell_{1/2}$ regularization. For the resulting nonconvex, nonsmooth problem, we develop an ADMM-based algorithm with adaptive penalization, and establish asymptotic feasibility and KKT stationarity of cluster points under stated assumptions. We also give sufficient conditions for exact recovery of within- and cross-group graphs. On synthetic data with up to 20% missing entries, the method recovers the graphs and detection probabilities with competitive accuracy. Across three ecological datasets, it matches the baseline held-out predictions while estimating detection probabilities and within- and cross-group graphs.
Phase-field models are widely used to simulate microstructure evolution but their numerical solution remains computationally demanding. Neural operator surrogates provide a promising alternative, yet existing approaches are data-driven, requiring large datasets and exhibiting limited robustness when extrapolating to unseen configurations. We introduce DeepRitzSplit, an unsupervised neural operator framework for gradient-flow systems based on a variational formulation of energy-stable splitting schemes. It learns the time evolution semigroup associated with a convex-concave free-energy decomposition by minimizing the underlying variational problem at each time step. It is designed to inherit the dissipative structure of the underlying gradient flow without requiring trajectory datasets. We further introduce a Reaction-Diffusion Neural Operator (RDNO) architecture motivated by splitting schemes, with separate reaction and diffusion components to improve training efficiency and interpretability. We assess the approach on the Allen-Cahn equation and apply it to a phase-field model of anisotropic dendritic growth during solidification. In the Allen-Cahn benchmark, DeepRitzSplit shows better generalization than the supervised baseline on the out-of-distribution configurations tested, using 180 training configurations. In dendritic growth, the method captures the overall phase morphology and dendrite tip velocity well, while the tip radius is more sensitive to the training strategy. Refinement based on the residual of the splitting scheme markedly improves this second-order morphological quantity. The trained operators retain good predictive capabilities on configurations substantially different from the training set. These results demonstrate the potential of variationally trained neural operators as physically informed surrogates for accelerated microstructure simulations.
Source-Free Domain Adaptation (SFDA) seeks to adapt a source model, which is pre-trained on a supervised source domain, for a target domain, with only access to unlabeled target training data. Relying on pseudo labeling and/or auxiliary supervision, conventional methods are inevitably error-prone. To mitigate this limitation, in this work we for the first time explore the potentials of off-the-shelf vision-language (ViL) multimodal models (e.g., CLIP) with rich whilst heterogeneous knowledge. We find that directly applying the ViL model to the target domain in a zero-shot fashion is unsatisfactory, as it is not specialized for this particular task but largely generic. To make it task-specific, we propose a novel DIFO++ approach. Specifically, DIFO++ alternates between two steps during adaptation: (i) Customizing the ViL model by maximizing the mutual information with the target model in a prompt learning manner, (ii) Distilling the knowledge of this customized ViL model to the target model, centering on gap region reduction. During progressive knowledge adaptation, we first identify and focus on the gap region, where enclosed features are entangled and class-ambiguous, as it often captures richer task-specific semantics. Reliable pseudo-labels are then generated by fusing predictions from the target and ViL models, supported by a memory mechanism. Finally, gap region reduction is guided by category attention and predictive consistency for semantic alignment, complemented by referenced entropy minimization to suppress uncertainty. Extensive experiments show that DIFO++ significantly outperforms the state-of-the-art alternatives. Our code and data are available at https://github.com/tntek/DIFO-Plus.
Majority voting offers a simple way to combine answers from multiple large language model (LLM) agents. When a majority follows instructions favoring the same incorrect answer, however, agreement reinforces the error. We call this failure the "consensus trap": a minority may identify the error, yet its reasoning cannot change a vote over completed answers. We introduce chunk-interleaved Round-Robin (RR) collaboration, in which agents take turns extending one unfinished reasoning trajectory. A minority of agents with correct reasoning can insert corrections that subsequent speakers read before the answer is complete. RRMaj combines several such trajectories by a final vote. We characterize a majority barrier for outcome-level voting over final answer labels and derive a local sufficient condition for expected progress when the minority's cumulative corrections outweigh opposing corrupted updates. Across model families and verifiable reasoning benchmarks, RRMaj substantially improves accuracy under majority corruption while retaining comparable average performance under minority corruption in the main advisory-instruction setting. RR also strengthens full-response debate. Scoring the shared reasoning between turns shows that, on average, continuations from uncorrupted agents increase support for the correct answer over the incorrect target. Parallel local serving adds modest latency in the measured deployment. These findings show how language shared during reasoning, and the timing of that exchange, can help a minority correct a group's answer.
Modern distributed networks, notably transformers, acquire a remarkable ability (termed `in-context learning') to adapt their computation to input statistics, such that a fixed network can be applied to data from a broad range of systems. Here, we provide a complete mechanistic characterization of this behavior in transformers trained on a finite set $S$ of discrete Markov chains. The transformer displays four algorithmic phases, characterized by whether the network memorizes and generalizes, and whether it uses 1-point or 2-point statistics. We show that the four phases are implemented by multi-layer subcircuits that exemplify two qualitatively distinct mechanisms for implementing context-adaptive computations. Minimal models isolate the key features of both motifs. Memorization and generalization phases are delineated by two boundaries that depend on data diversity, $K = |S|$. The first ($K_1^\ast$) is set by a kinetic competition between subcircuits and the second ($K_2^\ast$) is set by a representational bottleneck. A symmetry-constrained theory of a transformer's training dynamics explains the sharp transition from 1-point to 2-point generalization and identifies key features of the loss landscape that allow the network to generalize. Put together, we show that transformers develop distinct subcircuits to implement in-context learning and identify conditions that favor certain mechanisms over others.
Continuous diffusion has served as a foundation for high-fidelity, controllable, and few-step generation across continuous data modalities such as images, videos, and molecular structures. However, in language modeling, prior continuous diffusion language models (DLMs) lag behind discrete counterparts. Existing categorical and simplex-based approaches operate over extremely large and sparse language spaces, while prior embedding-space approaches avoid this sparsity but lack a well-selected design space. In this work, we close this gap with LangFlow by connecting embedding-space DLMs to Flow Matching, alongside three key innovations: (1) we derive a novel ODE-based NLL bound for principled evaluation of continuous flow-based language models; (2) we propose an information-uniform principle for setting the noise schedule, which motivates a learnable noise scheduler based on a Gumbel distribution; and (3) we revise prior training protocols by incorporating self-conditioning, which improves both likelihood and sample quality for embedding-space DLMs and behaves differently from its use in discrete diffusion. Putting everything together, LangFlow is competitive with top discrete DLMs on generative quality, reaching a generative perplexity of 92.3 on LM1B and 36.5 on OpenWebText. It also outperforms discrete counterparts on reasoning tasks like Sudoku. As the first continuous DLM shown to rival discrete diffusion in generative quality, LangFlow provides clear evidence that continuous diffusion is a promising paradigm for language modeling. Code: https://github.com/nealchen2003/LangFlow.
Automatic differentiation computes loss Hessians, while interpreting inter-layer interactions requires an explicit choice of graph-indexed blocks. This paper presents an analytical formalism that decomposes the full Hessian into blocks indexed by the DAG of an architecture. The standard decomposition $H = H^{GN} + H^T$ separates the Gauss-Newton component (positive semidefinite for a convex output loss) from the tensor component (residual curvature). If every node map is locally affine in its parent activations, the tensor component of the input Hessian vanishes on each smooth cell ($H^{T}_{v,w}=0$, $H^f_{v,w}=H^{GN}_{v,w}$); ReLU activations alone do not suffice. The full parametric Hessian contains residual terms that do not reduce to the GGN. Building on this decomposition, we use diagnostic metrics (inter-layer resonance $\mathcal{R}$, geometric coupling $\mathcal{C}$, stable rank $\mathcal{D}$, GN-Gap) with stochastic HVP-based estimates whose cost depends on graph evaluation and the number of probes. The theoretical analysis gives conditional bounds on curvature decay and residual-chain transport; empirical examples span fully connected MLPs (Exp. 1-5) and convolutional architectures (ResNet-18, ${\sim}11$M parameters, Exp. 6). When the architecture reduces to a single node, all definitions collapse to the standard Hessian $\nabla^2_\theta\mathcal{L}(\theta)\in\mathbb{R}^{p\times p}$. Archival correction. The original general novelty claims are no longer maintained: general DAG-Hessian calculus has prior precedents. This is a corrected archival version.
The disintegration of liquid sheets into ligaments and droplets involves highly transient, multi-scale dynamics that are complex to quantify from high-speed shadowgraphy images. Identification of droplets, ligaments, and blobs formed by the breakup of a liquid sheet, and their tracking from frame to frame, is an essential part of spray analysis. Analysis of such processes poses a fundamental challenge for conventional multi-object tracking frameworks, which enforce strict one-to-one temporal associations and cannot represent one-to-many fragmentation events. We present a two-stage deep learning framework that detects droplets and ligaments and identifies their temporal relationships across successive frames, modeling ligament deformation, fragmentation, and parent-child lineage. In the first stage, a Faster R-CNN detector with a ResNet-50 backbone and Feature Pyramid Network classifies ligaments and droplets in recordings of two impinging Carbopol gel jets. A morphology-preserving synthetic data generation strategy enriches the training set without physically implausible configurations, achieving a held-out test F1 score of up to 0.872 across fourteen original-to-synthetic data configurations, with robustness tested on different atomization conditions and liquid compositions. In the second stage, a Transformer-augmented multilayer perceptron classifies inter-frame object associations into continuation, fragmentation (one-to-many), and non-association using physics-informed geometric features. Despite severe class imbalance, the model achieves 86.1% accuracy, 93.2% precision, and perfect recall (1.00) for fragmentation events on the held-out test set. Together, the two stages preserve parent-child lineage and enable extraction of breakup statistics, including fragment multiplicity and droplet size distributions, offering an automated analysis of the primary mode of atomization.
Despite extensive research, Large Language Models continue to hallucinate when generating code, particularly when using libraries. On NL-to-code benchmarks that require library use, we find that LLMs generate code that uses non-existent library features in 8.1-40% of responses. One intuitive approach for detection and mitigation of hallucinations is static analysis. In this paper, we analyse the potential of static analysis tools, both in terms of what they can solve and what they cannot. We find that static analysis tools can detect 16-70% of all errors, and 14-85% of library hallucinations, with performance varying by LLM and dataset. Through manual analysis, we identify cases a static method could not plausibly catch, which gives an upper bound on their potential from 48.5% to 77%. Overall, we show that static analysis methods are cheap method for addressing some forms of hallucination, and we quantify how far short of solving the problem they will always be.
Three-dimensional medical image data and computer-aided decision making, particularly using deep learning, are becoming increasingly important in the medical field. To aid in these developments we introduce PR3DICTR: Platform for Research in 3D Image Classification and sTandardised tRaining. Built using community-standard distributions (PyTorch and MONAI), PR3DICTR provides an open-access, flexible and convenient framework for prediction model development, with an explicit focus on classification using three-dimensional medical image data. By combining modular design principles and standardization, it aims to alleviate developmental burden whilst retaining adjustability. It provides users with a wealth of pre-established functionality, for instance in model architecture design options, hyper-parameter solutions and training methodologies, but still gives users the opportunity and freedom to ``plug in'' their own solutions or modules. PR3DICTR can be applied to any binary or event-based three-dimensional classification task and can work with as little as two lines of code.
The paradigm of scaling Large Language Models (LLMs) in both parameter size and test time has pushed the boundaries of AI capabilities, but at the cost of making the traditional generative evaluation paradigm prohibitively expensive, therefore making the latency of LLM's in-training downstream performance evaluation unbearable. However, simple metrics like training loss (perplexity) are not always correlated with downstream performance, as sometimes their trends diverge from the actual task outcomes. This dilemma calls for a method that is computationally efficient and sufficiently accurate in measuring model capabilities. To address this challenge, we introduce a new in-training evaluation paradigm that uses a lightweight probe for monitoring downstream performance. The probes take the internal representations of LLM checkpoints (during training) as input and directly predict the checkpoint's performance on downstream tasks measured by success probability (i.e., pass@1). We design several probe architectures, validating their effectiveness using the OLMo3-7B's, OLMo3-32B's, and Apertus-8B's checkpoints across a diverse set of downstream tasks. The probes can accurately predict a checkpoint's performance (with avg. AUROC$>$0.75), have decent generalizability across checkpoints (earlier predicts later), and reduce the computation latency from $\sim$1 hr (using conventional generative evaluation method) to $\sim$3 min. In sum, this work presents a practical and scalable in-training downstream evaluation paradigm, enabling a more agile, informed, and efficient LLM development process.
In this paper, we present a Koopman autoencoder-based least-squares policy iteration (KAE-LSPI) algorithm for reinforcement learning (RL). The KAE-LSPI algorithm is based on reformulating the so-called least-squares fixed-point approximation method in terms of extended dynamic mode decomposition (EDMD), thereby enabling automatic feature learning via the Koopman autoencoder (KAE) framework. The approach is motivated by the lack of a systematic procedure for selecting features or kernels in linear RL techniques. Unlike previous approaches, no features or kernels need to be fixed a priori in our method. We discuss the theoretical convergence of KAE-LSPI under suitable assumptions, similar to kernel-based least-squares policy iteration (KLSPI). We empirically compare our method with two existing algorithms: least-squares policy iteration (LSPI) and KLSPI. In particular, for the chainwalk problem, the resulting policies are either optimal or nearly optimal for both three approaches. For the cart-pole system, KAE-LSPI outperforms the other two approaches in terms of policy performance.
Efficiently aggregating spatial or temporal horizons to acquire compact representations has become a unifying principle in modern deep learning models, yet learning data-adaptive representations for long-horizon sequence data, especially continuous sequences like time series, remains an open challenge. While fixed-size patching has improved scalability and performance, discovering variable-sized, data-driven patches end-to-end often forces models to rely on soft discretization, specific backbones, or heuristic rules. In this work, we propose Reinforcement Patching (ReinPatch), a novel framework that jointly optimizes a sequence patching policy and its downstream sequence backbone model with reinforcement learning. By formulating patch boundary placement as a discrete decision process optimized via Group Relative Policy Gradient (GRPG), ReinPatch bypasses the need for continuous relaxations and performs dynamic patching policy optimization in a natural manner. Moreover, our method allows strict enforcement of a desired compression rate, freeing the downstream backbone to scale efficiently, and natively supports multi-level hierarchical modeling. We evaluate ReinPatch on time-series forecasting datasets, where it demonstrates compelling performance compared to state-of-the-art data-driven patching strategies. Furthermore, our detached design allows the patching module to be extracted as a standalone foundation patcher, providing the community with visual and empirical insights into the segmentation behaviors preferred by a purely performance-driven neural patching strategy.
Learning-based models for fluid dynamics often operate in unconstrained function spaces, leading to physically inadmissible, unstable simulations. Penalty-based methods can reduce constraint violations but do not guarantee exact incompressibility. In this work, we introduce a unified framework that enforces the incompressible continuity equation as a hard, intrinsic constraint for both deterministic and generative modeling. We integrate a differentiable spectral Leray projection into neural operators to enforce incompressibility. For flow matching, we construct a divergence-free Gaussian reference measure via a curl-based pushforward, so that the reference samples, interpolation paths, and velocity targets are compatible with the projected dynamics. Experiments on 2D Navier-Stokes equations demonstrate exact incompressibility up to discretization error and substantially improved stability and physical consistency.
Collaborative perception assumes that participating agents share compatible feature representations, yet this assumption often fails in practice. Beyond explicit differences in backbone architecture or sensor modality, independently trained models can exhibit latent domain shifts and cause naive feature fusion to contaminate rather than complement each agent's representation. To address this, we propose HyDRA (Hybrid Domain-Aware Robust Architecture), a training-free framework that uses a lightweight domain classifier to identify whether each agent shares a compatible feature domain, and adaptively select the fusion strategy. Homogeneous agents are combined through intermediate fusion to maximize information gain, whereas heterogeneous agents are routed to late fusion to avoid contamination. To further mitigate localization errors inherent in late fusion, HyDRA incorporates anchor-guided pose graph optimization. Extensive experiments show that HyDRA matches state-of-the-art methods under architecture heterogeneity, and improves overall AP@0.7 over late fusion by nearly 25% under latent domain heterogeneity.
LLMs and coding agents can now tackle complex, long-horizon tasks through advances in reinforcement learning, but stronger task-solving capabilities do not necessarily preserve safety alignment. Recent AI agent incidents involving reward hacking indicate how optimizing for task success can bring learned capabilities into conflict with safety alignment. In this work, we identify a critical failure mode that manifests this conflict, which we term Internal Safety Collapse (ISC). When completing otherwise benign coding tasks, AI agents can prioritize satisfying program requirements over safety constraints, generating large volumes of sensitive content, including unsafe outputs, as task data. To study this phenomenon, we introduce TVD (Task, Validator, Data), a framework for building controlled workflows that require sensitive content for completion. Through extensive experiments, we observe instances of highly harmful content that closely resemble outputs from early, unaligned LLMs in 2023. We further find that ISC can be effectively triggered even in highly capable LLMs such as Claude Fable 5. These results indicate that, despite substantial alignment efforts, frontier LLMs remain internally unsafe: safety alignment primarily reshapes surface behavior without eliminating the underlying knowledge that enables unsafe outputs. Our findings underscore the need for caution when deploying LLMs in high-stakes settings, such as scientific pipelines and autonomous agents. Content Warning: This paper contains examples of harmful content. Source code: https://github.com/wuyoscar/Internal-Safety-Collapse