InfoMem: Training Long-Context Memory Agents with Answer-Conditioned Information Gain

Tiancheng Han, Yong Li, Wuzhou Yu, Qiaosheng Zhang, Wenqi Shao
6/2/2026
2 citations
cs.AI
rl

Official code: GenSouKa1/InfoMem (2 stars, Python, Apache-2.0, last commit 2026-06-26).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

GenSouKa1/InfoMemOfficial100%
Apache-2.0

InfoMem: Training Long-Context Memory Agents with Answer-Conditioned Information Gain

20Python, ShellJun 2, 20265 months agoApache-2.0

Similar Papers

Cite this paper

@article{han2026infomem,
  title  = {InfoMem: Training Long-Context Memory Agents with Answer-Conditioned Information Gain},
  author = {Tiancheng Han and Yong Li and Wuzhou Yu and Qiaosheng Zhang and Wenqi Shao},
  year   = {2026},
  eprint = {2606.03329},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.03329v1}
}

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/2606.03329.svg)](https://codeofpaper.com/paper/2606.03329)

Discussion