Learning What to Remember: Long-horizon Counterfactual Memory Optimization

Jiaming Tang, Mingyan Liu, Armin Sarabi
9/29/2026
cs.CLcs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Persistent textual memory allows language models to carry information across long interactions, but learning what to remember is fundamentally a credit-assignment problem. A memory rewrite may only become useful many steps later, while much of the observed utility may be inherited from information already stored before the rewrite. We introduce Memory Gain Policy Optimization (MGPO), which isolates the incremental value of each memory rewrite by crediting it for its marginal contribution to current and future downstream utility. This turns delayed memory utility into a direct learning signal for optimizing what information should persist. We study MGPO on document-level information extraction, where structured supervision makes the effects of individual memory updates directly measurable. MGPO improves extraction while reducing average memory length by nearly 80% relative to the initial memory policy before optimization. The learned memory policy also supports reuse and transfer across domains, downstream models without further training. These results show that effective memory learning depends not only on preserving useful information, but on identifying which memory updates create lasting incremental value.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{tang2026learning,
  title  = {Learning What to Remember: Long-horizon Counterfactual Memory Optimization},
  author = {Jiaming Tang and Mingyan Liu and Armin Sarabi},
  year   = {2026},
  eprint = {2609.37930},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.37930v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.37930.svg)](https://codeofpaper.com/paper/2609.37930)

Discussion