InfoMem: Training Long-Context Memory Agents with Answer-Conditioned Information Gain
About
Long-context tasks require LLMs to identify and preserve answer-relevant information from large contexts. Chunk-wise memory agents address this issue by sequentially reading document chunks, updating a compact memory, and generating the final answer from the accumulated memory. However, existing RL-based chunk-wise agents either rely on sparse final-answer rewards or use lexical intermediate rewards for memory and retrieval actions. These signals supervise task success or local overlap, but do not directly evaluate whether the final memory supports the ground-truth answer. We propose InfoMem, a reward mechanism for training chunk-wise memory agents that evaluates final-memory utility using answer-conditioned information. InfoMem measures how much the final memory increases the model's per-token log-likelihood of the ground-truth answer. To stabilize RL optimization, InfoMem applies this signal only to successful trajectories and normalizes it before reward composition. Under the same GRPO framework and training budget, InfoMem improves long-context memory-agent performance over comparable memory-agent RL baselines. Analyses show that effective final-memory rewards should operate on successful trajectories, be normalized before reward composition, and be conditioned on the answer rather than the query. Our code is available at https://github.com/GenSouKa1/InfoMem.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Corpus-level evidence aggregation | CorpusQA 128K-token | LLM-as-Judge Accuracy19.453 | 4 | |
| Long-horizon dialogue memory and conversational information tracking | LongMemEval 115K-token S | LLM-as-Judge Accuracy12.8 | 4 | |
| Multi-needle retrieval | MRCR-8needle 100-example | Sequence Match Accuracy27.9 | 4 | |
| Sparse retrieval-style question answering | RULER synthetic QA (standard) | F1 Score0.3685 | 4 |