MEMENTO: Teaching LLMs to Manage Their Own Context
Organizations: Microsoft Research
Abstract
Reasoning models think in long, unstructured streams with no mechanism for compressing or organizing their own intermediate state. We introduce MEMENTO: a method that teaches models to segment reasoning into blocks, compress each block into a memento, i.e., a dense state summary, and reason forward by attending only to mementos, reducing context, KV cache, and compute. To train MEMENTO models, we release OpenMementos, a public dataset of 228K reasoning traces derived from OpenThoughts-v3, segmented and annotated with intermediate summaries. We show that a two-stage SFT recipe on OpenMementos is effective across different model families (Qwen3, Phi-4, Olmo 3) and scales (8B--32B parameters). Trained models maintain strong accuracy on math, science, and coding benchmarks while achieving peak KV cache reduction. We extend vLLM to support our inference method, achieving throughput improvement while also enabling us to perform RL and further improve accuracy. Finally, we identify a dual information stream: information from each reasoning block is carried both by the memento text and by the corresponding KV states, which retain implicit information from the original block. Removing this channel drops accuracy by 15,pp on AIME24.
Figures & tables
| AIME’26 | Comp. Math | MATH-500 | GPQA-D | LCB v6 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Val | Val | Val | Val | Val | ||||||||
| Qwen3-8B | Acc | 66.8 1.1 | 54.3 0.3 | 90.5 0.9 | 61.4 2.4 | 73.1 1.0 | ||||||
| Base | Peak KV | 2.41 | 2.71 | 0.84 | 1.23 | 1.76 | ||||||
| AUC KV | 25.3 | 30.9 | 4.3 | 6.6 | 15.6 | |||||||
| Acc | 64.7 1.1 | 49.2 0.3 | 89.7 1.0 | 57.8 2.5 | 70.0 1.0 | |||||||
| Control | Peak KV | 2.59 | 2.82 | 0.88 | 1.60 | 1.89 | ||||||
| Model | Bench. | Base | Memento | Ret. | Jacc. |
|---|---|---|---|---|---|
| Qwen3-8B | AIME’24 | 93.3 | 90.0 | 96.4 | 96.4 |
| AIME’25 | 93.3 | 86.7 | 92.9 | 92.9 | |
| AIME’26 | 86.7 | 90.0 | 100.0 | 96.3 | |
| Phi-4-r (14B) | AIME’24 | 93.3 | 93.3 | 100.0 | 100.0 |
| AIME’25 | 93.3 | 90.0 | 96.4 | 96.4 | |
| AIME’26 | 93.3 | 90.0 | 96.4 | 96.4 |
| Inference mode | Pass@1 |
|---|---|
| Memento att. (normal) | 66.1% |
| Memento att. + restart | 50.8% |
| 15.3 pp |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Benchmark | Source | # Problems | Answer format |
|---|---|---|---|
| AIME 2024 | HuggingFaceH4/aime_2024 | 30 | Integer (0–999), \boxed{} |
| AIME 2025 | yentinglin/aime_2025 | 30 | Integer (0–999), \boxed{} |
| AIME 2026 | MathArena/aime_2026 | 30 | Integer (0–999), \boxed{} |
| HMMT Feb 2023 | MathArena/hmmt_feb_2023 | 30 | Math expression |
| HMMT Feb 2024 | MathArena/hmmt_feb_2024 | 30 | Math expression |
| HMMT Feb 2025 | MathArena/hmmt_feb_2025 | 30 | Math expression |
LLM Context Management
Large language model context management studies how to select, compress, retrieve, and organize information within bounded model inputs.
See all 244 papers