Organizations: State Key Laboratory of Human-Machine Hybrid Augmented Intelligence, Institute of Artificial Intelligence and Robotics, Xi’an Jiaotong University · Faculty of Electronic and Information Engineering, Xi’an Jiaotong University · Imperial College London
Reasoning over infinitely long documents is becoming a reality with recurrent memory agents. However, increasing context length exacerbates the trade-off between reasoning performance and inference efficiency. Inspired by Kahneman's account of fast and slow thinking, we propose MemDuet, a dual-process memory framework that learns to coordinate a small language model for fast, parallel evidence selection from raw context chunks (System 1) with a large language model for memory-update verification and memory updates in document order (System 2). We train MemDuet in three stages: supervised fine-tuning of System 1 for evidence selection, Group Relative Policy Optimization (GRPO) of System 2 for verification and memory rewriting, and joint optimization of both policies to coordinate selection and updating for long-context reasoning. Experiments on diverse long-context reasoning benchmarks (RULER-HQA, LongBench v2, and 2WikiMultiHopQA) demonstrate a favorable accuracy-efficiency trade-off as context length grows. Averaged across evaluation settings on the three datasets, MemDuet achieves an end-to-end inference speedup of 9.74x and an output-token reduction of 73.91% relative to RL-MemAgent.
Figures & tables
Figure 1: Accuracy–efficiency trade-off on RULER-HQA. Accuracy, inference time, and output tokens are equally averaged over the nine shared length settings (7K–1.75M). Qwen and DS-Distill use the available settings. Circle areas use a square-root-compressed scale for mean output tokens per question; circle labels give actual output-token ratios to MemDuet (1 × ).
Figure 2: MemDuet’s overall inference workflow. System 1 predicts Skip / Update in parallel for raw chunks under a shared memory state. Candidate chunks retain their original text. System 2 verifies whether a selected chunk warrants a memory update given the current memory, then generates and commits memory from the first accepted chunk in document order. Later chunks are reevaluated under the updated memory.
Figure 3: Three-stage training of MemDuet. Stage I trains System 1 with weighted classification and a paired-memory hinge loss. Stage II freezes System 1 and optimizes System 2 with GRPO. Stage III jointly optimizes both systems using task rewards.
Method
7K
14K
28K
56K
112K
224K
448K
896K
1.75M
3.5M
Accuracy (%, ↑ )
Search-R1 7B
72.66
71.88
67.71
73.96
66.67
62.50
64.58
67.71
67.19
—
QwenLong-L1 32B
72.66
75.00
72.66
60.94
31.25
17.19
13.28
11.72
N/A
N/A
DS-Distill 32B
70.31
66.41
65.62
46.88
23.44
13.28
7.81
7.03
N/A
N/A
RL-MemAgent 7B
81.25
81.25
82.03
80.47
79.69
75.78
76.56
74.22
77.34
71.88
LycheeMemory ( −G ) 7B
80.47
81.25
82.03
81.25
80.47
79.69
75.00
75.78
78.12
—
Table 1: Accuracy and inference efficiency on RULER-HQA across context lengths from 7K to 3.5M tokens. Relative to RL-MemAgent, speedup ( ↑ ) is Tbase/Tmethod , and the output-token ratio ( ↓ ) is Omethod/Obase , where T and O denote inference time and generated-token count, respectively. LycheeMemory ( −G / +G ) disables/enables its native memory gate. ∗ denotes results from our reproduction. Bold and underlined values indicate the best and second-best reported results at each length within each metric block. “N/A” denotes unavailable results; “-” denotes results not reported in the original paper.
Figure 4: Efficiency scaling on RULER-HQA from 7K to 3.5M tokens. The upper and lower panels report latency and total output tokens from both systems per example, respectively, on logarithmic axes.
LongBench v2
Metric
Method
Short
Medium
Long
Ultra
MemAgent
33.62
31.91
25.00
28.28
LycheeMemory ( −G )
25.86
31.91
29.00
28.28
Option Acc. ↑
MemDuet
31.03
31.38
30.00
29.29
LycheeMemory ( −G )
0.45×
0.54×
0.55×
0.59×
Speedup ↑
MemDuet
1.69×
1.96×
3.00×
8.03×
Table 2: LongBench v2 (top; option accuracy, %) and long-context 2WikiMultihopQA (bottom; sub-EM, %) results. LycheeMemory uses no gate ( −G ); bold marks the best values per length and metric.
Framework
Acc. (%) ↑
Speed ↑
Tokens ↓
112K
448K
896K
MemDuet
87.50
82.81
82.03
12.16×
.0719×
Inference Mechanisms
w/o parallel execution
87.50
82.81
82.03
11.84×
.0661×
w/o draft–verify
84.38
78.91
78.13
9.89×
.0769×
w/o state reevaluation
84.38
80.47
78.13
11.58×
.0712×
Table 3: Ablations of MemDuet’s inference mechanisms and three-stage training on RULER-HQA. Accuracy is reported at 112K, 448K, and 896K tokens. Speed and Tokens equally average per-length ratios relative to RL-MemAgent. W/o Stage I retains Stages II and III; w/o Stage II retains Stages I and III; w/o Stage III retains Stages I and II.
System 1
F1 (%) ↑
Acc. (%) ↑
Speed ↑
Tokens ↓
Qwen2.5-0.5B
78.49
80.08
5.69×
.2690×
Qwen2.5-1.5B
81.68
82.89
7.28×
.2500×
Qwen3.5-0.8B
86.05
82.03
14.06×
.2149×
Qwen3.5-2B
84.47
83.36
14.26×
.2336×
Table 4: System 1 on RULER-HQA (7K–3.5M tokens). Acc., Speed, and Tokens are ten-length means; the latter two use per-length ratios to RL-MemAgent. F1 measures Update selection. Appendix C.2 gives full results and timing normalization.
k
Speed ↑
112K
448K
896K
1.75M
[1.5pt][1.5pt]1
1×
1×
1×
1×
[1.5pt][1.5pt]2
1.006 ×
1.032 ×
1.010×
1.087×
[1.5pt][1.5pt] 4
0.968×
0.981×
1.080 ×
1.107×
[1.5pt][1.5pt]8
0.920×
0.867×
0.919×
1.111 ×
[1.5pt][1.5pt]16
0.768×
0.777×
0.838×
0.927×
Table 5: Effect of the parallel chunk window width k . Speedups are measured relative to the same-length serial configuration ( k=1 ); values below 1× indicate slower execution. Bold marks the highest speedup at each length, and shading denotes the default k=4 .
API family
Method
Option Acc. (%) ↑
Latency (s) ↓
Cost ()\downarrow$
DeepSeek-V4
MemAgent
57.46
634.23
0.1974
MemDuet
57.65
178.55
0.0825
GPT-5.6
MemAgent
61.63
438.92
0.5978
MemDuet
61.03
128.46
0.2398
Table 6: Training-free transfer to proprietary models on LongBench v2, reporting option accuracy. MemDuet combines off-the-shelf System 1 and System 2 APIs using binary accept-or-reject verification. Latency and cost include both systems.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Setting
Value
Training / validation instances
32,768 / 128
Questions × rollouts
128×16=2,048
Question limit
1,024 tokens
Chunk / memory / answer limits
5,000 / 1,024 / 1,024 tokens
Maximum chunks / selector window
8 / 4
Trainable parameters
All System 2; System 1 frozen
Appendix
Table A1: Stage II training configuration.
Setting
System 1: selector
System 2: verifier / memory updater
Backbone
Qwen3.5-2B
Qwen2.5-7B-Instruct
Trainable parameters
Existing LoRA adapters; backbone frozen
New LoRA adapters; backbone frozen
LoRA rank / scaling (r/αLoRA)
32 / 64
32 / 32
LoRA target modules
Same as Stage I
All-linear
Dropout during joint RL
Disabled in rollout and policy replay
Disabled in rollout and policy replay
Training budget
5 dataset epochs
Appendix
Table A2: Stage III joint LoRA training configuration.
Model
Input
Cached input
Output
DeepSeek-V4.1-Flash
0.15
0.003
0.60
DeepSeek-V4-Pro-0813
0.66
0.022
1.98
GPT-5.6 Luna
0.20
0.020
1.20
GPT-5.6 Sol
4.00
0.400
20.00
Appendix
Table A3: API prices in USD per million tokens. DeepSeek prices are off-peak rates.
Method
7K
14K
28K
56K
112K
224K
448K
896K
1.75M
3.5M
Performance: Accuracy (%, ↑ )
RAG 7B
67.19
66.41
66.41
67.19
64.84
64.06
62.50
61.72
62.38
—
Search-R1 7B
72.66
71.88
67.71
73.96
66.67
62.50
64.58
67.71
67.19
—
QwenLong-L1 32B
72.66
75.00
72.66
60.94
31.25
17.19
13.28
11.72
N/A
N/A
QwenLong-L1.5 [-2pt]30B-A3B
67.97
68.75
66.41
63.28
61.72
59.38
43.75
39.06
28.13
—
Qwen2.5-Instruct 32B
69.53
64.84
60.16
51.56
44.53
21.88
14.06
7.03
N/A
N/A
Appendix
Table A4: RULER-HQA length scaling. The three panels report accuracy (%; local values use sub-EM), time speedup relative to MemAgent-7B, and relative output tokens (MemAgent = 1× ). Output tokens include both systems’ outputs. ∗ denotes results from our reproduction. Within each column and panel, bold and underlined values indicate the best and second-best distinct values, respectively. “-” denotes unreported results; N/A denotes unavailable results.
System 1
7K
14K
28K
56K
112K
224K
448K
896K
1.75M
3.5M
Mean
Acc. (%) ↑
Qwen2.5-0.5B
86.72
77.34
88.28
78.13
79.69
83.59
77.34
77.34
75.78
76.56
80.08
Qwen2.5-1.5B
86.72
84.38
89.06
82.03
85.16
82.81
82.03
79.69
78.91
78.13
82.89
Qwen3.5-0.8B
87.50
82.03
89.06
82.03
80.47
81.25
77.34
83.59
78.91
78.13
82.03
Qwen3.5-2B
87.50
83.59
89.06
79.69
87.50
85.94
82.81
82.03
79.69
75.78
83.36
Speed ↑
Appendix
Table A5: Complete System 1 backbone results on RULER-HQA (7K–3.5M tokens). Mean is the arithmetic average of the ten per-length values. Speed and Tokens are ratios relative to RL-MemAgent.
Long-context reasoning remains a critical bottleneck for large language models, as recent recurrent-memory approaches face two inherent challenges: sequential chunk-wise updates can overwrite early critical evidence with later irrelevant content, and serial inter-chunk dependencies limit parallelism and cause latency to increase with context length. To address these issues, we propose PI-Mem (Parallel-Iterative Memory), a mechanism that processes all chunks in parallel and iteratively refines a shared memory over a bounded number of turns. In each turn, PI-Mem reads all chunks in parallel conditioned on the current memory, selects new or complementary evidence from each chunk, and merges the selected evidence into a compact shared memory for the next turn. To discourage redundant turns, we optimize the workflow through reinforcement learning with an auxiliary turn-efficiency reward, enabling the model to adaptively exit once sufficient evidence has been accumulated. We evaluate PI-Mem with Qwen3.5-35B-A3B and Qwen2.5-7B on the HotpotQA benchmark across context lengths up to 3.6 million tokens and find that it outperforms the recurrent-memory baseline by +6.25 and +7.81 absolute points while achieving 6.1× and 2.1× inference speedups, respectively. These results demonstrate that PI-Mem breaks the accuracy--efficiency trade-off in long-context reasoning and provides a scalable approach to complex multi-hop question answering over extremely long documents.
Dawei Liu, Haixu Song, Shuang Cheng +9
Shanghai Jiao Tong University · Shanghai Artificial Intelligence Laboratory · Tsinghua University +3
Long-context reasoning is essential for complex and long-horizon tasks, yet the performance of large language models (LLMs) degrades as context length increases. Recent approaches address this by processing input chunk by chunk while maintaining a bounded textual memory in model context. However, premature information compression can discard critical details essential for subsequent reasoning. In this paper, we introduce Commit-on-Evidence Memory (CoEM), which learns when to convert source evidence into compact memory facts. Specifically, under a fixed context-memory budget, CoEM preserves potentially useful source excerpts verbatim in a pending set, allowing subsequent context to clarify their relevance before irreversible compression. As new context arrives, a learned policy revisits each pending excerpt and decides whether to promote it to the committed memory, retain it for further consideration, or discard it. A frozen verifier ensures proposed facts are accepted only if supported by retained excerpts and current context. To further guide effective memory management, we train this policy using reinforcement learning by combining fine-grained, step-level evidence rewards with final answer rewards. Extensive experiments demonstrate that CoEM consistently improves long-context reasoning. When evaluated on 6,400 documents long-context input, CoEM outperforms the strongest memory baseline by 10.4-11.4 F1 points on Qwen3.5-9B. Code repository: https://github.com/benmagnifico/CoEM.
Jingguang Li, Yebo Wu, Zuyi Guo +7
Korea Advanced Institute of Science & Technology · University of Macau · Massachusetts Institute of Technology
Long-context reasoning tasks have motivated agent-memory approaches that process document chunks sequentially while maintaining a dynamically updated memory, avoiding the quadratic complexity of standard attention. Existing methods often rely on retrieval to recover information discarded during memory overwriting, but remain vulnerable to evidence loss during memory formation and interference from invalid queries. To overcome these limitations, we propose MemReread. Built upon streaming reading, it circumvents intermediate retrieval, triggering question decomposition and targeted rereading when the final memory is insufficient. By recovering indirect evidence that may have been prematurely discarded, MemReread enables non-linear reasoning while preserving the logical flow of document comprehension. We further introduce a reinforcement learning framework that improves length extrapolation and adaptively determines the number of rereading passes according to task complexity, enabling flexible control of computational overhead. Our MemReread-4B outperforms strong baselines on long-context reasoning tasks (e.g., +1.6pp v.s. DeepSeek-V4-Pro on 2WikiMultiHopQA) while maintaining linear time complexity with respect to context length.