Searcharxiv⌕ Search

arXiv subjects

Xinyuan Song

Publications and source records attributed to Xinyuan Song.

At least 19 recordsLinked to original sources

World Model Science: Self-Organized Criticality, Weak Chaos, and Metastable Belief Dynamics in Long-Horizon LLM Agents

Long-horizon LLM agents must maintain and update a world model over extended sequences of observations, actions, decisions and tool calls. We study the dynamics of long horizon agents from three perspectives: self-organized criticality, weak chaos, and metastable belief dynamics. Through extensive experiments on controlled puzzles, tool-use tasks, embodied environments, multi-hop retrieval, general-assistant reasoning, and Game of Life, we study how world-model errors develop over long interactions. We find that externally increased task pressure can sharply raise the probability of collapse, while naturally occurring pressure is only a modest predictor of later failure. Errors are temporally correlated rather than independent, and their propagation changes with dependency depth while remaining bounded in finite tasks. We also find that locally valid actions can continue after the agent's overall task state has become incorrect, that error structure depends on task topology and horizon, and that belief states in embodied tasks are shallow rather than strongly trapped in incorrect states. Larger horizons allow larger error cascades, but their scale remains constrained by the task and the model's capability. Overall, we observe power-law behavior, bounded divergence consistent with weak chaos, and metastable belief dynamics across long-horizon agent interactions. We call this perspective world model science: the empirical study of self organized criticality in long-horizon agent world models.

cs.AI↗

Heavy-Tailed Memory Traces in Long-Horizon Language Agents

Long-horizon language agents are becoming increasingly important for tasks that require persistent interaction, planning, and reasoning over extended trajectories. External memory plays a central role in these agents by preserving past states, transitions, and experiences beyond the limited context window. Existing memory systems, however, are typically evaluated mainly by task success and token cost, with much less attention to how memory usage is distributed across stored information. We show that repeated retrieval can produce heavy-tailed memory usage, where a small set of states is accessed frequently while many others are rarely retrieved and more prone to prediction errors. We study this phenomenon through a systematic tail audit across retrieval policies and graph structures. We find that memory concentration is reproducible but strongly policy-dependent, ranging from log-normal-compatible patterns under random walks to truncated-power-law-compatible heavy tails under semantic LLM policies. Motivated by these findings, we propose Core-Tail Memory Controller (CTMC), a rank-based memory controller that allocates prompt budget with a single exponent $τ$ while preserving summarized information from the tail. Across Synthetic Graph World and ALFWorld, CTMC substantially reduces memory usage while preserving performance, and on LongMemEval it reduces prompt tokens by 24.48% while maintaining aggregate accuracy. These results show that heavy-tailed memory usage is both a measurable property of long-horizon agent memory and a practical signal for improving memory efficiency.

cs.AI↗

When Do Causal World Models Help Modular LLM Agents

LLM agents increasingly operate in modular systems, where planning requires coordinating multiple functional components whose actions can causally change downstream states and behaviors. This makes intervention-aware prediction essential: an agent must anticipate not only what is likely to happen next, but what will happen as a consequence of its own actions. We find that purely observational world models can incur irreducible intervention-time error in such systems, even when they accurately model observational trajectories. To address this limitation, we propose CausalCompose, a causal world-model framework that equips modular LLM agents with causal structure for intervention-aware prediction and planning. We theoretically show that causal composition can overcome this intervention gap with sufficient evidence and controlled local error. Experiments across diverse modular agent environments validate these results: incorporating causal structure consistently improves intervention-sensitive reasoning and planning, with particularly clear gains in structured tool-use systems where causal dependencies directly govern action execution. Our results show when causal world models help modular LLM agents: when causal dependencies are identifiable and actionable for planning.

cs.AI↗

ActTail: Global Activation Sparsity in Large Language Models

Activation sparsity is a promising approach for accelerating large language model (LLM) inference by reducing computation and memory movement. However, existing activation sparsity methods typically apply uniform sparsity across projections, ignoring the heterogeneous statistical properties of Transformer weights and thereby amplifying performance degradation. In this paper, we propose ActTail, a TopK magnitude-based activation sparsity method with global activation sparsity allocation grounded in Heavy-Tailed Self-Regularization (HT-SR) theory. Specifically, we capture this heterogeneity via the heavy-tail exponent computed from each projection's empirical spectral density (ESD), which is used as a quantitative indicator to assign projection-specific sparsity budgets. Importantly, we provide a theoretical analysis that establishes an explicit relationship between the activation sparsity ratio and the heavy-tail exponent under the HT-SR regime, offering principled guidance for sparsity allocation beyond heuristic design. Experiments on LLaMA and Mistral models show that our method improves both perplexity and downstream task performance at high sparsity compared to uniform allocation. At 80% sparsity, perplexity is reduced by 21.8% on LLaMA-2-7B, 40.1% on LLaMA-2-13B, and 9.4% on Mistral-7B.

cs.CL↗

Homogeneity Pursuit for 3D Point Clouds

This paper proposes a novel classification learning approach to identify the latent group structures in 3D point clouds collected with irregular shapes, which allows 3D point clouds to be classified into different groups with the number of groups and the group membership unknown. 3D point clouds within a group have a common mean function, while mean function heterogeneity is allowed across groups. We first obtain preliminary estimates of the individual mean functions by penalized trivariate splines over triangulation. Based on these preliminary estimates, we develop an agglomerative clustering algorithm to estimate the unknown group structures and propose a ratio criterion to determine the number of groups. We establish the consistency of the estimated number of groups and group membership. Furthermore, we investigate a post-grouping trivariate penalized spline estimation procedure for group-specific mean functions and derive the corresponding asymptotic theory. The proposed method is validated through simulation studies and showcased with an application to the imaging data from the Alzheimer's Disease Neuroimaging Initiative database.

stat.ME↗

CIVER: Causal Intervention Verification for Reliable Code Review

Code review is essential for maintaining software repositories by identifying defects, improving code quality, and supporting reliable software evolution. With the growing adoption of LLM-based coding agents, an increasing number of code contributions and repository changes are generated by these agents. Consequently, LLM-based code review agents are becoming increasingly prevalent to evaluate these contributions and maintain software quality. However, LLM reviewers often generate lengthy reviews containing numerous potential issues, many of which are false positives or lack sufficient evidence. These unreliable reviews can mislead developers and downstream coding agents, motivating the need to distinguish actionable findings from unsupported claims. We propose CIVER, a causal intervention-based framework that identifies the core issues underlying code-review findings and distinguishes genuine defects from false positives. CIVER integrates three modules: a review module assesses findings, an intervention module generates repair-oriented perturbations, and a verifier module scores review reliability. Through joint optimization via expert iteration, the three modules identify genuine defects by responding to targeted repairs while remaining stable under unrelated changes. Extensive experiments on SWE-Review-Bench demonstrate that CIVER correctly identifies 77% of genuine defects through targeted repairs. Cross-project and downstream repair evaluations further demonstrate that CIVER generalizes across repositories and improves coding agents' task success rates, highlighting its effectiveness for reliable automated code review.

cs.SE↗

Skill Dreaming: Evolving Repository Skills through Pull Request Streams

Large language model (LLM) agents increasingly rely on reusable skills for complex software engineering tasks, making skill libraries essential for repository development and maintenance. However, repository-specific skills must evolve with changing code structures, implementation conventions, and maintenance requirements. Pull requests (PRs) provide a natural source of such knowledge by recording how repositories evolve through implementation and review. Meanwhile, new PRs must follow repository-specific implementation patterns, modify related components consistently, and ensure that existing tests continue to pass while adding coverage for new functionality. This creates a mutually reinforcing cycle: PRs provide knowledge for updating skills, while these skills improve future PRs, maintain repositories, and support further skill evolution. To enable this co-evolution of PRs, repositories, and skills, we propose Skill Dreaming, a framework that learns from PR streams to guide continuous repository development and maintenance. Given a repository and its PR history, Skill Dreaming builds a repository-specific skill library by extracting executable knowledge from validated PRs and continuously refines the skills as new PR information becomes available. These skills guide coding agents not only in implementing requested features but also in maintaining associated tests, documentation, compatibility, and repository conventions. By integrating PR analysis, skill management, code execution, and continuous integration, Skill Dreaming provides an end-to-end workflow for applying learned skills to repository changes and incorporating subsequent PR outcomes into future skill updates.

cs.AI↗

Agentic vs. Parametric World Models: Hybrid Planning for Reliable Language Agents

Language agents, such as ReAct, Reflexion, and RAP, implicitly predict how the world will change as they plan and act, using imagined state transitions to guide their decisions. These predictions are encoded in the agents' backbone LLMs as internal beliefs about the environment, effectively forming an implicit world model for multi-step planning. However, hallucinated state information can become embedded in this world model, leading to persistent inaccuracies that influence subsequent decisions. Traditional parametric world models, such as Dreamer and MuZero, learn environment dynamics through explicit transition models, but their limited model capacity makes them difficult to apply directly to modern language-agent planning. We study this tradeoff in graph-structured planning environments and seek to combine the strengths of both paradigms. We propose Hybrid World-Model Planning (HYBRID-WM), which preserves the language agent's semantic planning capabilities while leveraging a lightweight parametric world model for more accurate transition predictions. Specifically, the parametric model constructs a compact planning skeleton to guide action generation while maintaining consistency between the agent's imagined transitions and the model's predictions. Experiments across four graph-structured planning benchmarks demonstrate that HYBRID-WM consistently improves task success and reduces hallucinated-state propagation with modest computational overhead. These findings highlight the effectiveness of combining semantic planning with lightweight parametric grounding for reliable long-horizon language-agent planning.

cs.AI↗

Ask the World Before Acting: Environment Probing for Calibrating Agent World Models

Long-horizon language agents enable autonomous decision-making in complex environments by planning and executing sequences of interdependent actions. To act reliably, these agents must maintain an accurate world model that tracks the environment's evolving state and supports subsequent decisions. However, as interactions accumulate, stored beliefs can become outdated or incorrect, causing agents to plan and act on assumptions that no longer reflect the environment. Such errors are difficult to resolve through additional reasoning or self-reflection alone, because the information needed for correction must be obtained from the environment. Actively probing the environment therefore offers a direct way to verify and correct these beliefs. To this end, we introduce ENVPROBE, a framework that enables agents to actively explore their environments and correct inaccurate beliefs during long-horizon execution. Specifically, ENVPROBE prioritizes belief fields for verification based on task relevance and potential errors. It then selectively probes the environment to retrieve the actual value of a chosen field and incorporates the observation into the agent's world model. With the updated beliefs, the agent revises its plan and continues execution based on the newly acquired environmental information. Extensive experiments across three controlled environments demonstrate that ENVPROBE substantially improves terminal world-state accuracy compared with agents operating without environment probing, leading to more reliable long-horizon decision-making. These results demonstrate the importance of actively verifying and correcting beliefs through environmental interactions for maintaining accurate world models in long-horizon language agents.

cs.AI↗

Repair the Core, Not the Symptom: Planning-Graph Repair for Long-Horizon Agents

Long-horizon language agents make interdependent decisions across multiple rounds, forming growing planning graphs in which later decisions depend on earlier states, observations, and tool outputs. Errors in these graphs can therefore propagate through subsequent decisions and amplify over long rollouts. Correcting the most visible failure may therefore fix a symptom while leaving the core that drives downstream errors unchanged. Replaying the entire planning graph provides the opposite extreme, but becomes increasingly expensive as the graph grows and forces an LLM to reason over substantial irrelevant context. We study planning-graph repair: given a failed rollout, the goal is to identify and correct the compact core responsible for continued error propagation while preserving the remainder of the graph. We first evaluate a range of practical engineering repair strategies, including single-error and TopK repair, temporal windows, neighborhood expansion, cascade-aware repair, and full-graph LLM correction. We then propose ReCore (Repair the Core), which models the coupled propagation of node and edge errors to identify the core of a failed planning graph. Rather than repairing the largest observed errors or expanding a fixed local neighborhood, ReCore selects a connected core whose correction maximally reduces residual error amplification, and exposes only this core to the LLM for diagnosis and repair. We also theoretically establish a bound on long-horizon planning regret. Extensive experiments on synthetic Agent Calling-Tree graphs and the Who\&When attribution benchmark show that ReCore improves long-horizon stabilization and root-cause localization by targeting high-amplification repair regions, matching full-context recovery with up to $7.4\times$ fewer tokens for every successful repair.

cs.AI↗

ISO: An RLVR-Native Optimization Stack

Reinforcement learning with verifiable rewards (RLVR) advances the reasoning capabilities of language models, yet the optimization layer that converts reward feedback into weight-space updates remains poorly understood. We study this layer and functionally validate spectral inheritance: RLVR can reuse the base model's weight spectra while acquiring new behavior by adapting both the associated input and output singular frames. We operationalize this finding as Isospectral Optimization (ISO), an RLVR-native optimization stack with complementary offline and online instantiations. Offline, ISO-Merger composes shared-base specialists in fixed-spectrum frame coordinates without post-merge data, rollouts, or distillation, and achieves the highest aggregate scores among the data-free merging methods. Online, ISO-Optimizer applies AdamW or Muon directly to the frame variables under fixed base spectra, improving aggregate accuracy in the reported math and coding experiments. On Qwen3-4B-Base, ISO-AdamW reaches AdamW's 400-update accuracy in 280 updates with 1.5 X fewer updates and 27% less wall-clock time, and exceeds AdamW by 2.2 points at update 400. These results support a reusable RLVR design principle: inherit the spectrum, optimize the frames.

cs.LG↗

Measuring Harness-Induced Belief Divergence in Multi-Step LLM Agents

Software agents are becoming increasingly important in modern coding workflows, where they solve complex tasks through multi-step interaction with code repositories. A central component of these systems is the execution harness, which governs how the underlying LLM observes, acts on, and verifies its environment. We show that the harness can in turn shape the agent's evolving beliefs about the environment, even when the task, environment, and base LLM remain fixed. To reveal this effect, we introduce a belief-rollout diagnostic that traces how an agent's anticipated world state and future decisions evolve under alternative harnesses. We further separate immediate divergence introduced by the interface from divergence that develops over longer horizons. Across controlled coding tasks include HIBench-Code, SWE-bench Verified and Terminal-Bench, we find substantial cross-harness belief divergence that is often invisible from terminal success alone and can propagate into different downstream actions. Building on this observation, we introduce Belief-Invariant World-Modeling (BIWM), which exposes evidence hidden or compressed by harness execution and aligns the resulting belief trajectories across different harnesses. Our findings reveal that harness design can systematically shape how software agents understand and act on their environments, providing practical guidance for building and evaluating more reliable coding agents. Our code is available at https://github.com/Hik289/Harness-induce-bias.git.

cs.AI↗

ManifoldFlow: Spectrum-Learnable Stiefel Optimization via SPD Relaxation

Orthogonal and Stiefel constraints are widely used in neural network optimization to control weight geometry, improve conditioning, and stabilize signal propagation. Yet standard Stiefel optimization imposes a hidden restriction: while learning the directions of a linear map, it fixes every singular value to one, preventing the model from learning how strongly different directions should be amplified or suppressed. We introduce ManifoldFlow, a spectrum-learnable extension of Stiefel optimization that separates directional geometry from spectral scaling through $W=QS^{1/2}$, where $Q^\top Q=I$ and $S\succ0$. Beyond simply making the spectrum trainable, ManifoldFlow uses the gradient component rejected by the Stiefel constraint as a signal for how the spectrum should change, accumulates this signal across aligned tangent spaces, and jointly updates the orthonormal basis and a bounded SPD spectrum. This construction preserves exact spectral interpretability because $W^\top W=S$, while recovering standard Stiefel optimization when $S=I$. We establish the geometry of the rejected gradient, characterize optimization over the resulting Stiefel--SPD product space, and derive how the learned spectrum affects conditioning, signal propagation, and spectral complexity. Across diverse tasks, ManifoldFlow consistently outperforms matched fixed-spectrum Stiefel baselines, with particularly strong gains in recurrent language modeling. Our code is available at https://github.com/Hik289/manifold_flow.git.

cs.LG↗

HarnessMDP: Learning to Control LLM Agent Harnesses with Offline Reinforcement Learning

The execution harness is a critical component of LLM agents, shaping how the agent interacts with its environment and organizes multi-step execution. Prior work has shown that improving tools, workflows, and other harness components can substantially improve agent performance. This suggests that the harness can be treated as a learnable control layer that adapts execution decisions from experience, rather than as a predetermined execution configuration. In this work, we introduce HarnessMDP, a learning-based framework that makes harness control itself learnable. HarnessMDP formulates agent execution as a finite-horizon Markov decision process, where the harness learns to select structural execution actions from the evolving agent state. The harness policy is learned offline from collected trajectories using task performance and deployed online to adaptively control new executions. Extensive experiments on coding tasks, $τ$-bench, AgentBench, and other agent evaluation settings show that HarnessMDP consistently improves execution behavior and final task performance over baseline harnesses. These results demonstrate the effectiveness of HarnessMDP and establish learnable harness control as a practical mechanism for improving LLM agents through better execution. Our code is available at https://github.com/Hik289/Agentic-RL-harness.git.

cs.LG↗

MegaMem: A Retrieval Solution for Ultra-Large Context Windows

Modern language models and agents increasingly require persistent memory for complete codebases, long interaction histories, and heterogeneous enterprise records. The key challenge is to keep hundreds of millions of tokens searchable while passing only bounded source evidence to the answer model. We introduce MegaMem, a source-resolved dual-view retrieval system that separates semantic access from generation evidence. Distilled records and detailed evidence are searched with original and transformed queries; every distilled hit resolves to an immutable source ID before reciprocal-rank fusion, deduplication, and cross-encoder reranking; and only the highest-ranked detailed evidence within a fixed budget supports generation. Post-answer attribution then identifies which loaded sources support the fixed answer. We evaluate MegaMem on EnterpriseRAG-Bench, which contains more than 500,000 heterogeneous enterprise documents and approximately 650M tokens. MegaMem improves Overall from 68.22 to 82.26 and reaches 86.50 Correctness. These results show that MegaMem supports ultra-large persistent memory while preserving strong answer accuracy under a bounded generation context. By separating searchable memory scale from answer-context size, MegaMem provides a practical path toward accurate retrieval over memories ranging from hundreds of millions to one billion tokens. Our code is available at https://github.com/ xfab-xinyuansong/MegaMem.git.

cs.AI↗

MEMONDEMAND: A Memory Management System for Large-Scale Enterprise Data

Enterprise repositories are large, heteroge- neous, and continuously updated, making re- trieval difficult when efficient access, source- faithful evidence, and cross-query adaptation must be supported together. Enterprise mem- ory extends retrieval beyond the model con- text, but existing systems do not jointly address collection-specific hierarchy construction, low- cost routing, detailed evidence loading, and workload-aware memory updates at this scale. We introduce MEMONDEMAND, short for On- Demand Memory, a memory management sys- tem with three coordinated mechanisms: a dy- namic multi-level hierarchy that determines the abstraction structure and depth for each col- lection, dual memory at every hierarchy level that separates distilled routing from detailed evidence, and on-demand memory promotion that updates node priority under a bounded active-state budget. On EnterpriseRAG-Bench, MEMONDEMAND outperforms the strongest published LB#1 result at every evaluated scale from 10M tokens through the complete 618M- token collection, with gains of 12.23% at 10M and 4.66% at 618M. Results on FinanceBench, HotpotQA, and FRAMES further show strong performance across financial, multi-hop, and fact-retrieval settings. Together, these results establish MEMONDEMAND as an accurate, ef- ficient, and scalable memory solution for very large enterprise repositories across data scales, domains, and evidence requirements. Our code is available at https://github.com/ xfab-xinyuansong/MemOnDemand.git.

cs.AI↗

Parameter-Efficient Temporal Domain Generalization

Temporal domain generalization (TDG) learns from a sequence of observed domains to predict models for unseen future domains. Existing parameter-dynamics methods become prohibitively expensive at modern backbone scales because their temporal encoders and generators operate on the entire adapted parameter state. Replacing full-model updates with LoRA does not remove this failure mode: the dynamics model must still encode and reconstruct every adapter parameter, making the auxiliary model itself prohibitively large for modern backbones. We propose Low-rank Time-varying Core (LoTiC), a parameter-efficient TDG method that decomposes temporal updates into shared low-rank bases and a compact core. The bases define a stable update subspace, while only the core evolves. LoTiC therefore learns temporal dynamics in an r*r space instead of tracking the full adapter. We justify this factorization through the geometry of parameter increments and support continuous, recurrent, and time-conditioned core models. Experiments span six controlled and real-world benchmarks, three data modalities, classification and generation, and backbones from 66M to 8B parameters. LoTiC ranks first in 14 of 15 settings, including near-perfect future-domain accuracy with an 8B backbone on Rotating 2-Moons. It adds only 0.13--0.51% trainable parameters beyond LoRA and trains 1.8--7.1$\times$ faster than parameter-dynamics baselines. These results establish that temporal parameter dynamics can remain both learnable and efficient as pretrained backbones scale.

cs.LG↗

Understanding Rollout Error in Graph World Models

World models are increasingly used for planning by predicting future states under candidate actions. Many planning environments, however, are naturally graph-structured, with agents, tools, skills, routes, and dependencies connected through fixed or evolving relations. Understanding how prediction errors accumulate in such graph-structured rollouts is therefore critical for reliable long-horizon planning.In this work, we systematically study how rollout errors propagate in Graph World Models (GWMs). We analyze both fixed- and dynamic-edge regimes and derive topology-aware error bounds that characterize the roles of graph structure, learned dynamics, and evolving edges. We then validate these theoretical findings across synthetic graph topologies and heterogeneous agent-graph testbeds, showing that rollout error and planning regret increase with horizon and that dynamic-edge training is important when graph structure evolves. Together, these results characterize when GWMs remain reliable under long-horizon planning and when graph structure amplifies rollout errors. Motivated by these findings, we propose Error-Aware GWM, which combines spectral regularization, rollout consistency, and critical-node weighting, and improves long-horizon stability without sacrificing one-step accuracy. Experiments show that Error-Aware GWM consistently improves long-horizon rollout stability without sacrificing prediction accuracy.

cs.AI↗