Look Back to Reason Forward:

Revisitable Memory for Long-Context LLM Agents

Yaorui Shi1*, Yuxin Chen2*, Siyuan Wang3, Sihang Li1, Hengxing Cai4, Qi Gu5, Xiang Wang1†, An Zhang1†
1University of Science and Technology of China 2National University of Singapore
3Shanghai Jiao Tong University 4DP Technology 5Meituan
*Equal Contribution Correspondence

Abstract

Large language models face challenges in long-context question answering, where key evidence of a query may be dispersed across millions of tokens. Existing works equip large language models with a memory buffer that is dynamically updated via a linear document scan, also known as the "memorize while reading" methods. While this approach scales efficiently, it suffers from pruning of latent evidence, information loss through overwriting, and sparse reinforcement learning signals. To tackle these challenges, we present ReMemR1, which integrates the mechanism of memory retrieval into the memory update process, enabling the agent to selectively callback historical memories for non-linear reasoning. To further strengthen training, we propose a multi-level reward design, which combines final-answer rewards with dense, step-level signals that guide effective memory use. Together, these contributions mitigate information degradation, improve supervision, and support complex multi-hop reasoning. Extensive experiments demonstrate that ReMemR1 significantly outperforms state-of-the-art baselines on long-context question answering while incurring negligible computational overhead.


Conceptual Example

Motivation

Teaser

Current memory-augmented approaches for long-context QA face key limitations:

  • Progressive information loss: "Memorize while reading" paradigms perform a single linear scan over the document, progressively overwriting memory. This causes important evidence to be pruned, especially when key information is scattered far apart in the context.
  • Sparse RL signals: Existing RL-based methods rely solely on outcome-level rewards (final-answer correctness), which provide sparse and delayed feedback. This makes it difficult for the model to learn effective memory update and retrieval strategies at each step.

ReMemR1 addresses both challenges with: (1) a callback mechanism that enables non-linear memory revisiting over past details, and (2) a multi-level reward design combining outcome rewards with dense step-level supervision.

Method

Memory Update with Callback

Framework

Unlike conventional memory agents that use a restrictive state where each memory update only depends on the current context and previous memory, ReMemR1 augments the state representation with a callback query. At each time step, the agent:

  • Updates memory: Generates a new memory state by integrating the current document chunk with the previous memory.
  • Generates callback query: Produces a query to retrieve relevant information from the full memory history.
  • Retrieves and integrates: Uses the callback query to fetch past memories, enabling non-linear access to previously processed information.
This mechanism enables the agent to selectively revisit historical memories, preventing information loss from linear overwriting.

History-Augmented State Transition

State Transition

(Left) Conventional memory agents use a restrictive state st = mt, where the next memory only depends on the current context and memory. (Right) Our method represents states as st = (mt, qt), where the agent generates a callback query to retrieve relevant information from its entire memory history, enabling non-linear reasoning paths.

Multi-Level Reward Design

Multi-Level Reward

ReMemR1 employs a multi-level reward design that combines:

  • Outcome rewards: Measure the correctness of the final answer at terminal states.
  • State rewards: Provide dense, step-level signals that guide effective memory use at each intermediate step.
Each reward type is normalized at the corresponding level: state rewards across all states at the same step, and outcome rewards across all trajectories in the group. This design alleviates the sparse supervision problem while maintaining alignment with the ultimate objective.

Experimental Results

Main Results

ReMemR1 was evaluated on long-context QA benchmarks with context lengths ranging from 100 to 6400 documents, using HotpotQA (in-distribution) and 2WikiMultiHopQA (out-of-distribution):

Accuracy on HotpotQA (In-Distribution)

ScaleMethod Avg100200400800160032006400
3BMemAgent60.970.369.468.860.960.259.458.8
ReMemR1 (Ours)63.870.971.774.065.465.065.466.1
7B+R1-Distill-7B10.240.625.80.81.62.31.53.1
Qwen2.5-1M-7B54.775.871.968.067.269.522.70.0
QwenLong-L1-32B57.883.685.274.273.457.838.938.3
MemAgent-7B74.081.878.978.977.079.772.175.8
ReMemR1-7B (Ours)81.182.382.878.982.079.780.080.8

Accuracy on 2WikiMultiHopQA (Out-of-Distribution)

ScaleMethod Avg100200400800160032006400
3BMemAgent40.241.445.339.436.328.926.725.9
ReMemR1 (Ours)42.553.550.441.737.036.235.437.8
7B+R1-Distill-7B25.836.729.70.00.82.32.30.8
Qwen2.5-1M-7B45.362.559.457.847.746.125.80.0
QwenLong-L1-32B45.374.269.565.658.638.324.629.9
MemAgent-7B50.861.757.847.650.744.546.944.7
ReMemR1-7B (Ours)55.663.963.154.554.745.448.950.3

Key findings:

  • ReMemR1 consistently outperforms all baselines across both benchmarks and all context lengths.
  • The advantage grows with context length: At 6400 documents, ReMemR1-7B achieves 80.8% on HotpotQA vs. 75.8% for MemAgent, and 50.3% vs. 44.7% on 2WikiMultiHopQA.
  • Strong generalization: Trained only on HotpotQA, ReMemR1 still achieves the best results on the out-of-distribution 2WikiMultiHopQA.

Distant Evidence Challenge

Distant Evidence

When key evidence pieces are placed far apart in the document, ReMemR1's callback mechanism proves especially effective. The accuracy gap between ReMemR1 and baselines widens as the evidence distance increases, demonstrating its robustness to scattered information.

Computational Efficiency

Efficiency

ReMemR1 consistently achieves higher accuracy with only modest additional computation. The callback retrieval module introduces less than 0.1% additional time and negligible memory overhead (<0.001% of total memory), making it highly practical for real-world long-context scenarios.

Ablation Studies


  • The multi-level reward design with α=0.8 consistently delivers the best accuracy, balancing outcome rewards with dense step-level guidance.
  • RL-driven callback significantly outperforms rule-based callback, confirming that learning when and what to recall through RL is essential.

Training Dynamics

Training dynamics: ReMemR1 quickly learns the callback format requirements under RL guidance, with performance rapidly improving during the first 20 steps.

Acknowledgements

This project is built upon the foundational work of VeRL and MemAgent. We sincerely thank the authors of these projects for their valuable contributions, which have significantly supported and inspired our work.

Citation

@article{rememr1,
  author       = {Yaorui Shi and
                  Yuxin Chen and
                  Siyuan Wang and
                  Sihang Li and
                  Hengxing Cai and
                  Qi Gu and
                  Xiang Wang and
                  An Zhang},
  title        = {Look Back to Reason Forward: Revisitable Memory for Long-Context {LLM}
                  Agents},
  journal      = {CoRR},
  volume       = {abs/2509.23040},
  year         = {2025},
  eprinttype    = {arXiv},
  eprint       = {2509.23040},
}