Manuscript Offprint
arXiv:2611.01747Evolving Memory, Learning to Meta-Control: Test-Time Adaptation for Experience-augmented LLM Agents
Abstract
Self-evolving agents accumulate experience from task streams, but existing frameworks typically rely on fixed pipelines to retrieve and utilize this experience, neglecting when and how to deploy it. We introduce Online Meta-Control of Experience (OMCE), a framework that updates experience memory and learns a meta-control policy from task feedback during test-time adaptation. OMCE employs a lightweight contextual-bandit meta-controller that uses compact retrieval signals to select among four cognitive actions—DIRECT, EPISODE, GUIDE, and DISTILL. This routing mechanism operationalizes three coupled decisions: whether to invoke experience, which memory format to utilize, and when to consolidate new guidance. OMCE evolves online, leveraging task feedback to update the memory bank and refine the routing policy via contextual bandit updates. Experiments on four online adaptation benchmarks across four backbones show that OMCE improves first-attempt success by up to 20.5 percentage points over the strongest compared baseline, while reducing per-task token use by a factor of 5.7–62.5 relative to ACE with GPT-5.2. Controlled ablations further support the benefits of learned routing and continued routing policy adaptation.
1 Introduction
Experience-oriented self-evolving LLM agents turn interaction feedback into reusable experience for later tasks (Gao et al., 2025; Fang et al., 2025a; Chen et al., 2026). This experience can preserve concrete task cases or take more abstract forms, including reasoning guidance, reusable skills, and context playbooks (Fang et al., 2025b; Ouyang et al., 2025; Wang et al., 2023; Zhang et al., 2025a). Its availability, however, does not guarantee its utility for the current task: semantic similarity alone may retrieve unhelpful experience (Zhang et al., 2026b). Even when experience is useful, concrete cases retain execution details but may not transfer readily to different tasks, while distilled guidance captures reusable principles but can omit details needed for execution (Fang et al., 2025b; Ouyang et al., 2025). Extending this memory also poses a further choice: distilling guidance from accumulated episodes may help future tasks, but also incurs additional computational cost and can lead to excessive memory growth (Zhang et al., 2025a). These trade-offs leave open how experience should be used and expanded as tasks arrive.
We argue that scheduling accumulated experience is a learnable dimension of self-evolution, and make it precise through three requirements. (1) Adaptive invocation: whether experience is needed at all (Fang et al., 2025b; Ouyang et al., 2025). (2) Selective form: which of its forms to use (Fang et al., 2025b; Zhang et al., 2025a).
(3) Learnable consolidation: when to distill transferable guidance from episodic evidence (Zhang et al., 2025a; Shinn et al., 2023).
Meta-control research on adaptive tool use (Li et al., 2025) and cognitive-demand monitoring (Scoville et al., 2026) suggests that adapting reasoning effort to task demands can be more effective than uniformly allocating computation (De Sabbata et al., 2024). These frameworks, however, control external, fixed resources such as a tool set or a reasoning budget. Accumulated experience differs: the agent produces it itself, in heterogeneous forms, in a store that grows and shifts, so scheduling it requires a decision over use and consolidation, not a single invocation flag.
To this end, we propose Online Meta-Control of Experience (OMCE), an agent framework that learns to control experience use and consolidation through a lightweight meta-controller over episodic and guidance memory.
Implemented as a contextual bandit, the con-
Equal contribution.
Corresponding authors.
Three missing control decisions in self-evolving agents

Figure 1: From Fixed Pipelines to Learned Meta-Control. Up: Existing methods typically follow a fixed routine for using and consolidating experience, even when the retrieved experience does not help the current task. Down: OMCE learns from task feedback when to use experience, whether to draw on past cases or general guidance, and when to distill new guidance.
troller regulates whether to invoke experience, which form to use, and when to distill new guidance (Fig. 1).
At inference, it summarizes retrieval profiles in a nine-dimensional meta-state vector and uses linear reward models to select among DIRECT, EPISODE, GUIDE, and DISTILL, without an additional LLM call for action selection.
After execution, memory evolution records outcomes, generates case-specific insights, and refines injected guidance using task feedback, while meta-evolution adapts the routing policy through online bandit updates.
Experiments on four online adaptation benchmarks show that OMCE achieves the highest first-attempt success in most evaluated settings, with competitive cumulative success under the same retry budget. Ablations show that no fixed experience strategy is consistently the best, while controlled comparisons with shared memory demonstrate the value of learning when and how to use experience. Freezing the controller reduces first-attempt success, supporting continued policy adaptation as memory evolves. Finally, efficiency analysis shows that OMCE achieves a favorable performance–token trade-off, using substantially fewer tokens than ACE's full-playbook prompting.
into general principles, evolving playbooks, and reusable reasoning memories through generation, reflection, and refinement (Zhao et al., 2024; Zhang et al., 2025a; Ouyang et al., 2025). MemRL (Zhang et al., 2026b) improves retrieval by scoring memory candidates with a non-parametric Q-value function, and Evo-Memory (Wei et al., 2025) benchmarks retrieval, integration, and update in continuous task streams. Overall, these efforts show that experience can be accumulated, abstracted, and maintained in multiple forms. However, most frameworks still use a fixed retrieve-inject-reflect pipeline, with limited control over whether memory is useful for the current task, which type of experience to consult, or whether a new outcome should be consolidated (Majumder et al., 2023; Yang et al., 2025).
Meta-Control in LLM Agents. Learned meta-control decides whether to invoke a resource and how much to spend on it: a tool (Li et al., 2025), a deliberation budget (De Sabbata et al., 2024; Ji-An et al., 2025), test-time compute (Snell et al., 2024), a learning mode (Dupoux et al., 2026), or a verifier (Wan et al., 2026); related work also edits the agent's program directly (Zhang et al., 2026a). Dual-process agents separate fast execution from slower deliberation (Evans, 2011; Evans and Stanovich, 2013; Liu et al., 2023; Zhang et al., 2025b), and feedback-driven methods improve these meta-level policies with reward signals (Wu and Qu, 2025). Closest to our setting are controllers selecting among reasoning strategies at inference time: Meta-Reasoner (Sui et al., 2026) learns with a contextual bandit when to backtrack or restart within one problem, and MetaScale (Liu et al., 2026) evolves meta-thoughts as the sampling budget grows. Both focus on controlling predefined resources, but OMCE instead learns to manage the experience an agent accumulates over time, jointly deciding when to use existing experience and when to distill new guidance.
3 Online Meta-Control of Experience
Given a sequential stream of queries , OMCE equips an LLM agent with Episodic Memory, Guidance Memory, and a Meta-Controller (Fig. 2).
For each query, the controller uses meta-state to select an action that determines whether and which experience to inject into the task prompt, including whether to distill new guidance before execution. The resulting augmented context is supplied to the agent. Task feedback then updates the stored experience and the controller's policy, allowing both to adapt across the stream.
3.1 Memory Representation
The Episodic Memory maintains episodic records of past interactions, . Each record contains the task trajectory , the immediate reward , and a small set of case-specific insight entries . These entries capture reusable patterns from successful cases or corrective lessons from failed ones. The Guidance Memory stores guidance entries distilled from related episodic records, . Compared with , each is less tied to a single trajectory and instead summarizes a recurring principle that may transfer across similar cases. For retrieval, both case-specific insights and guidance entries use the same two-part format: a compact description of the applicable scenario and a detailed principle. The description serves as the cue for query-to-memory matching, while the principle supplies the content for injection into the task prompt.
3.2 Adaptive Meta-Control
We model the inference-time control process of OMCE as a contextual bandit (Chu et al., 2011; Abbasi-Yadkori et al., 2011), in which the Meta-Controller observes the meta-state , selects a cognitive action, and receives feedback only for that action at each step.
Meta-State Representation. To support efficient action selection, the Meta-Controller summarizes the current retrieval results rather than consuming raw memory text. Given the current query , we retrieve the top- candidate entries from each memory source based on cosine similarity between the semantic embeddings of the query and each entry's applicable scenario (Reimers and Gurevych, 2019; Karpukhin et al., 2020). We denote the retrieved sets from episodic memory and guidance memory by and , respectively. The meta-state is a nine-dimensional feature vector
The state captures three properties: Relevance , measured by retrieval scores from the two memory sources; Quality , measured by memory quality scores and their relevance-weighted counterparts; and Diversity , defined specifically as episodic outcome diversity. Diversity captures the balance between successful and failure-side episodic evidence and the normalized entropy of outcome types, rather than semantic diversity among retrieved entries. The first eight coordinates are normalized online, while the final coordinate is a constant bias; and are exposed only to the DISTILL action through an action-specific feature mask. Section A gives the full definitions and the quality-score mapping.
These three properties inform action selection. High relevance and reliable evidence favor experience reuse, weak or conflicting signals favor DIRECT, and relevant but insufficiently generalized episodes favor DISTILL.
Actions and Augmented Context. Given , the Meta-Controller selects from . The selected action determines whether and which experience to inject into the task prompt containing , producing the complete execution context . (DIRECT, direct execution) retains the original task input without adding external experience. (EPISODE, episodic reuse) injects retrieved episodic records into the task prompt as concrete prior cases. (GUIDE, guidance reuse) injects retrieved guidance entries into the task prompt as reusable principles. (DISTILL, experience distillation) first distills and stores a new guidance entry from the retrieved episodic evidence (Section 3.3), then injects it into the task prompt:

Figure 2: Architecture of OMCE. The lightweight Meta-Controller selects a cognitive action specifying whether and which experience to inject into the task prompt. The agent solves the task with the augmented context containing the query and any injected experience. Memory evolution records outcomes in episodic memory, distills guidance before execution when DISTILL is selected, and refines injected guidance afterward using task feedback.
Here, Augment injects the selected experience into the task prompt containing the query, following the task prompt template without an additional LLM call. Fixed instructions shared by all actions are implicit, so the DIRECT branch denotes the original task input with those instructions.
Action Selection and Execution. Under the contextual-bandit formulation, the Meta-Controller maximizes the immediate current-query reward. For each , we use an action-wise linear model (Chu et al., 2011; Abbasi-Yadkori et al., 2011) with online estimate . The estimate and decision rule are
where combines the predicted reward with an exploration term, keeping underexplored actions selectable. The action-wise statistics and are updated from feedback as described below. The agent executes the task conditioned on the augmented context, inducing a pretrained-LLM policy from which the task trajectory is sampled: .
Meta-Evolution. Meta-evolution adapts the Meta-Controller through task feedback by updating the contextual bandit's action-wise reward models, which guide subsequent action selection. After execution, the agent receives reward for the current query. Only the selected action yields an observation, so the rewards of unchosen actions
remain unobserved counterfactuals.
To update the bandit reward models, we update their action-wise sufficient statistics using as
(4)
where is a forgetting factor. The new observation is added only to the selected action, while the discount is applied to all action models (Russac et al., 2019) so that older evidence is downweighted under changing memory distributions. The updated statistics determine the next parameter estimates through Eq. 3. With four actions and a nine-dimensional meta-state, both action selection and bandit updates operate on small matrices and vectors, requiring no additional LLM calls.
A formal finite-time analysis of the controller's learning behavior is provided in Appendix E.
3.3 Memory Evolution
DISTILL. Before execution, if , an LLM distills a transferable principle from the retrieved episodic records and stores it as a guidance entry for current and future use:
Episodic Record generation. After the agent produces a trajectory and receives reward , an LLM extracts case-specific insights . We record each execution outcome in Episodic Memory as , regardless of the selected action or task outcome. This preserves evidence for later reuse and distillation, while the controller determines when to distill it into transferable guidance.
Guidance refinement. Refinement is a follow-up update to the guidance entries which are injected into the augmented context. After execution under or , an LLM refines each such entry, whether retrieved or newly distilled, with the realized trajectory and reward :
Optional Multi-Attempt Extension. With additional inference budget, the agent may make up to attempts per task, stopping upon success (Snell et al., 2024; Shinn et al., 2023). After a failed attempt, the extracted case-specific experience is stored in Episodic Memory and injected into the task prompt containing the original query to form the augmented context for the next attempt on the same task. Appendix F gives the complete inference and learning loop, including this extension.
4 Experiments
We evaluate all methods in an online adaptation setting, where tasks arrive and must be solved sequentially. After completing an instance, the agent observes task feedback and may update its memory, controller, or context before processing the next instance.
4.1 Experimental Design
We organize the evaluation around five questions. RQ1: does learned routing raise first-attempt success across benchmarks and backbones? RQ2: how should the routing policy be determined, in particular is a fixed form of experience use sufficient, and does a learned controller beat fixed and hand-crafted alternatives? RQ3: do the gains come from the routing policy, or from the memory content and the update schedule? RQ4: does the controller keep improving as the stream proceeds? RQ5: what is the token cost of these gains? Section 4.2 addresses RQ1, Section 4.3 addresses RQ2 to RQ4, and Section 4.4 addresses RQ5.
The evaluated methods span four test-time adaptation regimes: no external memory (Base LLM), within-instance retry (Reflexion (Shinn et al., 2023)), cross-task adaptation (MemP (Fang et al., 2025b)), and cross-task adaptation with multi-attempt inference, including ACE (Zhang et al., 2025a), ReasoningBank (Ouyang et al., 2025) and our OMCE, which differs from these baselines in learning when to invoke experience and which form to use rather than following a fixed routine. Against OMCE, we additionally compare policies that always commit to one form of experience and a hand-crafted rule over retrieval scores (Section 4.3). We report two variants of OMCE: OMCE-TS and OMCE-UCB, which implement meta-evolution with two contextual-bandit action-selection algorithms: Thompson Sampling (TS) (Agrawal and Goyal, 2013) and LinUCB (Chu et al., 2011; Abbasi-Yadkori et al., 2011), respectively (detailed in Appendix B).
We evaluate on four complementary benchmarks spanning distinct task domains under this shared setting: BigCodeBench (Zhuo et al., 2024) and SWE-bench Verified (Jimenez et al., 2023) for code generation and repository-level software engineering, MultiChallenge (Deshpande et al., 2025) for realistic multi-turn conversation, and BBEH (Kazemi et al., 2025) for advanced general reasoning. Across all benchmarks, we use four LLMs as backbone models: GPT-5.2 (OpenAI, 2025), DeepSeek-V3.2 (Liu et al., 2025), DeepSeek-V4-pro (DeepSeek-AI, 2026), and Kimi-K2.5 (Team et al., 2026).
We use one-shot success rate (OSR) as the primary metric, also called first-attempt success: it measures whether the current policy and accumulated experience solve an instance on the first attempt. For methods with retry mechanisms, we additionally report cumulative success rate (CSR), defined as success within a shared budget of total attempts, including the initial attempt (Section G.3). Reflexion does not transfer experience across instances, so by construction its first attempt matches the Base LLM under this protocol; we therefore report its CSR only, while OMCE's CSR combines within-instance retries with cross-instance adaptation. Full details on benchmark construction, trial protocol, baseline implementations, metrics, and controller variants are provided in Appendix G. Both variants share one configuration across all benchmarks and backbones; the values and the selection procedure are given there.
4.2 Main Results
Table 1 reports the performance across all benchmark-backbone configurations, demonstrat-
| Benchmark | Model | OSR ↑ / CSR ↑ | ||||||
|---|---|---|---|---|---|---|---|---|
| Base LLM | Reflexion | MemP | ReasoningBank | ACE | OMCE-TS | OMCE-UCB | ||
| Multi-Challenge | GPT-5.2 | 52.8% / 70.1% | - / 98.2% | 50.2% / - | 53.9% / 66.3% | 48.7% / 71.4% | 67.4% / 97.1% | 66.3% / 95.6% |
| Deepseek-V3.2 | 43.1% / 55.7% | - / 91.6% | 46.9% / - | 48.4% / 56.0% | 50.2% / 70.0% | 70.7% / 95.6% | 67.4% / 96.7% | |
| Deepseek-V4-pro | 49.5% / 63.0% | - / 90.1% | 48.0% / - | 55.3% / 66.3% | 50.2% / 74.7% | 69.6% / 93.8% | 64.8% / 91.2% | |
| Kimi-K2.5 | 49.8% / 64.8% | - / 89.0% | 50.9% / - | 56.7% / 72.8% | 49.8% / 70.7% | 72.2% / 95.6% | 73.3% / 96.7% | |
| BBEH | GPT-5.2 | 33.3% / 49.7% | - / 83.9% | 31.9% / - | 31.3% / 37.7% | 52.4% / 94.4% | 53.3% / 78.7% | 46.8% / 71.0% |
| Deepseek-V3.2 | 41.7% / 59.5% | - / 88.7% | 26.9% / - | 37.3% / 44.6% | 45.2% / 91.2% | 45.8% / 73.8% | 46.3% / 73.3% | |
| Deepseek-V4-pro | 38.3% / 60.1% | - / 93.3% | 33.8% / - | 47.4% / 55.5% | 45.7% / 93.1% | 47.3% / 79.8% | 47.4% / 80.0% | |
| Kimi-K2.5 | 39.7% / 61.5% | - / 85.8% | 48.8% / - | 15.6% / 16.6% | 46.2% / 87.1% | 48.7% / 80.7% | 48.4% / 81.2% | |
| BigCode-Bench | GPT-5.2 | 48.1% / 54.0% | - / 61.4% | 51.1% / - | 50.4% / 68.1% | 38.2% / 40.3% | 49.6% / 58.9% | 51.3% / 59.2% |
| Deepseek-V3.2 | 47.9% / 58.4% | - / 69.0% | 49.3% / - | 47.6% / 69.7% | 36.9% / 41.0% | 47.7% / 65.2% | 47.1% / 65.5% | |
| Deepseek-V4-pro | 35.7% / 52.1% | - / 66.9% | 49.6% / - | 35.9% / 69.7% | 36.7% / 41.4% | 43.3% / 70.7% | 44.1% / 69.7% | |
| Kimi-K2.5 | 49.1% / 55.7% | - / 73.4% | 51.1% / - | 49.3% / 73.4% | 38.0% / 42.5% | 48.5% / 68.3% | 49.1% / 69.7% | |
| SWE-bench Verified | GPT-5.2 | 52.8% / 64.0% | - / 64.2% | 61.8% / - | 53.6% / 63.0% | 50.8% / 52.0% | 64.8% / 64.8% | 64.8% / 64.8% |
| Deepseek-V3.2 | 40.2% / 42.0% | - / 46.6% | 48.0% / - | 46.8% / 48.0% | 44.2% / 47.4% | 52.4% / 53.8% | 53.0% / 54.0% | |
| Deepseek-V4-pro | 48.2% / 48.2% | - / 53.4% | 48.8% / - | 42.6% / 43.8% | 43.8% / 45.2% | 58.8% / 60.4% | 58.4% / 61.2% | |
| Kimi-K2.5 | 49.2% / 50.2% | - / 53.6% | 45.0% / - | 47.0% / 49.6% | 45.2% / 46.8% | 48.8% / 49.0% | 48.6% / 48.6% | |
Table 1: Main results under the online adaptation setting. Each entry is reported as OSR / CSR (%), where CSR is measured within attempts. For Reflexion, "-" denotes that no first-attempt evaluation applies, as explained in the metric definitions above.
| Benchmark | OSR ↑ / CSR ↑ | ||||
|---|---|---|---|---|---|
| Fixed-EPISODE | Fixed-GUIDE&DISTILL | OMCE-HEU | OMCE-TS | OMCE-UCB | |
| MultiChallenge | 56.0% / 91.2% | 63.7% / 94.5% | 64.5% / 95.2% | 67.4% / 97.1% | 66.3% / 95.6% |
| BBEH | 50.3% / 76.8% | 43.1% / 73.8% | 45.6% / 71.7% | 53.3% / 78.7% | 46.8% / 71.0% |
| BigCodeBench | 49.0% / 59.0% | 49.6% / 58.0% | 47.4% / 57.4% | 49.6% / 58.9% | 51.3% / 59.2% |
| SWE-bench Verified | 64.2% / 64.8% | 64.4% / 64.8% | 64.0% / 64.8% | 64.8% / 64.8% | 64.8% / 64.8% |
Table 2: Routing ablation of OMCE on GPT-5.2, OSR / CSR (%). Fixed-EPISODE and Fixed-GUIDE&DISTILL always commit to one form of experience; OMCE-HEU selects actions with hand-crafted rules. Appendix D reports the same comparison for the remaining backbones.
ing that OMCE systematically improves test-time adaptation: it attains the highest first-attempt success on eleven of the sixteen benchmark–backbone configurations. We highlight two key findings:
Learned Routing Leads in First-Attempt Success. OMCE dominates first-attempt success wherever retrieved experience carries reliable signal. On MultiChallenge it leads ReasoningBank, ACE, and MemP on all four backbones, by 13.5 to 20.5 points over the best of the three, and its weakest backbone there, at 67.4%, still exceeds the strongest baseline on any backbone by 10.7 points. It leads the same three baselines on all four backbones of SWE-bench Verified by 1.8 to 10.0 points. On BBEH it matches or leads the strongest baseline on three backbones, reaching 53.3% with GPT-5.2 against 52.4% for ACE and trailing by 0.1 point on Kimi-K2.5. On BigCodeBench, OMCE leads in OSR with GPT-5.2 but trails MemP on the other three backbones.
Selective Routing Can Bypass Memory. DIRECT allows the controller to solve a task without injecting retrieved experience. On BigCodeBench, the better-performing OMCE variant matches or ex-
ceeds the Base LLM’s OSR on three backbones and trails it by 0.2 point on the fourth. ACE falls 9.9 to 11.1 points below it on three.
4.3 Ablation Study
We examine where the gains of OMCE come from through three questions, answering RQ2 to RQ4. The first compares routing rules on all four backbones, covering two fixed policies, a hand-crafted one, and the two learned variants: Table 2 reports GPT-5.2 and Section D the full grid. The other two examine memory use and controller updates on GPT-5.2, holding the backbone fixed across conditions.
How should the routing policy be determined? Fixed-EPISODE always injects retrieved episodic records into the task prompt, and Fixed-GUIDE&DISTILL always reuses or distills guidance. On GPT-5.2, Fixed-EPISODE exceeds Fixed-GUIDE&DISTILL by 7.2 OSR points on BBEH (50.3 vs. 43.1), and the order reverses on Multi-Challenge, where Fixed-GUIDE&DISTILL leads by 7.7 points (63.7 vs. 56.0). Committing to either
| Benchmark | Variant | OMCE | Online memory evolution | Shared memory snapshot | ||
|---|---|---|---|---|---|---|
| Always-Both-and-Update | Frozen Controller | Always-Both | Random | |||
| MultiChallenge | OMCE-TS | 67.4% / 97.1% | 63.7% / 95.2% | 61.9% / 94.1% | 63.0% / 83.5% | 62.6% / 83.9% |
| BBEH | OMCE-TS | 53.3% / 78.7% | 51.1% / 77.6% | 49.8% / 75.6% | 49.7% / 71.8% | 48.2% / 67.4% |
| BigCodeBench | OMCE-UCB | 51.3% / 59.2% | 48.3% / 53.5% | 49.5% / 65.4% | 47.5% / 55.6% | 46.5% / 57.0% |
| SWE-bench Verified | OMCE-TS | 64.8% / 64.8% | 55.0% / 55.2% | 64.2% / 64.6% | 48.8% / 49.2% | 53.0% / 53.4% |
Table 3: Controlled analysis on GPT-5.2, OSR / CSR (%). For each benchmark, OMCE uses the variant with the higher GPT-5.2 OSR in Table 1 (TS on ties). Frozen Controller stops controller updates mid-stream while memory keeps evolving; Always-Both and Random read one shared memory snapshot without updating it.

Figure 3: Performance–efficiency trade-off on four benchmarks using GPT-5.2. The x-axis represents the one-shot success rate, and the y-axis reports the token cost in log scale (average total prompt and output tokens consumed per task).
form costs accuracy where it fits poorly: Fixed- trails OMCE-TS by 11.4 points on Multi-Challenge, and Fixed-a_{GUIDE}&DISTILL} trails it by 10.2 points on BBEH. Which form helps therefore depends on the task; the same reversal appears at the level of individual backbones, where the BBEH ordering of the two fixed policies flips between GPT-5.2 and DeepSeek-V3.2.
OMCE-HEU is also adaptive, selecting among the same four actions with fixed thresholds on retrieval scores (Appendix C). On GPT-5.2 the learned controllers exceed the tuned heuristic by 0.8 to 7.7 points on all four benchmarks, with the widest margin on BBEH (53.3 vs. 45.6). Across the full grid the better learned variant outperforms OMCE-HEU on 14 of the 16 benchmark–backbone pairs. Individually, TS and UCB each outperform OMCE-HEU in OSR on 11 of the 16 configurations.
Do the gains come from routing or from the memory? To separate routing from memory content, we fix the memory that OMCE has built and vary only the routing rule. Always-Both reads both memory types on every task and Random picks a feasible action uniformly, both against that same snapshot. With identical memory content, OMCE exceeds Always-Both by 3.6 to 16.0 OSR points and Random by 4.8 to 11.8, with higher CSR on
all four benchmarks, and reaches the best OSR of any policy on the same snapshot. Where the gap is largest, on SWE-bench Verified, Always-Both reaches 48.8 OSR, below the Base LLM without any memory (52.8, Table 1), and on BigCodeBench it reaches 47.5 against 48.1. On two of the four benchmarks, then, indiscriminate retrieval is worse than retrieving nothing.
The same holds when the memory keeps evolving. Always-Both-and-Update runs the full online loop as OMCE does, but retrieves from both memory types and updates memory after every task, and it trails OMCE on all four benchmarks by 2.2 to 9.8 OSR points, with lower CSR in each case. These comparisons show an OSR advantage for learned routing under both fixed and evolving memory.
Does the controller need to keep learning? We freeze the controller parameters at the midpoint of each stream while memory continues to evolve. The two interventions in this section order the benchmarks identically. Freezing the controller costs first-attempt success on all four, by 5.5 points on MultiChallenge, 3.5 on BBEH, 1.8 on Big-CodeBench, and 0.6 on SWE-bench Verified, while OMCE's lead over the best fixed policy of Table 2 over the same four benchmarks is 3.7, 3.0, 1.7, and 0.4 points. CSR falls on three benchmarks, by 0.2
Case Study: Self-Correction Detection Task
The user corrects June to July. OMCE selects Guide to recognize the correction and use the updated date.

Figure 4: Self-correction detection in MultiChallenge. The meta-controller routes the query to GUIDE () rather than to episodic cases that enforce the user's outdated constraint.
to 3.1 points; on BigCodeBench it instead rises, from 59.2 to 65.4. Continued controller updates improve OSR on all four benchmarks, while their effect on CSR varies across benchmarks.
4.4 Efficiency Analysis: Token–Performance Trade-off
We evaluate efficiency using tokens per task, the average total LLM tokens consumed per instance over the full online adaptation pipeline; Section G.3 gives the exact accounting. Figure 3 plots the performance–efficiency frontier with GPT-5.2 as the backbone; Appendix H gives the statistics for all backbones.
MemP is the most token-efficient method because it performs no test-time scaling. With GPT-5.2, OMCE reduces per-task token use by a factor of 5.7–62.5 relative to ACE. OMCE sits between the two across all four benchmarks and all four backbone LLMs (Figure 5), at a token cost close to the retrieval baselines.
4.5 Case Study
A case from MultiChallenge illustrates the routing decision (Figure 4): a user planning a conference initially says “in June,” then corrects it to “in July.”
A fixed pipeline retrieves insights from the top-matching episodic records, all of which direct the agent to hold earlier statements as hard constraints, and the model accordingly insists on June. The meta-controller reads as weak or conflicting on the episodic side and routes the query to , where the retrieved guidance concerns detecting and reconciling contradictions; the agent then picks up the July date and solves the task.
5 Conclusion
In this work, we presented OMCE, a framework that recasts experience-augmented reasoning from an always-on memory pipeline into a learnable meta-cognitive control problem. Instead of treating retrieval, context injection, reflection, and consolidation as a fixed routine, OMCE employs a lightweight meta-controller based on compact retrieval features and linear reward models to govern the full lifecycle of experience: choosing among DIRECT, EPISODE, GUIDE, and DISTILL. Crucially, this meta-controller evolves online via task feedback, progressively improving the agent's judgment over its own cognitive processes. Evaluations across four online adaptation benchmarks demonstrate that OMCE establishes state-of-the-art OSR and a favorable performance-token trade-off. Ultimately, our findings suggest that as self-evolving agents mature, the primary bottleneck of online adaptation shifts from merely accumulating richer experience to learning exactly when and how that experience should be deployed and updated.
Limitations
OMCE inherently relies on timely feedback. In environments with sparse or delayed rewards, the contextual-bandit updates can become noisy, and abrupt task distribution shifts may render both the accumulated experience and the learned meta-policy stale. Moreover, due to the partial observability of the bandit formulation, the controller lacks counterfactual signals regarding unchosen cognitive routes, potentially slowing its recovery from early suboptimal decisions. Additionally, as the memory banks expand indefinitely, retrieval may suffer from redundancy or semantic collisions.
To address these limitations, future work could integrate established memory-maintenance techniques (e.g., explicit aging or eviction of stored memory entries). More fundamentally, future iterations could leverage the LLM's reflective capabilities to simulate counterfactual rewards for unchosen actions (potentially accelerating bandit convergence), or complement the current meta-control framework with explicit memory auditing and pruning, advancing towards a fully autonomous lifelong-learning agent.
Our controlled comparisons of memory use and controller updates focus on GPT-5.2, while the routing comparison spans all four backbones. Testing the same interventions on other backbones would help assess whether the observed effects generalize.
Acknowledgments
We used AI assistants to polish and paraphrase author-written text, assist with short-form text completion, and identify relevant literature. All references were verified by the authors, who take full responsibility for the paper's content.
References
Yasin Abbasi-Yadkori, Dávid Pál, and Csaba Szepesvári. 2011. Improved algorithms for linear stochastic bandits. Advances in neural information processing systems, 24.
Shipra Agrawal and Navin Goyal. 2013. Thompson sampling for contextual bandits with linear payoffs. In International conference on machine learning, pages 127–135. PMLR.
Marc-Antoine Allard, Arnaud Teinturier, Victor Xing, and Gautier Viaud. 2026. Experiential reflective learning for self-improving llm agents. arXiv preprint arXiv:2603.24639.
Mingguang Chen, Licheng Wang, and Bo Qu. 2026. Recursive self-improvement in ai: From bounded self-refinement to autonomous research loops. arXiv preprint arXiv:2607.07663.
Silin Chen, Shaoxin Lin, Xiaodong Gu, Yuling Shi, Heng Lian, Longfei Yun, Dong Chen, Weiguo Sun, Lin Cao, and Qianxiang Wang. 2025. Swe-exp: Experience-driven software issue resolution. arXiv preprint arXiv:2507.23361.
Wei Chu, Lihong Li, Lev Reyzin, and Robert Schapire. 2011. Contextual bandits with linear payoff functions. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pages 208–214. JMLR Workshop and Conference Proceedings.
C Nicolò De Sabbata, Theodore R Sumers, Badr AlKhamissi, Antoine Bosselut, and Thomas L Griffiths. 2024. Rational metareasoning for large language models. arXiv preprint arXiv:2410.05563.
DeepSeek-AI. 2026. Deepseek-v4: Towards highly efficient million-token context intelligence.
Kaustubh Deshpande, Ved Sirdeshmukh, Johannes Baptist Mols, Lifeng Jin, Ed-Yeremai Hernandez-Cardona, Dean Lee, Jeremy Kritz, Willow E Primack, Summer Yue, and Chen Xing. 2025. Multichallenge: A realistic multi-turn conversation evaluation benchmark challenging to frontier llms. In Findings of the Association for Computational Linguistics: ACL 2025, pages 18632–18702.
Emmanuel Dupoux, Yann LeCun, and Jitendra Malik. 2026. Why ai systems don't learn and what to do about it: Lessons on autonomous learning from cognitive science. arXiv preprint arXiv:2603.15381.
Jonathan St BT Evans. 2011. Dual-process theories of reasoning: Contemporary issues and developmental applications. Developmental review, 31(2-3):86–102.
Jonathan St BT Evans and Keith E Stanovich. 2013. Dual-process theories of higher cognition: Advancing the debate. Perspectives on psychological science, 8(3):223–241.
Jinyuan Fang, Yanwen Peng, Xi Zhang, Yingxu Wang, Xinhao Yi, Guibin Zhang, Yi Xu, Bin Wu, Siwei Liu, Zihao Li, et al. 2025a. A comprehensive survey of self-evolving ai agents: A new paradigm bridging foundation models and lifelong agentic systems. arXiv preprint arXiv:2508.07407.
Runnan Fang, Yuan Liang, Xiaobin Wang, Jialong Wu, Shuofei Qiao, Pengjun Xie, Fei Huang, Hua-jun Chen, and Ningyu Zhang. 2025b. Memp: Exploring agent procedural memory. arXiv preprint arXiv:2508.06433.
Huan-ang Gao, Jiayi Geng, Wenyue Hua, Mengkang Hu, Xinzhe Juan, Hongzhang Liu, Shilong Liu, Jia-hao Qiu, Xuan Qi, Yiran Wu, et al. 2025. A survey of self-evolving agents: On path to artificial super intelligence. arXiv preprint arXiv:2507.21046.
Li Ji-An, Marcelo G Mattar, Hua-Dong Xiong, Marcus K Benna, and Robert C Wilson. 2025. Language models are capable of metacognitive monitoring and control of their internal activations. ArXiv, pages arXiv-2505.
Carlos E Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. 2023. Swe-bench: Can language models resolve real-world github issues? arXiv preprint arXiv:2310.06770.
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 conference on empirical methods in natural language processing (EMNLP), pages 6769–6781.
Mehran Kazemi, Bahare Fatemi, Hritik Bansal, John Palowitch, Chrysovalantis Anastasiou, Sanket Vaibhav Mehta, Lalit K Jain, Virginia Aglietti, Disha Jindal, Yuanzhu Peter Chen, et al. 2025. Big-bench extra hard. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 26473–26501.
Emre Kucman, Robert Ness, Amit Sharma, and Chen-hao Tan. 2023. Causal reasoning and large language models: Opening a new frontier for causality. arXiv preprint arXiv:2305.00050.
Wenjun Li, Dexun Li, Kuicai Dong, Cong Zhang, Hao Zhang, Weiwen Liu, Yasheng Wang, Ruiming Tang, and Yong Liu. 2025. Adaptive tool use in large language models with meta-cognition trigger. arXiv preprint arXiv:2502.12961.
Aixin Liu, Aoxue Mei, Bangcai Lin, Bing Xue, Bingxuan Wang, Bingzheng Xu, Bochao Wu, Bowei Zhang, Chaofan Lin, Chen Dong, et al. 2025. Deepseek-v3. 2: Pushing the frontier of open large language models. arXiv preprint arXiv:2512.02556.
Jijia Liu, Chao Yu, Jiaxuan Gao, Yuqing Xie, Qingmin Liao, Yi Wu, and Yu Wang. 2023. Llm-powered hierarchical language agent for real-time human-ai coordination. arXiv preprint arXiv:2312.15224.
Qin Liu, Wenxuan Zhou, Nan Xu, James Y Huang, Fei Wang, Sheng Zhang, Hoifung Poon, and Muhao Chen. 2026. Metascale: Test-time scaling with evolving meta-thoughts. In Findings of the Association for Computational Linguistics: ACL 2026, pages 11828–11842.
Bodhisattwa Prasad Majumder, Bhavana Dalvi Mishra, Peter Jansen, Oyvind Tafjord, Niket Tandon, Li Zhang, Chris Callison-Burch, and Peter Clark. 2023. Clin: A continually learning language agent for rapid task adaptation and generalization. arXiv preprint arXiv:2310.10134.
Allen Nie, Yuhui Zhang, Atharva Shailesh Amdekar, Chris Piech, Tatsunori B Hashimoto, and Tobias Gerstenberg. 2024. Moca: Measuring human-language model alignment on causal and moral judgment tasks. Advances in Neural Information Processing Systems, 36.
OpenAI. 2024. Gpt-4o mini: advancing cost-efficient intelligence.
OpenAI. 2024. New embedding models and api updates. January 25, 2024.
OpenAI. 2025. Update to gpt-5 system card: Gpt-5.2.
Siru Ouyang, Jun Yan, I Hsu, Yanfei Chen, Ke Jiang, Zifeng Wang, Ruijun Han, Long T Le, Samira Daruki, Xiangru Tang, et al. 2025. Reasoningbank: Scaling agent self-evolving with reasoning memory. arXiv preprint arXiv:2509.25140.
Nils Reimers and Iryna Gurevych. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks. In Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), pages 3982–3992.
Yoan Russac, Claire Vernade, and Olivier Cappé. 2019. Weighted linear bandits for non-stationary environments. Advances in Neural Information Processing Systems, 32.
John Scoville, Shengzhuang Chen, Yejin Bang, Stefan Winzeck, and Jonathan Richard Schwarz. 2026. Cognitive demand steering for adaptive meta-reasoning in large language models. arXiv preprint arXiv:2608.01319.
Kulin Shah, Nishanth Dikkala, Xin Wang, and Rina Panigrahy. 2024. Causal language modeling can elicit search and reasoning capabilities on logic puzzles. arXiv preprint arXiv:2409.10502.
Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. 2023. Reflexion: Language agents with verbal reinforcement learning. Advances in Neural Information Processing Systems, 36:8634–8652.
Charlie Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. 2024. Scaling llm test-time compute optimally can be more effective than scaling model parameters. arXiv preprint arXiv:2408.03314.
Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, et al. 2023. Beyond the imitation game: Quantifying and extrapolating the capabilities of language models. Transactions on machine learning research.
Yuan Sui, Yufei He, Tri Cao, Sophia Simeng Han, Yulin Chen, and Bryan Hooi. 2026. Meta-reasoner: Dynamic guidance for optimized inference-time reasoning in large language models. In Findings of the Association for Computational Linguistics: ACL 2026, pages 13268–13286.
Mirac Suzgun, Nathan Scales, Nathanael Schärli, Sebastian Gehrmann, Yi Tay, Hyung Won Chung, Aakanksha Chowdhery, Quoc Le, Ed Chi, Denny Zhou, et al. 2023. Challenging big-bench tasks and whether chain-of-thought can solve them. In Findings of the Association for Computational Linguistics: ACL 2023, pages 13003–13051.
Xiangru Tang, Tianrui Qin, Tianhao Peng, Ziyang Zhou, Daniel Shao, Tingting Du, Xinming Wei, Peng Xia, Fang Wu, He Zhu, et al. 2025. Agent kb: Leveraging cross-domain experience for agentic problem solving. arXiv preprint arXiv:2507.06229.
Kimi Team, Tongtong Bai, Yifan Bai, Yiping Bao, SH Cai, Yuan Cao, Y Charles, HS Che, Cheng Chen, Guanduo Chen, et al. 2026. Kimi k2. 5: Visual agentic intelligence. arXiv preprint arXiv:2602.02276.
Gladys Tyen, Hassan Mansoor, Peter Chen, Tony Mak, and Victor Cärbune. 2023. Llms cannot find reasoning errors, but can correct them! arXiv preprint arXiv:2311.08516.
Yuxuan Wan, Tianqing Fang, Zaitang Li, Yintong Huo, Wenxuan Wang, Haitao Mi, Dong Yu, and Michael R Lyu. 2026. Inference-time scaling of verification: Self-evolving deep research agents via test-time rubric-guided verification. arXiv preprint arXiv:2601.15808.
Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar. 2023. Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291.
Tianxin Wei, Noveen Sachdeva, Benjamin Coleman, Zhankui He, Yuanchen Bei, Xuying Ning, Mengting Ai, Yunzhe Li, Jingrui He, Ed H Chi, et al. 2025. Evo-memory: Benchmarking llm agent test-time learning with self-evolving memory. arXiv preprint arXiv:2511.20857.
Colin White, Samuel Dooley, Manley Roberts, Arka Pal, Ben Feuer, Siddhartha Jain, Ravid Shwartz-Ziv, Neel Jain, Khalid Saifullah, Siddartha Naidu, et al. 2024. Livebench: A challenging, contamination-free llm benchmark. arXiv preprint arXiv:2406.19314.
Chunlong Wu and Zhibo Qu. 2025. Reflection-enhanced meta-optimization integrating textgrad-style prompt optimization with memory-driven self-evolution. arXiv preprint arXiv:2508.18749.
Zhiyong Wu, Chengcheng Han, Zichen Ding, Zhenmin Weng, Zhoumianze Liu, Shunyu Yao, Tao Yu, and Lingpeng Kong. 2024. Os-copilot: Towards generalist computer agents with self-improvement. corr, abs/2402.07456, 2024. doi: 10.48550. arXiv preprint ARXIV.2402.07456.
Wujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Jun-tao Tan, and Yongfeng Zhang. 2025. A-mem: Agentic memory for llm agents. arXiv preprint arXiv:2502.12110.
Cheng Yang, Xuemeng Yang, Licheng Wen, Daocheng Fu, Jianbiao Mei, Rong Wu, Pinlong Cai, Yufan Shen, Nianchen Deng, Botian Shi, et al. 2025. Learning on the job: An experience-driven self-evolving agent for long-horizon tasks. arXiv preprint arXiv:2510.08002.
Jenny Zhang, Bingchen Zhao, Wannan Yang, Jakob Foerster, Jeff Clune, Minqi Jiang, Sam Devlin, and Tattiana Shavrina. 2026a. Hyperagents. arXiv preprint arXiv:2603.19461.
Qizheng Zhang, Changran Hu, Shubhangi Upasani, Boyuan Ma, Fenglu Hong, Vamsidhar Kamanuru, Jay Rainton, Chen Wu, Mengmeng Ji, Hanchen Li, et al. 2025a. Agentic context engineering: Evolving contexts for self-improving language models. arXiv preprint arXiv:2510.04618.
Shao Zhang, Xihuai Wang, Wenhao Zhang, Chaoran Li, Junru Song, Tingyu Li, Lin Qiu, Xuezhi Cao, Xunliang Cai, Wen Yao, et al. 2025b. Leveraging dual process theory in language agent framework for real-time simultaneous human-ai collaboration. arXiv preprint arXiv:2502.11882.
Shengtao Zhang, Jiaqian Wang, Ruiwen Zhou, Junwei Liao, Yuchen Feng, Weinan Zhang, Ying Wen, Zhiyu Li, Feiyu Xiong, Yutao Qi, et al. 2026b. Memrl: Self-evolving agents via runtime reinforcement learning on episodic memory. arXiv preprint arXiv:2601.03192.
Andrew Zhao, Daniel Huang, Quentin Xu, Matthieu Lin, Yong-Jin Liu, and Gao Huang. 2024. Expel: Llm agents are experiential learners. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 19632–19642.
Terry Yue Zhuo, Minh Chien Vu, Jenny Chim, Han Hu, Wenhao Yu, Ratnadira Widyasari, Imam Nur Bani Yusuf, Haolan Zhan, Junda He, Indraneil Paul, et al. 2024. Bigcodebench: Benchmarking code generation with diverse function calls and complex instructions. arXiv preprint arXiv:2406.15877.
Appendix
A Detailed Representation of the Meta-State
For each decision step , the Meta-Controller receives a compact nine-dimensional representation of the retrieved experience rather than the raw memory text:
where the final coordinate is a constant bias term. In all experiments, the retrieval count is fixed to for each memory source.
Let and denote the retrieved episodic records and guidance entries at step , sorted by retrieval score in descending order. For an item from source , let denote its retrieval score and let denote its quality score. The retrieval scores are cosine similarities between the current query and the corresponding memory entry representations computed by dense text embeddings.
For episodic memory, the quality score is mapped from the observed outcome as
For guidance memory, is computed from available success-rate and confidence statistics. When these statistics are unavailable, a memory-type prior is used.
Let denote the top-M items in a retrieved set. When fewer than M items are available, contains all available items. The eight state features are defined as
(9)
Here, , , and denote the numbers of successful, failed, and partial episodic outcomes among the retrieved records. Partial outcomes contribute to the failure side with weight . In particular, we define
Thus, measures the balance between successful episodic evidence and failure-side evidence, where partial outcomes contribute with half the weight of failures.
For the entropy feature, denotes the empirical proportion of outcome type o among the retrieved episodic records:
If no episodic record is retrieved, we set . If the retrieved episodic records contain only one nonzero outcome type, we set . Otherwise, is the normalized entropy of the retrieved outcome types.
If a memory source is empty, its corresponding source-level mean features and relevance-weighted features are set to zero. Therefore, when episodic memory is empty, , , and are set to zero.
When guidance memory is empty, , , and are set to zero.
The first eight coordinates are normalized online using running z-score statistics with symmetric clipping:
The bias coordinate is not normalized. The features and are exposed only to the DISTILL action through an action-specific feature mask.
The state therefore summarizes Relevance through retrieval scores, Quality through outcome-and confidence-based scores and their relevance-weighted counterparts, and Diversity through the balance and normalized entropy of episodic outcome types. Here, Diversity refers specifically to episodic outcome diversity, not semantic diversity among retrieved entries. The controller uses this compact summary to select among DIRECT, EPISODE, GUIDE, and DISTILL without directly accessing the retrieved memory text.
B Action Selection Strategies: Thompson Sampling and LinUCB
For the contextual-bandit action-selection algorithms, we maintain an action-wise linear reward model. At each round , the Meta-Controller observes a meta-state and selects an action . Let denote the immediate reward.
For each action , the sufficient statistics are initialized as and . After observing the reward, the statistics are updated with a forgetting factor :
The posterior mean is given by , and the posterior covariance proxy is , where v > 0 is a scale parameter.
Thompson Sampling (OMCE-TS). Thompson Sampling balances exploration and exploitation by sampling from the posterior distribution. At round , for each action , we draw a parameter sample:
The action is then selected by maximizing the sampled score:
LinUCB (OMCE-UCB). The optimistic LinUCB-style rule selects the action that maximizes an upper confidence bound on the expected reward. At round t, the action is selected as:
where is an exploration hyperparameter that controls the confidence interval width.
C Heuristic Baseline Details
The heuristic baseline employs a fixed, rule-based policy to select actions based solely on retrieval scores, without any online learning or parameter updates. The decision mechanism evaluates the available signals against predefined thresholds to compute a heuristic score for each possible action, ultimately selecting the action with the maximum score.
Let and denote the mean retrieval scores for the episodic records and guidance entries, respectively. The heuristic relies on three configurable hyperparameters: the weak threshold , the use threshold , and the margin threshold . To ensure numerical stability, we define a small constant .
The heuristic scores for the four actions in the action space A are computed as follows:
DIRECT ( ). The score for DIRECT is inversely proportional to the maximum available retrieval score, encouraging the agent to skip when all retrieval signals are weak:
EPISODE (aEPISODE). The score for utilizing an episodic record depends on its absolute signal strength and its relative advantage over the guidance entry signal. We define the episodic strength and episodic advantage as:
The final score is a weighted combination that rewards both absolute strength and relative advantage:
GUIDE ( ). Symmetrically, the score for using a guidance entry is computed based on its strength and advantage :
DISTILL ( ). The score for distilling a new guidance entry is determined by a piecewise function based on the best available retrieval score, . Distillation is favored when the retrieval scores are moderate (between and ), and penalized if the scores are either too weak (indicating poor context) or sufficiently strong (indicating distillation is unnecessary):
Decision Rule. The final action is selected greedily according to the highest computed heuristic score:
D Full Routing Ablation Across Backbones
Table 2 in the main text reports the routing ablation on the reference backbone, GPT-5.2; the table below gives the same comparison for all four backbones, which is what the cross-backbone counts in Section 4.3 are computed from. Two readings are worth noting. First, the ordering of the two fixed policies is not stable: on BBEH, Fixed- leads Fixed- by 7.2 points with GPT-5.2, while the order reverses with DeepSeek-V3.2, where Fixed- leads by 4.7 points. Second, no single fixed policy leads on more than three of the four backbones of any benchmark, so the reversal is not an artifact of one backbone LLM. Across the same grid, the two learned variants split the benchmark–backbone pairs almost evenly: OMCE-TS leads on 8 of the 16, OMCE-UCB on 7, with one tie.
E Additional Theoretical Result for the Meta-Controller
For the theoretical analysis, we consider the stationary regime and set the forgetting factor to . Let denote the set of cognitive actions, with . At each round , the Meta-Controller observes a meta-state and selects an action . The reward denotes the immediate utility of the current query after executing .
For each action , initialize
and define
(27)
In the main text, is used as a shorthand for the expected immediate reward of action under the current meta-state. For the theoretical analysis, we make this quantity explicit by assuming that for each action , there exists an unknown parameter such that
(29)
and that for all .
Moreover, letting
| Benchmark | Model | OSR ↑ / CSR ↑ | ||||
|---|---|---|---|---|---|---|
| Fixed- | Fixed- \alpha_{GUIDE}&DISTILL} | OMCE-HEU | OMCE-TS | OMCE-UCB | ||
| Multi-Challenge | GPT-5.2 | 56.0% / 91.2% | 63.7% / 94.5% | 64.5% / 95.2% | 67.4% / 97.1% | 66.3% / 95.6% |
| Deepseek-V3.2 | 68.9% / 97.4% | 70.3% / 97.4% | 69.2% / 97.4% | 70.7% / 95.6% | 67.4% / 96.7% | |
| Deepseek-V4-pro | 65.6% / 91.9% | 67.0% / 95.2% | 66.3% / 93.8% | 69.6% / 93.8% | 64.8% / 91.2% | |
| Kimi-K2.5 | 73.3% / 96.7% | 72.2% / 96.7% | 72.2% / 96.7% | 72.2% / 95.6% | 73.3% / 96.7% | |
| BBEH | GPT-5.2 | 50.3% / 76.8% | 43.1% / 73.8% | 45.6% / 71.7% | 53.3% / 78.7% | 46.8% / 71.0% |
| Deepseek-V3.2 | 42.5% / 71.3% | 47.2% / 73.1% | 46.1% / 71.4% | 45.8% / 73.8% | 46.3% / 73.3% | |
| Deepseek-V4-pro | 47.4% / 79.8% | 46.4% / 80.0% | 47.5% / 79.0% | 47.3% / 79.8% | 47.4% / 80.0% | |
| Kimi-K2.5 | 47.9% / 80.3% | 46.8% / 77.8% | 48.3% / 77.6% | 48.7% / 80.7% | 48.4% / 81.2% | |
| BigCode-Bench | GPT-5.2 | 49.0% / 59.0% | 49.6% / 58.0% | 47.4% / 57.4% | 49.6% / 58.9% | 51.3% / 59.2% |
| Deepseek-V3.2 | 46.9% / 65.2% | 47.0% / 63.6% | 47.6% / 65.2% | 47.7% / 65.2% | 47.1% / 65.5% | |
| Deepseek-V4-pro | 45.7% / 72.2% | 43.8% / 70.4% | 44.0% / 72.5% | 43.3% / 70.7% | 44.1% / 69.7% | |
| Kimi-K2.5 | 50.0% / 71.0% | 49.5% / 69.1% | 50.6% / 71.3% | 48.5% / 68.3% | 49.1% / 69.7% | |
| SWE-bench Verified | GPT-5.2 | 64.2% / 64.8% | 64.4% / 64.8% | 64.0% / 64.8% | 64.8% / 64.8% | 64.8% / 64.8% |
| Deepseek-V3.2 | 52.2% / 53.2% | 53.0% / 53.8% | 51.4% / 53.4% | 52.4% / 53.8% | 53.0% / 54.0% | |
| Deepseek-V4-pro | 58.4% / 60.8% | 58.6% / 61.2% | 57.0% / 59.6% | 58.8% / 60.4% | 58.4% / 61.2% | |
| Kimi-K2.5 | 48.6% / 48.8% | 48.6% / 50.6% | 48.0% / 48.6% | 48.8% / 49.0% | 48.6% / 48.6% | |
Table 4: Full routing ablation of OMCE on four backbones, OSR / CSR (%). Fixed- and Fixed- \alpha_{GUIDE}&DISTILL} always commit to one form of experience; OMCE-HEU selects actions with hand-crafted rules. The GPT-5.2 block is reproduced from Table 2 for reference.
we assume that is conditionally -sub-Gaussian, i.e.,
The main paper implements the Meta-Controller via Thompson Sampling on the same action-wise linear reward model. Concretely, for each action , define the posterior mean
and the posterior covariance proxy
where is a scale parameter. At round , Thompson Sampling draws
computes the sampled score
and selects the action
After observing the reward , the sufficient statistics of the selected action are updated according to the equations above.
For the regret analysis below, we consider an optimistic instantiation built on the same action-wise linear estimator, which yields a shorter and more standard finite-time proof.
Lemma E.1 (Uniform confidence ellipsoid for the action-wise linear reward models). For any , define
Then, with probability at least , the following event holds simultaneously for all and all :
Proof. Fix an action . Let denote the rounds at which action is selected, and let . Define
Then
By the self-normalized concentration inequality for linear bandits (Abbasi-Yadkori et al., 2011), with probability at least , simultaneously for all ,
Also,
(42)
hence
Therefore,
Since and ,
Moreover,
(46)
which implies
Combining the above inequalities yields
(48)
Finally, applying a union bound over all proves the lemma.
For the regret analysis, consider the optimistic instantiation
where
Let
and define the cumulative pseudo-regret
Theorem E.2 (Sublinear cumulative pseudo-regret of the optimistic Meta-Controller). Suppose . Then, with probability at least ,
where
In particular, since is fixed, .
Proof. Let denote the high-probability event in Lemma E.1. Fix a round t and define
By Lemma E.1, on , for every action a,
(56)
Hence
which implies
Again by Lemma E.1,
(59)
Summing over gives
By Cauchy-Schwarz,
It remains to control the quadratic sum. For each fixed action , whenever ,
By the matrix determinant lemma,
Taking logs and summing over all rounds with ,
Since and ,
Using for , we obtain
Summing over all ,
Finally, for each action a,
SO
Therefore,
which proves the theorem.
Remark. The main text uses Thompson Sampling in implementation. Theorem E.2 analyzes an optimistic instantiation built on the same action-wise linear reward estimator, in order to obtain a concise finite-time guarantee.
F Algorithm of OMCE
In this section, we present the pseudocode for the OMCE algorithm.
The optional multi-attempt extension uses at most total attempts for each query, including the initial attempt, and stops early upon success. After each failed attempt, an LLM extracts case-specific insights from the trajectory and feedback, records them in Episodic Memory, and injects them into the task prompt containing the original query using Augment to construct the next input. We denote the context for attempt by , with defined in Eq. 2. The loop below specifies how this within-task reuse interacts with memory refinement and controller learning.
Algorithm 1: Online Meta-Control of Experience (OMCE): Inference and Learning Loop
1: Input: Task query ; Episodic Memory ; Guidance Memory ; bandit statistics ; forgetting factor ; maximum number of attempts .
2: Output: Task trajectory .
3: Convention: includes the initial attempt (thus retries).
4: // Phase 1: Meta-Control (Retrieval & Action Selection)
5: Retrieve candidates \mathcal{M}_{\mathrm{retr}}_{\mathrm{epi}} and using lightweight retrieval on .
6: Construct meta-state from the retrieved candidates.
7: Estimate for each (Eq. 3).
8: if using Thompson Sampling then
9: Sample for each (Eq. 14).
10: Meta-Decision: (Eq. 15).
11: else if using LinUCB then
12: Meta-Decision:
.
13: end if
14: Initialize and .
15: // Phase 2: Inject Experience According to the Selected Action
16: if then
17: .
18: else if then
19: .
20: else if then
21: .
22: .
23: else if then
24: .
25: .
26: .
27: .
28: end if
29: for attempt do
30: // Phase 3: Agent Solves the Task
31: The agent generates .
32: Observe immediate reward .
33: // Phase 4: Record & Reflection-Conditioned Scaling
34: if indicates success then
35: Extract case-specific insights .
36: Form .
37: Record: .
38: break // Early stop upon success
39: else
40: Extract case-specific insights from the failed trajectory using an LLM.
41: Record: .
42: .
43: end if
44: end for
45: // Phase 5: Refine Injected Guidance
46: if then
47: for all do
48: Refine using an LLM (Eq. 6).
49: Update by replacing with .
50: end for
51: end if
52: Meta-Evolution: Update the bandit reward model's sufficient statistics:
53: , (Eq. 4).
.
G Details for Experimental Design
G.1 Task Setting.
Our experiments follow the online adaptation evaluation setting (Zhang et al., 2025a), where each method processes the test stream in a single sequential pass. For every incoming instance, the agent first produces its prediction using the current policy, memory, or context, observes the task feedback, and then updates the corresponding memory or controller state before moving to the next instance. To make the comparison controlled, all methods use the same task order on each benchmark, the same backbone LLM, and the same evaluation pipeline. Each method is evaluated in a single run over each benchmark–backbone configuration due to the cost of LLM API calls. Reported success rates aggregate outcomes across benchmark instances. For methods supporting retries, each instance allows up to four total attempts, including the initial attempt; these are within-instance retries rather than independent experimental runs. Methods that support multi-attempt inference use a shared budget of total attempts, following Section G.3, and OMCE may stop early once a task is solved.
G.2 Benchmarks.
Under this setting, we consider four complementary benchmarks spanning code generation, repository-level software engineering, realistic multi-turn conversation, and advanced general reasoning. English is the language used for all benchmarks.
Code generation and software engineering. Big-CodeBench (Zhuo et al., 2024) is a function-level code generation benchmark emphasizing complex instructions and diverse function or tool calls, with unit-test-based automatic evaluation to reflect practical programming behavior. SWE-bench Verified (Jimenez et al., 2023) is a human-validated subset of SWE-bench designed to assess whether agents can resolve real-world GitHub issues in repository-scale codebases.
Multi-turn conversation. MultiChallenge (Deshpande et al., 2025) measures whether a model can handle realistic, challenging user interactions over extended dialogue contexts, with particular emphasis on instruction-following, context allocation, and in-context reasoning. We use GPT-4o-mini (OpenAI, 2024) as the judge model, to judge whether the answer meets the hidden task requirement. Advanced general reasoning. BIG-Bench Extra
Hard (BBEH) (Kazemi et al., 2025) is a substantially more challenging successor to BIG-Bench Hard (BBH) (Srivastava et al., 2023; Suzgun et al., 2023), covering a broad range of general reasoning skills. We use a shuffled 6-task subset comprising 1,200 instances: causal_understanding (Nie et al., 2024; Kiciman et al., 2023), dyck_languages (Tyen et al., 2023), temporal_sequence, web_of_lies (White et al., 2024), word_sorting (Tyen et al., 2023), and zebra_puzzles (Shah et al., 2024). These instances are mixed and randomly shuffled to construct the evaluation stream.
G.3 Evaluation Metrics
We adopt one-shot success rate (OSR) as the primary evaluation metric, defined as the fraction of test instances solved correctly on the first attempt during online adaptation. This metric directly measures the agent's immediate response quality under its current policy and accumulated experience. When multiple attempts are allowed, we additionally report cumulative success rate (CSR), defined as the fraction of instances solved within a maximum budget of P = 4 total attempts, including the initial attempt. This corresponds to at most three retries after the initial attempt. For methods without multi-attempt inference, the unavailable metric is marked as “-” in the result tables. Since Reflexion (Shinn et al., 2023) improves later attempts through within-instance self-reflection rather than cross-task experience transfer, we report it under CSR in the main comparison.
To measure inference efficiency, we report tokens per task, the average total LLM tokens consumed per instance. This count includes all LLM calls made throughout the full online adaptation pipeline for a task, rather than only the final task-solving call; in particular, it includes token usage from auxiliary stages such as memory update and other adaptation-related inference, as well as additional token consumption introduced by test-time scaling in baselines that use it. The average is computed by dividing the total token consumption by the total number of tasks. Token accounting includes the cost of solving tasks and the cost of extracting and refining experiences, but excludes evaluator or judge-model calls.
G.4 Baselines and Methods
For baselines and compared methods, we include a Base LLM and four representative test-time improvement approaches that enhance performance without parameter updates. These baselines separate test-time scaling alone, cross-task experience transfer alone, and methods that combine cross-task adaptation with multi-attempt inference.
Base LLM. Base LLM is evaluated on each benchmark without any external memory, i.e., the model is queried with the benchmark's default prompt template (as provided by the dataset authors) and produces an answer directly.
Reflexion (Shinn et al., 2023). Reflexion instantiated test-time scaling through within-instance self-reflection over repeated attempts. After an attempt, the agent converts task feedback into a natural-language self-reflection and conditions subsequent attempts on these reflections. In our comparison, Reflexion does not transfer experience across different test instances.
MemP (Fang et al., 2025b). MemP transfers experience across tasks but makes only a single attempt per instance. It therefore represents cross-task experience transfer without multi-attempt inference.
ACE (Zhang et al., 2025a). ACE treats prompts/-contexts as evolving playbooks and improves them through a modular generate-reflect-curate loop with structured, incremental updates designed to prevent context degradation across iterations; ACE supports both offline prompt optimization and online adaptation via memory/context updates driven by execution feedback.
ReasoningBank (Ouyang et al., 2025). We evaluate ReasoningBank in its sequential MaTTS setting, where the method combines cross-task adaptation with multi-attempt inference.
OMCE (ours). OMCE combines memory evolution with online meta-evolution. OMCE-TS uses Thompson Sampling (Agrawal and Goyal, 2013), while OMCE-UCB uses an optimistic LinUCB-style rule (Chu et al., 2011; Abbasi-Yadkori et al., 2011). Appendix B gives the formal specifications, and Appendix E analyzes the optimistic variant.
Controller and retrieval configuration. The shared configuration used by both variants is listed in Table 5. The retrieval count, state dimension, forgetting factor, regularization parameter, and exploration parameters were kept fixed across all benchmarks and backbone models.
We selected the shared configuration once using a randomly sampled subset of 100 tasks from the 1,140-task BigCodeBench stream. The configuration was then fixed for the complete BigCodeBench stream and for all other benchmarks and back-
| Quantity | Value |
|---|---|
| Retrieval count M | 3 |
| Meta-state dimension d | 9 |
| Forgetting factor γ | 0.98 |
| Ridge regularization λ | 0.5 |
| LinUCB coefficient α | 3.0 |
| TS posterior scale v² | 0.25 |
| Maximum total attempts P | 4 |
| Retries after the initial attempt | 3 |
Table 5: Shared controller and retrieval configuration used by OMCE-TS and OMCE-UCB.
bone models. No additional hyperparameter tuning was performed on SWE-bench Verified, MultiChallenge, BBEH, or individual backbone models. The 100 selected BigCodeBench tasks remain part of the final evaluation stream, so the BigCodeBench result contains a limited overlap between hyperparameter selection and evaluation.
The four evaluation streams contain 1,140, 500, 273, and 1,200 instances for BigCodeBench, SWE-bench Verified, MultiChallenge, and BBEH, respectively. All methods use the same task order, backbone model, and evaluation pipeline for a given benchmark.
We use the same backbone LLM for task execution and for insight extraction, the DISTILL action, and guidance refinement in memory evolution.
Common Implementation Details. Across all evaluated methods, we enforce a consistent online adaptation setting where any memory, playbook, or experience library is initialized as empty at the beginning of the evaluation. For all retrieval operations, we measure the cosine similarity between the queries and memory entries, utilizing text-embedding-3-large (OpenAI, 2024) to encode the text representations.
Benchmark implementations. We integrate the benchmark Python packages into a common evaluation framework. The public implementations are available in the repositories for BigCodeBench,¹ SWE-bench,² MultiChallenge,³ and BBEH.⁴ We evaluate on the original 273-instance MultiChal-
lenge dataset and the six-task BBEH subset described above, which contains 1,200 instances. For MultiChallenge, GPT-4o-mini serves as the judge model. All compared methods share the same benchmark data and evaluation pipeline.
H Detailed Efficiency Results
Figure 5 reports tokens per task, as defined in Section G.3, across four backbone LLMs (GPT-5.2, Deepseek-V3.2, Deepseek-V4-pro, and Kimi-K2.5) on four benchmarks. Lower values indicate better inference efficiency.
The figure reveals a clear and consistent pattern across all four backbone models. Base LLM and MemP are the most token-efficient methods because they eschew test-time scaling, and therefore add limited overhead beyond direct inference. ReasoningBank and OMCE incur a moderate additional token budget due to retrieval, reflection, and structured online adaptation, but remain far more efficient than large-context prompting.
By contrast, ACE is dramatically less efficient: relative to OMCE, it requires about 62.5× more tokens per task on BigCodeBench, 32.5× more on SWE-bench Verified, 5.7× more on MultiChallenge, and 21.8× more on BBEH. This inefficiency is consistent with ACE’s strategy of unconditionally injecting the entire playbook into the prompt, which substantially inflates the context length as adaptation proceeds.
Taken together with Figure 3, these results place OMCE between the two extremes on every benchmark and backbone: more accurate than the token-cheap baselines, and far cheaper than ACE.
I Case Study on SWE-bench Verified
This section provides a qualitative analysis of OMCE’s behavior on the SWE-bench Verified dataset. Through three representative examples, we demonstrate how the Meta-Controller dynamically selects the optimal cognitive action—DIRECT, EPISODE, GUIDE, or DISTILL—to avoid harmful memory and improve the success rate of the underlying LLM.
Avoiding Harmful Experience (django-16560). In this task, the objective is to add a violation_error_code parameter to Django’s BaseConstraint. When forced to use guidance entries, the model is misled by irrelevant rules (e.g., "Wrong-Layer Patch Trap") and applies patches to the wrong abstraction layer, resulting
¹https://github.com/bigcode-project/bigcodebench ²https://github.com/SWE-bench/SWE-bench ³https://github.com/ekwinox117/multi-challenge ⁴https://github.com/google-deepmind/bbeh

(a) GPT-5.2

(b) Deepseek-V3.2

(c) Deepseek-V4-pro

(d) Kimi-K2.5
Figure 5: Performance-efficiency trade-off on four benchmarks using GPT-5.2, Deepseek-V3.2, Deepseek-V4-pro, and Kimi-K2.5 as backbone LLMs. The x-axis shows one-shot success rate, and the y-axis shows token cost (log scale), defined as the average total number of prompt and output tokens consumed per task.
| Pattern & Action | Task Context | Baseline / Wrong Memory | OMCE Behavior & Outcome |
|---|---|---|---|
| Memory Harmful | ID: django-16560Objective: Add violation_error_code to BaseConstraint.Challenge: Prone to wrong-layer patch trap. | : Misled by irrelevant guidance entries, applying patches to the wrong abstraction layer.✗ Failure | Reasoning: Accurately identifies low relevance (confidence 1.0) and avoids hallucinated guidance entries.✓ Success |
| Type Selection | ID: django-13401Objective: Ensure abstract model fields do not compare as equal across different models.Challenge: Requires adjusting __eq__, __hash__, and __lt__ to consider field.model instead of just creation_counter. | : Fails to generalize from specific past case-specific insights, leading to incomplete or incorrect equality logic.✗ Failure | Reasoning: Recognizes that high-level guidance entries provides better architectural instruction for core equality semantics than case-specific insights.✓ Success |
| DISTILL | ID: django-13809Objective: Add -skip-checks option to the runserver command.Challenge: Requires correctly wiring the new option through the command's argument parser and execution flow. | : Fails to identify the correct modification layer and misses necessary execution flow updates.✗ Failure | Reasoning: Finds highly similar case-specific insights but no directly applicable guidance entries; distills new guidance entries to identify the correct modification layer.✓ Success |
Table 6: Qualitative case studies demonstrating the Meta-Controller's dynamic action selection on SWE-bench Verified.
in failure. However, the Meta-Controller accurately calculates low retrieval scores for both episodic records and guidance entries, confidently selecting DIRECT () (confidence 1.0). By proceeding without hallucinated guidance, OMCE successfully solves the task, demonstrating its ability to protect the model from harmful or irrelevant memory.
Selecting the Right Experience Type (django-13401). This task requires modifying the equality semantics of abstract model fields so they do not compare as equal across different models. This is a highly sensitive task where EPISODE fails because specific past cases do not generalize well to core equality logic. Conversely, GUIDE succeeds. The Meta-Controller successfully identifies this distinction, routing the task to . This highlights the critical importance of selecting the appropriate experience type for tasks that require architectural guidance rather than specific implementation details.
DISTILL (django-13809). The goal of this task is to add a -skip-checks option to the runserver command. The baseline model without experience fails to correctly wire the option through the execution flow. The Meta-Controller observes that while there are highly similar episodic records available, there are no directly applicable guidance entries.
Consequently, it selects DISTILL () to create a new guidance entry from the retrieved episodic records. The newly distilled guidance entry correctly instructs the model on the appropriate modification layer, leading to a successful resolution. This showcases OMCE's capability to dynamically generate new guidance entries when existing experience is insufficient.
J Broader Impact
This work introduces Online Meta-Control of Experience (OMCE), a framework designed to improve the efficiency and reliability of self-evolving LLM agents. The ability to selectively ignore misleading or redundant past experiences helps mitigate the propagation of errors in memory-enhanced agent systems. This contributes to the development of more robust AI assistants. However, like all frameworks that enhance the autonomy and efficiency of AI agents, OMCE could potentially be repurposed for malicious activities. While OMCE offers a pathway toward more intelligent and resource-efficient agents, its deployment should be accompanied by continuous monitoring and safety protocols to ensure that its evolutionary capabilities remain aligned with ethical standards and human values.