Manuscript Offprint
arXiv:2610.25119Memory as Belief: Bayesian Evolution of Memory for Self-Evolving LLM Agents
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.
Agent Memory Organization. External memory allows agents to continually accumulate, organize and reuse interaction experience without modifying the backbone model, making it an important mechanism for long-term adaptation (Wang et al. 2025a). Existing studies have explored diverse forms of memory representation and organization. MemoryBank (Zhong et al. 2024) and MemGPT (Packer et al. 2023) focus on long-term user memory and hierarchical context management; ReasoningBank (Ouyang et al. 2026) distills successful and failed trajectories into reusable reasoning memories; A-Mem (Xu et al. 2026b), Zep (Rasmussen et al. 2025), and G-Memory (Zhang et al. 2026a) organize memories using graph-based or hierarchical structures; and LEGOMem (Han et al. 2025) and Buffer of Thoughts (Yang et al. 2024) abstract experience into procedural modules or thought templates to guide subsequent task solving. These efforts enable agents to accumulate and structure past experience (Hu et al. 2025). However, stored memories may contain low-value or noisy experiences, leading to suboptimal reasoning and decision-making (Wei et al. 2025).
Agent Memory Value Evaluation. Since stored memories are not necessarily reliable or beneficial, evaluating their value has increasingly attracted attention (Yu et al. 2026). Existing studies (Zhong et al. 2024) primarily explore heuristic-driven approaches to model and quantify memory utility, such as historical retrieval success rates. MemRL (Zhang et al. 2026c) estimates memory benefits using Q-values; From Experience to Strategy (Xia et al. 2025) updates strategy weights based on counterfactual reward differences; and PlugMem (Yang et al. 2026) quantifies the decision-relevant information gain per memory token from a utility-cost perspective. Another line of work learns memory operations or update policies: Memory-R1 (Yan et al. 2026) and Memα (Wang et al. 2025b) learn strategies for memory construction, management, or updating, while MemSkill (Zhang et al. 2026b) and ReMe (Cao et al. 2026) further explore the dynamic evolution of memory skills and procedural experience. Although recent studies have advanced memory utility estimation and management, they typically model memory value as a static scalar, overlooking its uncertainty and context-dependent reliability (Zhao et al. 2024). In contrast, we model memory value as a context-conditioned dynamic belief that is continuously refined through online feedback.
Methodology
Problem Setting
Following Wei et al. (2025), we consider a self-evolving LLM agent that continuously solves a stream of tasks while maintaining an external reasoning memory. Let

Figure 1: The overview of the BEAM.
denote the task sequence, where is the input context and is the corresponding target output. At step , the agent retrieves a set of relevant memories from the previous memory bank and generates a prediction:
The objective of the self-evolving agent is to maximize its cumulative task utility over the task stream:
where denotes the task-specific utility of the prediction, such as answer correctness for reasoning tasks or execution success for coding tasks.
Inference and Memory Formation
We begin by detailing the forward task-solving process and the subsequent distillation of novel experiences, as illustrated in the upper pipeline of Figure 1.
Memory-Augmented Inference. Given an incoming task , the agent leverages a memory belief estimator (which will be formally defined in the next section) to infer the utility value of candidate memories in the external memory bank . Based on the estimated values, a set of top-K memories relevant to the current task context is retrieved. To better align these retrieved experiences with the specific requirements of , the agent performs memory synthesis to additionally extract a highly transferable working memory from . This synthesized working memory, together with the retrieved top-K memories , is combined with to guide the frozen backbone LLM agent during reasoning, yielding the task execution response :
Upon task completion, the environment returns a feedback signal , producing a complete task interaction context.
Reasoning Memory Formation. To ensure high-quality experience abstraction and prevent redundant noise from contaminating long-term memory, we employ a test-time scaling strategy during inference by sampling multiple execution trajectories , where . Conditioned on the environment feedback across these scaled trajectories, the agent reflects on the collective reasoning process, distilling actionable insights, such as transferable successful strategies or failure-aware lessons, into a structured reasoning memory entry:
where denotes a concise memory title, summarizes the experience, and describes the reusable reasoning principle. The newly formed memory , along with its context, is incorporated into the external memory bank M for future task retrieval and belief calibration.
Context-conditioned Memory Belief Modeling
Existing memory-augmented agents typically retrieve semantically relevant memories to facilitate task solving (Rezazadeh et al. 2025), but fail to evaluate their reliability across changing task contexts. Recent studies estimate memory utility using scalar statistics, such as historical success rates (Zhang et al. 2026c). However, these approaches suffer from two main limitations. First, they assume memory value is task-independent, ignoring the fact that a memory's utility is highly context-dependent. For instance, a memory advocating "depth-first recursive traversal" succeeds on small tasks but fails under strict stack constraints in large-scale settings. Second, scalar point estimates ignore evidence-based uncertainty, treating a single lucky success (1/1) identically to a proven record (97/100). Therefore, memory value should be modeled as a context-dependent belief that captures both contextual relevance and evidence-based uncertainty.
Inspired by the Bayesian brain hypothesis (Knill and Pouget 2004; Friston 2010), which posits that intelligent systems continuously infer and update probabilistic beliefs by integrating prior knowledge with incoming evidence, we revisit memory value estimation from an evidential perspective. Instead of assigning each memory a deterministic utility score, we model its usefulness as a context-conditioned probabilistic belief. Specifically, given a task context , we represent the latent utility of a candidate memory as a random variable:
where denotes the latent probability that memory provides beneficial guidance for the current task . We adopt the beta distribution, as it serves as the conjugate prior to the Bernoulli likelihood, which naturally aligns with the binary success-or-failure feedback of task execution. The parameters and characterize the accumulated positive and negative evidence, respectively. This allows the agent to explicitly quantify both the expected memory utility and its associated uncertainty.
To parameterize the context-conditioned memory belief, we introduce a lightweight LoRA-adapted value estimator based on a pretrained language model. Rather than learning memory values directly, the estimator is trained to infer the parameters of the Beta belief distribution by jointly considering the current task context and candidate memory representations. Specifically, given the current task and a candidate memory , the estimator produces the corresponding belief parameters:
where denotes the LoRA-adapted estimator with frozen backbone parameters, and and represent the estimated parameters of the context-conditioned Beta belief. The softplus transformation ensures that the predicted evidence remains non-negative, while the unit offset corresponds to the uniform prior Beta(1,1) in the absence of supporting evidence. Consequently, when the estimator observes insufficient contextual evidence for a memory item, the resulting belief remains close to an uninformative distribution rather than producing an overconfident utility estimation. As more evidence is accumulated through interactions, the belief can gradually become more concentrated, reflecting increasing confidence in the reliability of the memory.
Evidence-driven Memory Belief Updating
The context-conditioned belief estimation above provides an initial prior over memory utility before the current interaction. However, such priors are inevitably uncertain due to incomplete contextual information and limited historical evidence. Similar to humans who continually revise beliefs through new experiences, we treat the feedback obtained after applying retrieved memories as empirical evidence to calibrate and refine prior beliefs, enabling memory values to continuously evolve with accumulated experience rather than remaining fixed after initial estimation.
Given a current task and a candidate memory , the context-conditioned belief estimator models its usefulness as a belief distribution . To strike a balance between exploitation and exploration, we adopt Thompson sampling (Thompson 1933; Chapelle and Li 2011) to draw a stochastic utility score directly from this distribution:
Unlike deterministic point estimates (e.g., predicted means), this sampling scheme intrinsically accounts for epistemic uncertainty. Consequently, memories with limited evidence retain higher variance, naturally yielding greater opportunities for exploration alongside the exploitation of well-supported experiences.
Since effective reasoning often benefits from complementary experiences (Xu et al. 2026b), the agent retrieves a set of top-K memories based on sampled utilities rather than selecting a single memory. However, the obtained feedback only reflects the joint effect of the retrieved memory set, making it difficult to determine the individual contribution of each memory. To address this challenge, we introduce leave-one-out counterfactual credit assignment to derive memory-level evidence. For a task , let denote the retrieved memory set. We estimate the contribution of each memory by comparing the full retrieval outcome with leave-one-out counterfactual outcomes:
(8)
where denotes the task reward (1 for success, 0 otherwise), and is the reward without memory . The marginal contribution reflects 's net impact, where positive and negative values indicate beneficial memories and harmful interference, respectively. To evaluate robustness across retrieval contexts, we aggregate outcomes retaining into an average counterfactual reward . We then combine the overall reward, counterfactual outcomes, and marginal contribution to construct the memory-level utility target:
where is the marginal contribution of . We normalize as to align with the support of the Beta distribution, mapping positive, neutral, and negative impacts accordingly. The resulting target integrates both individual contribution and contextual effectiveness to supervise belief distribution calibration.
For the predicted distribution , let and denote its mean and variance, respectively. We optimize the memory value estimator with an evidential objective:
(10) where D denotes a training mini-batch. This objective aligns the predicted expected utility with evidence-derived supervision, while encouraging the predicted distribution to become more concentrated when supported by sufficient evidence.
However, calibrating absolute utility values alone does not guarantee preserving the relative preference among candidate memories retrieved for the same task. Since memory selection relies on ranking candidate experiences by their expected utilities, we further introduce a pairwise ranking objective based on counterfactual contributions. Specifically, for a mini-batch D, we construct preference pairs , where memory is preferred over due to its strictly higher marginal contribution. We optimize a margin-based ranking loss:
where is a margin enforcing separation between preferred pairs. This objective encourages memories with larger marginal contributions to yield higher utilities, preserving within-task preference ordering among experiences.
Due to noisy feedback in multi-memory interactions and limited observations, accumulated evidence can deviate from true memory utilities, leading to distorted belief strengths and poorly calibrated uncertainty estimates. To address this, we introduce a selective Beta-KL regularizer that suppresses unsupported evidence accumulation while preserving evidence consistent with the utility target. Specifically, we isolate potentially conflicting evidence for selective regularization:
where and denote the accumulated positive and negative evidence underlying the predicted Beta distribution, respectively. When is high, negative evidence is regarded as conflicting and selectively regularized; conversely, when is low, excessive positive evidence is suppressed. For intermediate targets, both evidence terms are softly weighted according to the utility target. The selective regularization objective is formulated as:
where Beta(1, 1) denotes the uninformative prior representing zero accumulated evidence. This objective selectively contracts target-inconsistent evidence toward the prior, preventing unsupported belief accumulation and improving the calibration of memory value estimates.
The overall training objective jointly optimizes evidential utility calibration, preference-aware ranking, and selective evidence regularization:
where and are trade-off hyperparameters controlling the contributions of the ranking and evidence regularization objectives, respectively. We further assess the contribution of each loss term through individual ablations, with the results reported in the supplementary material.
Experiments
Experiment Settings
Datasets. We evaluate BEAM on five benchmarks spanning mathematical reasoning, using AIME24 and AIME25 (Hugging Face H4 2024; OpenCompass 2025); scientific reasoning, using GPQA-Diamond (Rein et al. 2023); philosophical reasoning, using MMLU-Pro (Philosophy) (Wang et al. 2024b); multidisciplinary reasoning, using the valid text-only multiple-choice subset of HLE (Phan et al. 2025); and code generation, using BigCodeBench-Hard-Instruct (Zhuo et al. 2025). We report accuracy for reasoning benchmarks and Pass@1 for BigCodeBench.
Baselines. We compare BEAM with six representative baselines spanning diverse memory paradigms: No Memory, which solves tasks using only the frozen backbone language model; Self-RAG (Asai et al. 2024), which controls retrieval through self-reflection; Mem0 (Chhikara et al. 2025), a general-purpose long-term memory framework; A-Mem (Xu et al. 2026b), which organizes structured memory notes and semantic associations; Memp (Fang et al. 2026), which distills procedural knowledge from trajectories; and MemRL (Zhang et al. 2026c), which combines semantic retrieval with learned Q-values. All methods use the same task streams, executors, output parsers, and evaluation protocols while preserving each baseline's core memory mechanisms. Evaluation Protocol. Following Evo-Memory's streaming search–predict–evolve protocol (Wei et al. 2025), we adopt a zero-reset task-stream setting. For each benchmark, the corresponding task stream is partitioned into consecutive stages and processed in a strictly fixed order, without resetting the memory bank or value estimator at any point throughout the stream. For each task, inference relies exclusively on experience accumulated from preceding tasks, while feedback from the current task is used only to update the system for subsequent tasks, preventing it from influencing the current prediction. Additional implementation details, including the key prompts used throughout BEAM, are provided in the supplementary material.
Main Results and Analysis
Table 1 compares memory methods across two executors and five benchmarks. BEAM achieves the best average performance under both executors, surpassing the strongest baselines by 3.93 and 2.43 percentage points, respectively. It outperforms all baselines on AIME, GPQA-Diamond, HLE, and BigCodeBench, while remaining competitive on MMLU-Pro. These consistent gains across reasoning and code-generation tasks show that BEAM generalizes across the two tested executors and diverse task settings, rather than relying on a specific backbone or evaluation scenario. They further demonstrate its effectiveness on knowledge-intensive problems, where the utility of past experience varies substantially across instances.
More broadly, the baseline comparison shows that external memory does not necessarily yield consistent gains. Several methods vary substantially across tasks, and some even underperform No Memory, suggesting that semantic relevance alone may retrieve seemingly related memories with lim-
| Method | Accuracy (%) ↑ | Pass@1 (%) ↑ | ||||
|---|---|---|---|---|---|---|
| AIME | GPQA-Diamond | HLE | MMLU-Pro (Philo.) | BigCodeBench | Avg. ↑ | |
| DeepSeek-V4-Flash | ||||||
| No Memory | 58.33 | 69.10 | 9.09 | 73.61 | 31.08 | 48.24 |
| Self-RAG | 56.67 | 70.70 | 10.83 | 71.83 | 31.08 | 48.22 |
| Mem0 | 61.67 | 69.70 | 11.61 | 72.62 | 29.73 | 49.07 |
| A-Mem | 56.67 | 70.71 | 11.99 | 77.78 | 30.41 | 49.51 |
| Memp | 60.00 | 68.18 | 7.93 | 75.79 | 28.38 | 48.06 |
| MemRL | 58.33 | 69.70 | 11.03 | 75.79 | 28.38 | 48.65 |
| BEAM (Ours) | 66.67 | 75.25 | 12.77 | 77.38 | 35.13 | 53.44 |
| Gemini-2.5-Flash | ||||||
| No Memory | 53.33 | 73.23 | 12.96 | 77.58 | 25.68 | 48.56 |
| Self-RAG | 56.67 | 71.72 | 13.35 | 78.37 | 24.32 | 48.89 |
| Mem0 | 58.33 | 76.76 | 11.99 | 78.77 | 25.68 | 50.31 |
| A-Mem | 63.33 | 77.78 | 15.09 | 76.79 | 27.70 | 52.14 |
| Memp | 53.33 | 74.75 | 10.83 | 78.37 | 26.35 | 48.73 |
| MemRL | 56.67 | 75.25 | 10.44 | 77.78 | 27.03 | 49.43 |
| BEAM (Ours) | 68.33 | 78.79 | 15.47 | 79.17 | 31.08 | 54.57 |
Table 1: Performance comparison of memory methods across five benchmarks and two fixed task executors. Scores are accuracy except on BigCodeBench, where Pass@1 is reported. Avg. denotes the arithmetic mean across the five benchmarks.

Figure 2: Ablation results on GPQA-Diamond, MMLU-Pro (Philo.), and HLE. The left axis reports accuracy on GPQA-Diamond and MMLU-Pro, while the right axis reports accuracy on HLE.
ited practical utility for current tasks, increasing the risk of negative transfer. Although A-Mem and MemRL improve memory use through structured organization and value-aware selection, respectively, their overall performance remains below that of BEAM. In contrast, BEAM models the task-conditioned utility of past experience through probabilistic value estimation and continually calibrates candidate-memory rankings using counterfactual feedback, yielding more consistent gains across both executors and diverse tasks. Two qualitative case studies illustrating BEAM's end-to-end reasoning and memory-utilization process are provided in the supplementary material.
Ablation Studies
As shown in Figure 2, we assess BEAM's key components on DeepSeek-V4-Flash across GPQA-Diamond, MMLU-Pro (Philo.), and HLE. To further assess the impact of test-time scaling, we compare different memory methods under the same three-rollout inference budget, using either random selection (Random-of-3) or a shared judge to select the best output (Best-of-3); the corresponding results are reported in the supplementary material.
Belief-guided Memory Selection. When belief-guided selection is removed, the system selects memories solely according to semantic similarity, resulting in consistent performance degradation across all three benchmarks. This indicates that semantic relevance alone is insufficient to characterize the actual utility of a memory for the current task. In contrast, task-conditioned belief estimation helps filter out memories that are superficially relevant but only marginally useful or potentially misleading.
Memory Synthesis. When memory synthesis is removed, the system still injects the selected raw memories but no longer constructs an additional working memory. The resulting performance drop suggests that raw memories may still contain redundancy, conflicts, and task-irrelevant details. By distilling transferable reasoning principles and integrating complementary information, memory synthesis provides the executor with more focused and task-conditioned guidance.
Combination-Aware Credit Assignment. BEAM uses leave-one-out evaluation to estimate the conditional marginal contribution of each memory within the actual multi-memory context, whereas the ablated variant compares each individual memory against an empty context:
The latter measures only the effect of a memory when used in isolation, while ignoring interactions among memories in the actual multi-memory reasoning context. As a result, it performs worse on all three benchmarks. These results show
BEAM Memp A-Mem Mem0 No Memory
(a) GPQA-Diamond: Stage Accuracy

(b) HLE: Stage Accuracy
(c) GPQA-Diamond: Accuracy Gain
(d) HLE: Accuracy Gain
Figure 3: Stage-wise self-evolution on GPQA-Diamond and HLE. Each stage is a consecutive segment of the task stream; GPQA-Diamond uses four stages (0–25%, 25–50%, 50–75%, 75–100%), and HLE uses five. Panels (a,b) report stage accuracy, while panels (c,d) show gains over no memory in percentage points (pp), .
that, compared with isolated evaluation, combination-aware counterfactual supervision provides more reliable training signals for the value model.
Continual Self-Evolution
To assess whether BEAM can progressively improve memory use through continual interaction, we partition each task stream into consecutive stages and report stage-wise accuracy and the gain over the no-memory baseline: . Neither the memory bank nor the value model is reset throughout the stream. Leave-one-out supervision from completed tasks is used only to update the value model for subsequent tasks, preventing it from affecting the current prediction.
As shown in Figure 3, the stage-wise accuracy of all methods fluctuates because task difficulty varies across stages. Nevertheless, BEAM generally achieves larger gains over the no-memory baseline as the task stream progresses, with more pronounced improvements in later stages. In contrast, other memory-based methods exhibit less stable gains, with some falling below the no-memory baseline at certain stages. This suggests that continual experience accumulation alone does not guarantee sustained improvement; memory quality and selection remain critical. As counterfactual supervision accumulates, BEAM's belief model progressively calibrates candidate-memory utility estimates, increasing the likelihood of selecting task-relevant memories while reducing interference from mismatched ones. Although this trend may be affected by stage difficulty and finite-sample variability, the larger relative gains in later stages provide empirical evidence that BEAM gradually improves memory utilization through continual self-evolution.
Pre-trained on MATH-500 Trained from Scratch No Memory
(a) Stage-wise Accuracy

(b) Accuracy Gain over No Memory
Figure 4: Cross-task transfer from MATH-500 to AIME. The AIME task stream is divided into three consecutive stages (0–33%, 33–67%, 67–100%). Panel (a) reports stage accuracy, while panel (b) reports gains over no memory in percentage points (pp), .
Cross-Task Transferability
To examine whether BEAM’s value model transfers across related tasks, we initialize the AIME value network with parameters learned on MATH-500 (Hendrycks et al. 2021; Lightman et al. 2024) and compare it with a value model trained from scratch on AIME and a no-memory baseline. As shown in Figure 4, the transferred model achieves the best stream-level average performance and consistently outperforms the no-memory baseline across all stages. In particular, it shows a clear early-stage advantage over training from scratch, indicating that memory-utility judgments learned on MATH-500 provide an effective initialization for selecting useful memories on AIME when target-task feedback is still scarce. As AIME feedback accumulates, the scratch-trained model narrows the gap and achieves a comparable gain in the final stage. These results suggest that cross-task transfer improves early adaptation, feedback efficiency, and overall stream-level performance, while having only a limited effect on final-stage performance.
Conclusion
In this paper, we introduced BEAM, a framework that reformulates memory valuation for self-evolving LLM agents as inference over context-conditioned probabilistic beliefs. Rather than assigning each memory a static scalar utility, BEAM jointly models its expected usefulness and uncertainty, and continually calibrates these beliefs using execution feedback and counterfactual credit assignment. By integrating structured reasoning memory formation, belief-guided selection, and evidence-driven updating while keeping the backbone LLM frozen, BEAM enables reliable experience reuse across continual task streams. Experiments on diverse reasoning and code-generation benchmarks show that BEAM achieves consistent gains over strong memory baselines, progressively improves memory utilization through online interaction, and transfers learned utility judgments across related tasks. These findings underscore context-aware memory valuation as a promising foundation for reliable and continual self-evolution in LLM agents.
References
Asai, A.; Wu, Z.; Wang, Y.; Sil, A.; and Hajishirzi, H. 2024. Self-rag: Learning to retrieve, generate, and critique through self-reflection. In International conference on learning representations, volume 2024, 9112–9141.
Cao, Z.; Deng, J.; Yu, L.; Zhou, W.; Liu, Z.; Ding, B.; and Zhao, H. 2026. Remember me, refine me: A dynamic procedural memory framework for experience-driven agent evolution. In Findings of the Association for Computational Linguistics: ACL 2026, 16803–16822.
Chapelle, O.; and Li, L. 2011. An empirical evaluation of thompson sampling. Advances in neural information processing systems, 24.
Chhikara, P.; Khant, D.; Aryan, S.; Singh, T.; and Yadav, D. 2025. Mem0: Building production-ready ai agents with scalable long-term memory. arXiv preprint arXiv:2504.19413.
Fang, R.; Liang, Y.; Wang, X.; Wu, J.; Qiao, S.; Xie, P.; Huang, F.; Chen, H.; and Zhang, N. 2026. Memp: Exploring agent procedural memory. In Findings of the Association for Computational Linguistics: ACL 2026, 17490–17502.
Friston, K. 2010. The free-energy principle: a unified brain theory? Nature reviews neuroscience, 11(2): 127–138.
Gao, H.-a.; Geng, J.; Hua, W.; Hu, M.; Juan, X.; Liu, H.; Liu, S.; Qiu, J.; Qi, X.; Wu, Y.; et al. 2025. A Survey of Self-Evolving Agents: What, When, How, and Where to Evolve on the Path to Artificial Super Intelligence. Transactions on Machine Learning Research.
Han, D.; Couturier, C.; Diaz, D. M.; Zhang, X.; Rühle, V.; and Rajmohan, S. 2025. Legomem: Modular procedural memory for multi-agent llm systems for workflow automation. arXiv preprint arXiv:2510.04851.
Hendrycks, D.; Burns, C.; Kadavath, S.; Arora, A.; Basart, S.; Tang, E.; Song, D.; and Steinhardt, J. 2021. Measuring mathematical problem solving with the math dataset. arXiv preprint arXiv:2103.03874.
Hu, Y.; Liu, S.; Yue, Y.; Zhang, G.; Liu, B.; Zhu, F.; Lin, J.; Guo, H.; Dou, S.; Xi, Z.; et al. 2025. Memory in the age of ai agents. arXiv preprint arXiv:2512.13564.
Hugging Face H4. 2024. AIME 2024 Benchmark. https://huggingface.co/datasets/HuggingFaceH4/aime_2024.
Jimenez, C. E.; Yang, J.; Wettig, A.; Yao, S.; Pei, K.; Press, O.; and Narasimhan, K. 2024. Swe-bench: Can language models resolve real-world github issues? In International Conference on Learning Representations, volume 2024, 54107–54157.
Knill, D. C.; and Pouget, A. 2004. The Bayesian brain: the role of uncertainty in neural coding and computation. TRENDS in Neurosciences, 27(12): 712–719.
Lightman, H.; Kosaraju, V.; Burda, Y.; Edwards, H.; Baker, B.; Lee, T.; Leike, J.; Schulman, J.; Sutskever, I.; and Cobbe, K. 2024. Let's verify step by step. In International Conference on Learning Representations, volume 2024, 39578–39601.
OpenCompass. 2025. AIME 2025 Benchmark. https://huggingface.co/datasets/opencompass/AIME2025.
Ouyang, S.; Yan, J.; Hsu, I.; Chen, Y.; Jiang, K.; Wang, Z.; Han, R.; Le, L. T.; Daruki, S.; Tang, X.; et al. 2026. ReasoningBank: Scaling Agent Self-Evolving with Reasoning
Memory. In International Conference on Learning Representations (ICLR).
Packer, C.; Fang, V.; Patil, S.; Lin, K.; Wooders, S.; and Gonzalez, J. 2023. MemGPT: towards LLMs as operating systems.
Phan, L.; Gatti, A.; Han, Z.; Li, N.; Hu, J.; Zhang, H.; Zhang, C. B. C.; Shaaban, M.; Ling, J.; Shi, S.; et al. 2025. Humanity’s last exam. arXiv preprint arXiv:2501.14249.
Pouget, A.; Beck, J. M.; Ma, W. J.; and Latham, P. E. 2013. Probabilistic brains: knowns and unknowns. Nature neuroscience, 16(9): 1170–1178.
Rasmussen, P.; Paliychuk, P.; Beauvais, T.; Ryan, J.; and Chalef, D. 2025. Zep: a temporal knowledge graph architecture for agent memory. arXiv preprint arXiv:2501.13956.
Rein, D.; Hou, B. L.; Stickland, A. C.; Petty, J.; Pang, R. Y.; Dirani, J.; Michael, J.; and Bowman, S. R. 2023. Gpqa: A graduate-level google-proof q&a benchmark. arXiv preprint arXiv:2311.12022.
Rezazadeh, A.; Li, Z.; Wei, W.; and Bao, Y. 2025. From isolated conversations to hierarchical schemas: Dynamic tree memory representation for llms. In International Conference on Learning Representations, volume 2025, 990–1023.
Shinn, N.; Cassano, F.; Gopinath, A.; Narasimhan, K.; and Yao, S. 2023. Reflexion: Language agents with verbal reinforcement learning. Advances in neural information processing systems, 36: 8634–8652.
Singh, A.; Fry, A.; Perelman, A.; Tart, A.; Ganesh, A.; El-Kishky, A.; McLaughlin, A.; Low, A.; Ostrow, A.; Ananthram, A.; et al. 2025. Openai gpt-5 system card. arXiv preprint arXiv:2601.03267.
Thompson, W. R. 1933. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4): 285–294.
Wang, B.; Liang, X.; Yang, J.; Huang, H.; Wu, Z.; Wu, S.; Ma, Z.; and Li, Z. 2025a. Scm: Enhancing large language model with self-controlled memory framework. In International Conference on Database Systems for Advanced Applications, 188–203. Springer.
Wang, G.; Xie, Y.; Jiang, Y.; Mandlekar, A.; Xiao, C.; Zhu, Y.; Fan, L.; and Anandkumar, A. 2023. Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291.
Wang, L.; Ma, C.; Feng, X.; Zhang, Z.; Yang, H.; Zhang, J.; Chen, Z.; Tang, J.; Chen, X.; Lin, Y.; et al. 2024a. A survey on large language model based autonomous agents. Frontiers of Computer Science, 18(6): 186345.
Wang, Y.; Ma, X.; Zhang, G.; Ni, Y.; Chandra, A.; Guo, S.; Ren, W.; Arulraj, A.; He, X.; Jiang, Z.; et al. 2024b. Mmlupro: A more robust and challenging multi-task language understanding benchmark. Advances in Neural Information Processing Systems, 37: 95266–95290.
Wang, Y.; Takanobu, R.; Liang, Z.; Mao, Y.; Hu, Y.; McAuley, J.; and Wu, X. 2025b. Mem-{alpha}: Learning memory construction via reinforcement learning. arXiv preprint arXiv:2509.25911.
Wei, T.; Sachdeva, N.; Coleman, B.; He, Z.; Bei, Y.; Ning, X.; Ai, M.; Li, Y.; He, J.; Chi, E. H.; et al. 2025. Evo-memory: Benchmarking llm agent test-time learning with self-evolving memory. arXiv preprint arXiv:2511.20857.
Xia, S.; Xu, Z.; Chai, J.; Fan, W.; Song, Y.; Wang, X.; Yin, G.; Lin, W.; Zhang, H.; and Wang, J. 2025. From experience to strategy: Empowering llm agents with trainable graph memory. arXiv preprint arXiv:2511.07800.
Xie, T.; Zhou, F.; Cheng, Z.; Shi, P.; Weng, L.; Liu, Y.; Hua, T. J.; Zhao, J.; Liu, Q.; Liu, C.; et al. 2023. Openagents: An open platform for language agents in the wild. arXiv preprint arXiv:2310.10634.
Xu, F. F.; Song, Y.; Li, B.; Tang, Y.; Jain, K.; Bao, M.; Wang, Z.; Zhou, X.; Guo, Z.; Cao, M.; et al. 2026a. Theagentcompany: benchmarking llm agents on consequential real world tasks. Advances in Neural Information Processing Systems, 38.
Xu, W.; Liang, Z.; Mei, K.; Gao, H.; Tan, J.; and Zhang, Y. 2026b. A-mem: Agentic memory for llm agents. Advances in Neural Information Processing Systems, 38: 17577–17604.
Yan, S.; Yang, X.; Huang, Z.; Nie, E.; Ding, Z.; Li, Z.; Ma, X.; Bi, J.; Kersting, K.; Pan, J. Z.; et al. 2026. Memory-r1: Enhancing large language model agents to manage and utilize memories via reinforcement learning. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 12805–12825.
Yang, K.; Chen, Z.; He, X.; Jiang, J.; Galley, M.; Wang, C.; Gao, J.; Han, J.; and Zhai, C. 2026. Plugmem: A task-agnostic plugin memory module for llm agents. arXiv preprint arXiv:2603.03296.
Yang, L.; Yu, Z.; Zhang, T.; Cao, S.; Xu, M.; Zhang, W.; Gonzalez, J. E.; and Cui, B. 2024. Buffer of thoughts: Thought-augmented reasoning with large language models. Advances in Neural Information Processing Systems, 37: 113519–113544.
Yao, S.; Yu, D.; Zhao, J.; Shafran, I.; Griffiths, T.; Cao, Y.; and Narasimhan, K. 2023. Tree of thoughts: Deliberate problem solving with large language models. Advances in neural information processing systems, 36: 11809–11822.
Yao, S.; Zhao, J.; Yu, D.; Du, N.; Shafran, I.; Narasimhan, K.; and Cao, Y. 2022. React: Synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629.
Yu, Y.; Yao, L.; Xie, Y.; Tan, Q.; Feng, J.; Li, Y.; and Wu, L. 2026. Agentic memory: Learning unified long-term and short-term memory management for large language model agents. arXiv preprint arXiv:2601.01885.
Zhang, G.; Fu, M.; Wang, K.; Wan, F.; Yu, M.; and Yan, S. 2026a. G-memory: Tracing hierarchical memory for multi-agent systems. Advances in Neural Information Processing Systems, 38: 12988–13018.
Zhang, G.; Geng, H.; Yu, X.; Yin, Z.; Zhang, Z.; Tan, Z.; Zhou, H.; Li, Z.; Xue, X.; Li, Y.; et al. 2025. The landscape of agentic reinforcement learning for llms: A survey. arXiv preprint arXiv:2509.02547.
Zhang, H.; Long, Q.; Bao, J.; Feng, T.; Zhang, W.; Yue, H.; and Wang, W. 2026b. MemSkill: Learning and Evolving
Memory Skills for Self-Evolving Agents. arXiv preprint arXiv:2602.02474.
Zhang, S.; Wang, J.; Zhou, R.; Liao, J.; Feng, Y.; Li, Z.; Zheng, Y.; Zhang, W.; Wen, Y.; Li, Z.; et al. 2026c. Memrl: Self-evolving agents via runtime reinforcement learning on episodic memory. arXiv preprint arXiv:2601.03192.
Zhao, A.; Huang, D.; Xu, Q.; Lin, M.; Liu, Y.-J.; and Huang, G. 2024. Expel: Llm agents are experiential learners. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, 19632–19642.
Zhao, H.; Zhou, T.; Long, G.; Jiang, J.; and Zhang, C. 2023. Does continual learning equally forget all parameters? In International Conference on Machine Learning, 42280–42303. PMLR.
Zheng, L.; Wang, R.; Wang, X.; and An, B. 2024. Synapse: Trajectory-as-exemplar prompting with memory for computer control. In International Conference on Learning Representations, volume 2024, 19036–19066.
Zhong, W.; Guo, L.; Gao, Q.; Ye, H.; and Wang, Y. 2024. Memorybank: Enhancing large language models with long-term memory. In Proceedings of the AAAI conference on artificial intelligence, volume 38, 19724–19731.
Zhuo, T. Y.; Vu, M. C.; Chim, J.; Hu, H.; Yu, W.; Widyasari, R.; Yusuf, I. N. B.; Zhan, H.; He, J.; Paul, I.; et al. 2025. Bigcodebench: Benchmarking code generation with diverse function calls and complex instructions. In International Conference on Learning Representations, volume 2025, 66602–66656.
Appendix
Implementation Details
The memory belief estimator is initialized from Qwen2.5-7B-Instruct and equipped with a lightweight evidential Beta head that predicts context-conditioned belief parameters ( , ) for each task-memory pair. The pretrained backbone remains frozen, while LoRA adapters are applied to the query, key, value, and output projection layers with rank , scaling factor , and dropout 0.05. Pairwise inputs are encoded with a maximum sequence length of 4,096 tokens. Dense retrieval is performed using text-embedding-3-large embeddings stored in a local Qdrant vector database. For each task, six candidate memories are retrieved, and semantic similarity is combined with Thompson-sampled memory utility after z-score normalization. The value weight follows a sigmoid schedule over [0.10, 0.50] according to task-stream progress. After reranking, up to three memories with semantic similarity scores above the injection threshold of 0.5 are retained for subsequent reasoning. The estimator is optimized online using AdamW, with learning rates of for the LoRA adapters and for the evidential Beta head, and a batch size of 8. The weights of , , and are set to 1.0, 0.03, and 0.6, respectively. Experiments are conducted on a Linux server equipped with multiple NVIDIA GeForce RTX 4090 GPUs. The memory belief estimator runs locally on one of the GPUs using bfloat16 precision, while external LLM and embedding services are accessed via APIs.
Contribution of Value-Model Training Objectives

Figure 5: Ablation of the value-model training objectives on GPQA-Diamond, MMLU-Pro (Philo.), and HLE. The left y-axis reports accuracy on GPQA-Diamond and MMLU-Pro (Philo.), while the right y-axis reports accuracy on HLE.
As shown in Figure 5, we evaluate the contribution of each value-model objective by individually removing , , or . The full objective achieves the best performance on GPQA-Diamond, MMLU-Pro (Philo.), and HLE, while removing any individual loss consistently degrades performance, confirming their complementary roles.
Removing causes the largest decline, with an average drop of 1.83 percentage points across the three benchmarks. This highlights the importance of evidential supervision for calibrating predicted mean utility and establishing a stable task-conditioned value scale. Without this objective, the model can still learn relative preferences through ranking supervision but lacks stable absolute utility estimates on a common scale.
Removing also consistently reduces performance, indicating that fitting individual utility targets alone does not guarantee correct candidate ordering within the same task. Explicit preference constraints improve the separation between high- and low-utility memories, thereby supporting more reliable final selection. Removing yields a smaller but consistent decline, supporting its role in regularizing unsupported evidence, mitigating overconfidence, and stabilizing belief estimation. Overall, provides absolute utility calibration, strengthens candidate discrimination, and regularizes uncertain beliefs, jointly enabling more accurate and stable memory utility estimation.
Effect of Test-Time Scaling

Figure 6: Comparison of Random-of-3 and Best-of-3 inference across memory methods on GPQA-Diamond and MMLU-Pro (Philo.).
BEAM employs memory-augmented test-time scaling (MATTS), generating multiple memory-conditioned reasoning trajectories and using a shared judge to select the output. This raises the possibility that part of the gain comes from additional test-time computation rather than memory selection itself. To control for this factor, we allocate the same three-rollout budget to Mem0, Memp, and MemRL, and report Random-of-3 and Best-of-3, using random selection and the same judge, respectively. As shown in Figure 6, Best-of-3 outperforms Random-of-3 in most settings, confirming that test-time scaling provides additional benefits. Nevertheless, under the same inference budget and selection mechanism, all baselines remain below BEAM on GPQA-Diamond and MMLU-Pro (Philo.). Moreover, BEAM's Random-of-3 performance already matches or approaches that of the strongest Best-of-3 baseline. These results indicate that repeated sampling is not the primary source of BEAM's performance advantage: high-quality memory selection and synthesis first improve the quality of candidate trajectories, while MATTS further mitigates the randomness and instability of rollouts.
Prompt 1: Reasoning Memory Generation Prompt Template
System Prompt
[System]:
Extract concise, high-signal reusable reasoning memories for domain: {dom}.
Input: multiple trajectories for the SAME query with authoritative success/failure labels.
Goal: extract memories that can help solve future similar but not identical problems. A good memory is a transferable reasoning rule, calculation procedure, decision check, or pitfall-avoidance instruction. It is not a summary of this query and not the final answer to this query.
Rules:
-
Extract transferable reasoning patterns, not summaries of the original query.
-
Prefer contrastive rules from successes or failures.
-
Trust successful trajectories over failed ones when they conflict.
-
If all trajectories fail, output only a pitfall or verification check, not a positive answer.
-
Generalize one-off entities, numbers, compounds, and symbols; keep only reusable formulas.
-
Avoid exact answers, options, product names, and computed values unless generally reusable.
-
Avoid vague advice; state the concrete check or action.
-
Prefer fewer, stronger, non-overlapping memories.
-
If no strong success rule exists, output the strongest reliable pitfall or decision check.
Output ONLY a JSON object matching the schema (no markdown). Must contain items; each item has:
-
"title": short label (3-8 words)
-
"description": one-line summary (<= 20 words)
-
"content": concise reusable rule, procedure, decision check, or pitfall-avoidance instruction
At most {max_items} items. Do not output an empty items array.
The word json is intentionally included to enable JSON Output mode.
User Prompt Template
[User]:
Query:
{retrieval_query}
Task Context:
{task_context}
Labels (aligned with candidate index):
{labels}
--- Candidate 0 ---
MODEL_RESPONSE:
{response_0}
--- Candidate 1 ---
MODEL_RESPONSE:
{response_1}
--- Candidate 2 ---
MODEL_RESPONSE:
{response_2}
Figure 7: System and user prompt templates for reasoning memory generation.
Prompt 2: Memory Synthesis Prompt Template
System Prompt
[System]:
You synthesize task-conditioned working guidance from LOCAL EXPERIENCE MEMORIES already selected by a memory value model.
Do not rank, prune, or reselect memories, and do not output memory-level relevance judgments. Synthesize only the content that is applicable to the current task; do not force every memory into working_memory.
Do not solve the task, state an answer, or imply a preferred answer choice. Extract reusable strategies, decision criteria, checks, and distinctions that apply to the current task. Adapt the memories into guidance rather than summarizing them.
Convert applicable lessons from failure memories into warnings, not positive evidence. Include memory disagreements or task ambiguity in warnings when they affect reasoning.
Do not introduce unsupported facts, formulas, assumptions, or answer preferences.
Keep working_memory answer-neutral and limited to at most 3 concise actionable points. Give at most 2 applicable warnings, and do not restate memory metadata.
Dataset guidance:
-
AIME: methods, constraints, case checks, and verification steps.
-
GPQA/HLE: reasoning criteria and factual checks without unsupported claims.
-
MMLU-Philosophy: concept distinctions, argument structures, and distractor checks.
User Prompt Template
[User]:
Current Task:
{problem_context}
Selected Local Experience Memories:
{candidate_text}
Return exactly:
{
"working_memory": "concise task-specific guidance without an answer",
"warnings": "applicable pitfalls, or an empty string"
}
Figure 8: System and user prompt templates for memory synthesis.
Prompt Templates
We present the key prompts used for reasoning memory generation and memory synthesis in BEAM. Both use structured JSON outputs to support reliable downstream processing.
Reasoning Memory Generation. Figure 7 shows how BEAM extracts reusable memories from multiple labeled trajectories of the same task. The prompt prioritizes patterns supported by successful trajectories and converts failures into pitfalls or verification checks; when all trajectories fail, only cautionary guidance is produced. Instance-specific details are generalized, and each memory is returned with structured title, description, and content fields.
Memory Synthesis. Figure 8 presents the prompt that generates an answer-neutral, task-conditioned working memory from the current task and the memories selected by the value model, without reranking the memories or solving the task. Applicable lessons from failed memories and conflicts among memories are expressed as warnings. The output is organized into working_memory and warnings.
Case Studies
We present two cases illustrating BEAM's closed-loop self-evolution process. The first shows how robust multi-trajectory reasoning supports reliable memory formation, while the second demonstrates how task-conditioned memory utilization subsequently improves reasoning accuracy.
Case 1: Robust Reasoning and Memory Formation. As shown in Figure 9, BEAM generates multiple memory-conditioned trajectories and uses a shared judge to select a reliable response. More importantly, the resulting trajectory-level feedback provides contrastive evidence for memory formation. By comparing successful and failed reasoning paths, BEAM distills a concise, high-signal reasoning principle and stores it for future tasks. Thus, test-time scaling improves not only the reliability of the current prediction but also the quality and transferability of newly formed memories.
Case 2: Task-Conditioned Memory Utilization. Figure 10 compares memory-free reasoning with BEAM. Without memory, the executor identifies the relevant transformation but fails to resolve the structural ambiguity. BEAM instead selects memories according to their estimated task-conditioned utility and synthesizes the applicable information into actionable guidance, enabling the executor to eliminate incompatible candidates and reach the correct answer.
Case 1: Robust Reasoning and Memory Formation via Test-Time Scaling
- [Task]
Question: The Cope rearrangement is a chemical reaction where a 1,5-diene molecule undergoes rearrangement. Select the major products from the two rearrangements.
Options: A. 4-methyl-1-phenylpent-3-en-1-ol; tetrahydro fused product
B. (Z)-2-methyl-5-phenylpent-2-en-1-ol; hexahydro fused product
C. (Z)-2-methyl-5-phenylpent-2-en-1-ol; tetrahydro fused product
D. 4-methyl-1-phenylpent-3-en-1-ol; hexahydro fused product
- [Multi-Trajectory Reasoning and Memory Formation]
Step 1: Retrieve the Top-6 candidate memories and inject the top-1 reranked memory (Only the highest-ranked candidate exceeds the injection threshold).
Step 2: Memory synthesis converts the selected memory into task-conditioned working guidance: identify the 1,5-diene system, track the [3,3]-sigmatropic shift, and check alkene geometry.
Step 3: BEAM generates three memory-conditioned reasoning trajectories through test-time scaling.
Step 4: The shared judge selects Rollout 0 as the final output.
The selected trajectory correctly identifies both products and returns the correct answer A.
Step 5: After task completion, execution feedback assigns labels [1, 0, 1] to the three trajectories.
By contrasting successful and failed trajectories, the system distills a transferable reasoning memory:
In oxy-Cope rearrangements, the chair transition state typically leads to the more stable trans double bond geometry, not the Z-isomer.
Memory Selection
Memory Synthesis
TTS Solving
Judge Selection
Feedback & Memory Formation
- [Result]
SUCCESS
Final Answer: A
Rollouts: 3 (2 correct)
Selected: Rollout 0
Memory Stored: 1
Figure 9: Case study illustrating BEAM's test-time scaling and feedback-driven memory formation. The task text and answer choices are abridged for readability.
Case 2: Belief-Guided Memory Resolves Inconclusive Reasoning
- [Task]
Question: Determine the starting material needed to synthesize 5-isopropyl-3,4-dimethylcyclohex-1-ene via ring-closing metathesis.
Options: A. 5-isopropyl-3,4-dimethylocta-2,6-diene
B. 5-isopropyl-3,4-dimethylocta-1,7-diene
C. 5-isopropyl-3,4-dimethylocta-1,6-diene
D. 4-isopropyl-5,6-dimethylocta-1,7-diene
- [Reasoning Comparison]
Without Memory
Step 1: The base LLM reasons solely from the current task.
Step 2: It correctly identifies ring-closing metathesis as the required transformation, but cannot reliably distinguish the 2,6-, 1,6-, and 1,7-diene candidates due to the lack of a clear structural connectivity check.
Step 3: As a result, the model repeatedly revisits the 2,6-, 1,6-, and 1,7-diene alternatives, producing a lengthy and inconclusive response without a properly formatted final answer.
Outcome: No Valid Final Answer
With BEAM
Step 1: The memory belief estimator scores candidate memories by their estimated task-conditioned utility and selects the Top-3 for reasoning.
Step 2: Applicable information from the selected memories is synthesized into actionable working guidance: verify that the terminal alkenes are connected such that ring closure forms the target cyclohexene with the required substitution pattern, while avoiding confusion with Diels–Alder or ring-opening metathesis.
Step 3: Using the selected Top-3 memories and synthesized working guidance, the executor eliminates the incompatible options and returns the correct answer.
Outcome: Correct Answer B
Belief-Guided Selection
Memory Synthesis
Guided Solving
- [Result]
SUCCESS
Without Memory: No Valid Final Answer
With BEAM: Correct (B)
Selected Memories: 3
Figure 10: Case study illustrating BEAM's belief-guided memory selection and task-conditioned memory synthesis. The task text and answer choices are abridged for readability.