arXiv:2610.25119cs.LGOct 2026

Manuscript Offprint

arXiv:2610.25119

Memory as Belief: Bayesian Evolution of Memory for Self-Evolving LLM Agents

Yiming Xu, Qian Yang, Zihan Chen, Yuefei Wu, Wenhan Zeng, Bin Shi, Bo Dong

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large language model (LLM) agents increasingly rely on external memory to accumulate past experiences for continual adaptation. However, effectively reusing memory requires accurately assessing its value, as retrieved experiences may become unreliable when transferred across task contexts. Despite its importance, memory valuation remains largely underexplored, with existing methods relying on historical retrieval success rates that overlook the context dependency of memory usefulness and the varying reliability of estimates under different amounts of evidence. Inspired by the Bayesian brain hypothesis, we propose BEAM (Bayesian-style Evolutionary Agentic Memory), a framework that reformulates memory value evaluation as a parameterized cognitive inference process, where memory value is represented as a context-conditioned dynamic belief rather than a passive historical statistic. Specifically, BEAM infers memory value beliefs from current task contexts and continuously calibrates them using execution feedback as empirical evidence, transforming memory from passive storage into an adaptive cognitive mechanism for continual self-evolution. Extensive experiments across reasoning and code generation benchmarks demonstrate that BEAM consistently improves memory utilization and enables continual self-evolution of LLM agents.

Introduction

Large language models (LLMs) have demonstrated remarkable efficacy in natural language understanding, code generation, knowledge-intensive QA, and complex reasoning (Yao et al. 2023; Zhao et al. 2024; Jimenez et al. 2024; Singh et al. 2025). As LLMs increasingly serve as the foundation for autonomous agents, the deployment paradigm is shifting from static benchmark evaluations to continuous streams of open-world tasks (Xie et al. 2023; Xu et al. 2026a). However, when operating over continuous task streams, contemporary agent systems largely fail to learn from accumulated cross-task experience (Zhang et al. 2026a; Xu et al. 2026b). Since they process each task in isolation, agents repeatedly encounter similar failures and overlook valuable transferable insights from related tasks (Ouyang et al. 2026). Therefore, enabling agents to accumulate and leverage valuable experiences across tasks has become a fundamental challenge toward achieving reliable self-evolving systems.

Copyright © 2027, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

In practical deployment, continuously fine-tuning or online-updating model parameters could be computationally expensive and engineering-intensive (Zhao et al. 2023; Xia et al. 2025). External memory modules have therefore been widely adopted to store experience and knowledge that can be reused across tasks (Hu et al. 2025). However, effectively leveraging external memories remains challenging, as stored experiences are not always reliable and may become ineffective or even misleading when transferred to new task contexts (Ouyang et al. 2026). Existing studies (Xu et al. 2026b; Zhang et al. 2026a; Han et al. 2025) rarely provide a principled assessment of whether a retrieved memory remains valuable under the current task context. Recently, a few studies predominantly estimate memory value through heuristic scoring mechanisms, such as historical retrieval success rates or manually designed importance scores (Zhang et al. 2026c; Xia et al. 2025; Zhong et al. 2024). However, these metrics implicitly treat memory value as a task-independent and scalar quantity. In reality, memory value is inherently context-dependent and subject to uncertainty based on accumulated evidence. For instance, a reasoning memory containing a "depth-first recursive traversal" strategy may achieve a high success rate on small-scale algorithmic tasks, but fails when transferred to large-scale problems with strict computational or stack constraints. Moreover, scalar metrics fail to distinguish a memory proven over hundreds of trials from one that succeeded merely once by chance. This raises a central question: How can agents dynamically evaluate and calibrate context-dependent memory values under uncertainty, thereby enabling reliable and continual evolution rather than merely accumulating experiences?

To overcome these limitations, we revisit memory value estimation from the perspective of the Bayesian brain hypothesis (Knill and Pouget 2004). This hypothesis posits that cognitive systems continuously update their probabilistic beliefs about the world by integrating prior experience with incoming observations (Friston 2010; Pouget et al. 2013). Inspired by this principle, our key insight is to formulate memory value evaluation as a parameterized cognitive inference process, where memory value is represented as a context-conditioned dynamic belief rather than a passive historical statistic. From this perspective, the parameterized cognitive system first infers the prior value of memories based on the current task context. After a memory is involved in reasoning and decision-making, the resulting execution feedback serves as empirical evidence for updating the posterior belief over its value. This belief calibration process transforms memory from passive storage into an adaptive cognitive mechanism, enabling LLM agents to continually refine their experience and self-evolve under open-world task streams.

In this work, we propose BEAM (Bayesian-style Evolutionary Agentic Memory), a framework that enables LLM agents to perform continual memory valuation through context-conditioned belief modeling and evidence-driven calibration. The proposed framework consists of three components. First, we construct structured reasoning memories from historical trajectories by distilling transferable strategies while filtering task-specific details. Second, we design a context-conditioned memory belief model, which is a lightweight LoRA-adapted estimator that carries out this cognitive inference without modifying the backbone LLM. Given the task context and candidate memories, it predicts prior belief distributions over memory utility, enabling uncertainty-aware memory valuation and subsequent belief calibration. Third, we introduce an evidence-driven belief updating mechanism that leverages trajectory execution outcomes as empirical evidence to obtain memory-level supervision and performs evidential calibration, preference-aware optimization, and selective regularization for continual value refinement. Extensive experiments across diverse reasoning and code generation benchmarks demonstrate that BEAM significantly enhances memory utilization and drives continual self-evolution in LLM agents. Our contributions are summarized as follows:

• Perspective. We revisit memory valuation through the lens of the Bayesian brain hypothesis, transforming memory from a passive storage structure into an adaptive cognitive mechanism capable of dynamic belief calibration.

• Algorithm. We propose BEAM, a Bayesian memory evolution framework that integrates reasoning memory construction, context-conditioned belief modeling, and evidence-driven belief calibration for continual memory valuation.

• Experiments. Extensive experiments across diverse reasoning and code generation benchmarks demonstrate that BEAM consistently outperforms state-of-the-art baselines in memory utilization and drives long-term continual self-evolution for LLM agents.

References (49)