Manuscript Offprint

arXiv:2611.09472

ENGRAM: From Agent Experience to Weights through Verified Consolidation

Ruiyi Yang, Zechen Li, Lihuan Li, Du Yin, Hao Xue, Flora D. Salim

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

ABSTRACT

Language-model agents use experience through external retrieval and parameter learning. Consolidating stored experience into model weights requires deciding both which experience to train on and when its external records can leave retrieval. Admission based solely on student mastery can exclude useful teacher demonstrations, while removal immediately after training can discard guidance that the model still needs. We introduce ENGRAM, a framework that separates training admission from memory release. A demonstration-aware gate admits skills based on student mastery or sufficient successful teacher demonstrations. The student learns from selected action traces with context from an Engram Trace Graph (ETG). A verification gate then compares the updated model without episodic retrieval against the base model with retrieval on reserved probes. Release requires valid training participation and scores meeting both relative and absolute criteria; records for skills that fail verification remain retrievable. Experiments across interactive and reasoning benchmarks show consistent gains over frozen-weight ETG controls, with ablations supporting demonstration-aware admission and selective adapter activation. A controlled held-out comparison shows that verified release substantially reduces the retrievable footprint while remaining close to retain-all performance and outperforming immediate and budget-matched random release. ENGRAM also improves task performance while reducing input-token usage and model calls. Skill-level verification further reduces retrievable experience through selective archival, retaining external guidance for skills that do not meet the release criteria. Code is available in anonymous.4open.science/r/engram-anonymous.

1 INTRODUCTION

Language-model agents use past experience through external retrieval and parameter updates. Retrieval keeps trajectories and feedback available for future tasks, while parameter learning can make their lessons usable without consulting the original records. Combining these mechanisms raises a practical question: when has an agent learned enough from stored experience to remove the corresponding records from its retrieval memory? Retaining every record incurs storage and retrieval costs, but premature removal can discard guidance that the model still needs.

Existing methods illustrate both approaches. Reflexion stores verbal feedback, Voyager accumulates executable skills, and MAGE organizes successful and failed experiences in a co-evolving graph (Shinn et al., 2023; Wang et al., 2023; Yang et al., 2026). Self-training methods such as STaR and ReST⁵M instead update model parameters using selected generated solutions (Zelikman et al., 2022; Singh et al., 2023). An agent combining retrieval and training must distinguish useful learning material from records that are no longer needed after learning.

First, useful training experience may precede student mastery. A student can fail at prerequisite actions before reaching a more advanced skill. A stronger teacher can demonstrate that skill, but a mastery-only admission rule would still exclude it from training. Admission should therefore consider available demonstrations alongside current competence.

Figure

Figure 1: Readiness to learn differs from readiness to release. Removing both traces after training can leave skill B unsupported if only A has been learned. ENGRAM verifies each skill: A uses verified weights and releases eligible records, while B retains external memory. Configured residuals remain; colored nodes represent behavior.

Second, completing training does not establish that memory can be removed. A selected skill may contribute no valid training examples, or the updated model may still depend on retrieved guidance. Premature removal creates knowledge waste: external experience becomes unavailable before the weights can replace it. This can happen immediately after consolidation, independently of interference from later updates.

Verifying this transfer requires comparing the updated model without episodic retrieval against a retrieval-supported reference under the same task interface. Otherwise, retrieved demonstrations or differences in prompt format can obscure what the weights have learned. Action probes provide local evidence; complete rollouts and subsequent updates assess task performance and retention.

We introduce ENGRAM, a framework that separates training admission from memory release for each skill. The Engram Trace Graph (ETG) organizes experience by skill, outcome, and source. A demonstration-aware gate admits skills with sufficient student mastery or successful teacher demonstrations. Periodic consolidation trains a low-rank adapter on valid action traces with ETG context, incorporating replay when enabled. A verification gate compares the candidate without episodic retrieval against the base model with retrieval on reserved probes. Release requires valid training participation and scores meeting both a relative threshold and an absolute floor. Approved skills use verified weights without episodic retrieval; other skills retain external guidance, optionally with a separately approved adapter. Inspired by complementary learning systems (McClelland et al., 1995), this process connects experience acquisition with parameter learning and selective memory release. Experiments across interactive and reasoning benchmarks show ENGRAM outperforms most of baselines on multiple benchmarks. Ablations support the contributions of demonstration-aware admission and adapter activation, while showing that external guidance remains useful after training. A separate analysis illustrates how skill-level verification reduces retrievable experience through selective archival. Specifically, our contributions are:

  1. Demonstration-aware training admission. A per-skill rule admits useful teacher demonstrations independently of current student mastery, expanding the experience available for parameter learning.

  2. Verification before memory release. A separate gate requires training participation and behavioral evidence from reserved probes before removing records from retrieval.

  3. Performance and efficiency gains. Benchmark evaluations and ablations demonstrate improved task performance, while serving measurements show reduced token usage and model calls in sequential interaction and lower latency in QA relative to Base+ETG. Skill-level analysis additionally demonstrates selective reduction of retrievable experience.

References (68)