EvoMemory: Learning Future Utility for Bounded Memory Replacement

Min Zeng, Duzhen Zhang, Zaifu Zhan, Kai Yu, Rui ZhangOpenReview 2027 · Submission to ICLR 2027 · Withdrawn

TL;DR

EvoMemory is a novel framework that teaches Large Language Models (LLMs) how to manage limited external memory by predicting the "future utility" of information. By training on counterfactual scenarios—simulating how different memory updates would affect performance on future tasks—it learns a replacement policy that significantly outperforms standard heuristics like FIFO or similarity-based eviction.

What Problem Does This Paper Address?

As LLMs are deployed in long-running applications like personal assistants or autonomous agents, they need to remember information across thousands of interactions. Since an LLM's internal "context window" is limited, researchers use external memory banks to store past data.

However, these memory banks also have a fixed capacity. When the bank is full and new information arrives, the system must decide: what should be kept, and what should be replaced? Most current systems rely on "myopic" (short-sighted) rules, such as deleting the oldest item (FIFO) or the one most similar to the new input. These rules fail to consider the "big picture"—how a specific change to the memory bank might help or hurt the model's performance on future, unseen queries.

Methods

EvoMemory formulates memory replacement as a sequential decision problem. The core idea is to "learn from the future" during training to make better decisions "in the moment" during deployment.

  1. Offline Training (Counterfactual Evaluation): For every new memory that arrives during training, EvoMemory considers $K+1$ possible actions: keeping the current bank as-is, or replacing any one of the $K$ existing items. It then evaluates all these "counterfactual" successor states by testing them on the next $H$ interactions in the data stream.
  2. Contextual Value Model: Using the results from these evaluations, it trains a model (a RoBERTa-based encoder followed by a Transformer) to predict the "utility gain" of each action. Crucially, this model is contextual: it looks at the entire state of the memory bank, not just individual items in isolation.
  3. Online Deployment: Once trained, the value model can score replacement candidates in real-time. It selects the best replacement only if the predicted benefit exceeds a specific "update margin" ($\delta$), ensuring the system doesn't churn memory for negligible gains.
Figure 1: Overview of EVOMEMORY. Offline training: for each memory-management decision, EvoMemory constructs the K + 1 candidate successor memory states and evaluates them on future examples to obtain counterfactual utility supervision for learning a contextual value model. Online deployment: given the current memory bank and an incoming memory, the learned value model scores the same candidate updates using only information available at decision time; a margin-based policy then either preserves the current bank or applies the highest-valued replacement. Future examples are used only during offline supervision and are never available to the deployed policy.

Datasets

The researchers evaluated EvoMemory on two distinct benchmarks:

  • JRE-L (from MemoryBench): A dataset of historical interactions converted into abstract memories, representing a long-term conversational stream.
  • WikiLarge: A stream of sentence-simplification tasks where the model must remember specific simplification principles to maintain consistency.

Key Insights and Ideas

  • Context Matters: A memory's value isn't intrinsic; it depends on what else is in the bank. EvoMemory's ability to value the complete successor state is what gives it an edge over "item-level" utility models that score memories independently.
  • Non-Myopic Supervision is Essential: The authors found that training with a lookahead of only one step ($H=1$) actually performed worse than simple "KEEP" strategies. To truly understand information value, the model needs to see the consequences over a longer future horizon (e.g., $H=10$).
  • Quality Over Quantity: EvoMemory is highly selective. On the WikiLarge benchmark, it only chose to update the memory bank in about 7% of cases. Its performance gains come from making a few high-impact, beneficial replacements rather than constant updates.

Key Results

EvoMemory consistently outperformed all baselines, including FIFO, semantic similarity, and LLM-based importance scoring.

  • JRE-L: Achieved a held-out utility of 0.4719, compared to 0.4590 for the strongest deterministic heuristic. It reduced "oracle regret" (the gap between the chosen action and the perfect action) by over 31%.
  • WikiLarge: Reached a reward of 0.8152, significantly higher than the 0.7887 achieved by simply retaining the initial memory bank.
  • Efficiency: While offline training is computationally intensive, the online deployment is lightweight. It requires only ~25ms per decision on a GPU, making it much faster than using a large LLM to judge memory importance at runtime.
Table showing online performance metrics where EvoMemory achieves the highest action accuracy and lowest regret across both benchmarks.

Limitations and Future Work

  • Offline Cost: Generating the counterfactual labels for training requires many LLM evaluations, which is expensive and time-consuming.
  • Fixed Scope: The current study focuses on fixed-size banks and single-item replacement. The authors suggest that future work could extend this to dynamic memory structures or more complex operations like "consolidating" or "summarizing" multiple memories into one.
  • Frozen Target: The experiments used a frozen target LLM (Qwen3-8B). Exploring how memory management should adapt as the underlying model itself is fine-tuned is an open question.

Summary updated

Abstract

Large language models (LLMs) increasingly rely on long-term memory to support interactions that extend beyond a fixed context window. Yet memory capacity is inherently limited: as new experiences continually arrive, a system must decide not only what to store, but also what to retain, replace, or discard. Existing memory systems often rely on local signals such as recency, similarity, or standalone importance, which do not directly capture how a memory update will affect future task performance. We introduce **EvoMemory**, a framework that learns bounded memory replacement based on future utility. We formulate replacement as a sequential decision problem in which each incoming memory induces alternative successor memory states. During training, EvoMemory evaluates these counterfactual states on future examples to construct utility supervision and learns a contextual value model to score their downstream utility. At deployment time, the learned policy updates memory using only the current bank and incoming memory, without access to future examples. We evaluate EvoMemory on two complementary benchmarks, JRE-L and WikiLarge, against heuristic and random memory-management strategies. On JRE-L, EvoMemory achieves a held-out utility of 0.4719, compared with 0.4599 for five-seed random replacement and 0.4590 for the strongest deterministic heuristic. On WikiLarge, EvoMemory achieves a held-out utility of 0.8152, compared with 0.7887 for retaining the initial memory bank and 0.7726 for five-seed random replacement. Across both benchmarks, paired tests on held-out examples confirm significant improvements over all evaluated baselines after multiple-comparison correction. These results support future-utility learning as an effective principle for bounded memory replacement, where useful updates depend on their consequences for the resulting memory state.
BibTeX
@misc{zeng2027evomemory,
  author = {Min Zeng and Duzhen Zhang and Zaifu Zhan and Kai Yu and Rui Zhang},
  title = {{EvoMemory: Learning Future Utility for Bounded Memory Replacement}},
  year = {2027},
  url = {https://openreview.net/forum?id=8qWPL4c4mg},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2027},
}

Loading related content...

Figure