Memory Augmentation Unlocks Efficient Chain-of-Thought Reasoning
Organizations: Institute of Information Engineering, Chinese Academy of Sciences · School of Cyber Security, University of Chinese Academy of Sciences · Tencent Inc. · Baidu Inc.
Abstract
Large language models often rely on Chain-of-Thought (CoT) reasoning to solve complex tasks, but verbose reasoning traces introduce substantial inference overhead. CoT compression shortens generation, yet aggressive compression may disrupt logical coherence and degrade performance. We formalize this trade-off as the Context-Generation Substitution Law, where explicit reasoning context substitutes for part of decode-time generation. Based on this principle, we propose Memory-Augmented Compression, a training-free framework that constructs reusable reasoning memories from historical traces and retrieves them as prefill-side scaffolds. Rather than using raw demonstrations, these memories summarize reusable reasoning patterns, key constraints, and critical operations to compensate for information lost during compression. Experiments show that Memory consistently improves prompt-based Chain-of-Draft (CoD) compression across mathematical reasoning, complex reasoning, and science question answering tasks, yielding accuracy gains of 21.4, 28.0, 29.5, and 6.61 points over CoD on GSM8K, MATH, BBH, and MMLU-Sci, while achieving a 1.14-1.49x latency speedup latency speedup over standard CoT. Memory is also compatible with token-level, reasoning-trace-level, and inference-state compression mechanisms.
Figures & tables
| (a) Across-domain CoD results with Qwen2.5-7B | ||||||||
| Domain | Dataset | Method | Acc. | vs CoD | Prefill | Decode | Total | Latency (ms) |
| Math | GSM8K | CoT | 91.4 | – | 96.3 | 299.2 | 395.5 | 3742.5 (1.00 ) |
| CoD | 67.9 | – | 112.3 | 51.1 | 163.4 | 666.6 (5.61 ) | ||
| +Memory | 89.3 | +21.4 | 1161.9 | 187.2 | 1349.1 | 2515.4 (1.49 ) | ||
| MATH | CoT | 72.8 | – | 105.9 | 569.3 | 675.2 | 5117.0 (1.00 ) | |
| CoD | 43.0 | – | 121.9 | 100.3 | 222.2 | 1119.5 (4.57 ) | ||
| Retriever | Accuracy (%) | Overhead |
|---|---|---|
| No Memory (CoD) | 43.00 | – |
| Random | 50.20 | 0.1 ms |
| Query Emb. | 53.20 | 100 ms |
| BM25 | 54.60 | 1 ms |
| Reasoning Tag | 56.20 | 683 ms |
| Memory Content | Acc. | Prefill | Decode | Acc |
|---|---|---|---|---|
| CoD (None) | 55.00 | 136.31 | 2105.50 | 0.00 |
| Few-shot | 46.67 | 300.79 | 1406.11 | -8.33 |
| Summary | 61.67 | 606.81 | 2117.04 | +6.67 |
| Short-CoT | 46.67 | 605.40 | 1454.78 | -8.33 |
| Long-CoT | 43.33 | 961.37 | 1531.02 | -11.67 |
| Best | |||||||
|---|---|---|---|---|---|---|---|
| Dataset | Acc. | Pre. | Acc. | Pre. | Acc. | Pre. | |
| GSM8K | 73.39 | 259 | 14 | 80.52 | 1881 | 79.68 | 2628 |
| MATH | 52.20 | 349 | 16 | 62.60 | 3330 | 57.40 | 4120 |
| Method | Acc. (%) | Prefill | Decode | Total | Acc |
|---|---|---|---|---|---|
| DeepSeek-V3.2 | |||||
| CoT | 55.00 | 124.01 | 2733.94 | 2857.95 | – |
| CoD | 55.00 | 136.31 | 2105.50 | 2241.81 | 0.00 |
| +Memory | 61.67 | 606.81 | 2117.04 | 2723.85 | +6.67 |
| Qwen3.5-plus | |||||
| CoT | 75.83 | 142.30 | 8657.60 | 8799.90 | – |
| Dataset | Batch | Prefill | Decode | Ratio |
|---|---|---|---|---|
| (ms/tok) | (ms/tok) | |||
| GSM8K | 1 | 0.136 | 11.81 | 87.0 |
| GSM8K | 8 | 0.144 | 2.11 | 14.7 |
| MATH-500 | 1 | 0.150 | 11.97 | 79.4 |
| MATH-500 | 8 | 0.134 | 2.96 | 22.1 |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Evaluation Split | Eval. Size | Memory Source | Bank Size |
|---|---|---|---|---|
| GSM8K | Official test set | 1,319 | Filtered official training examples | 4,307 |
| MATH | MATH-500 | 500 | Filtered official training examples | 2,242 |
| BBH | Nine selected tasks | 495 | Official task-specific CoT exemplars | 27 |
| MMLU-Sci | Subject-stratified 20% split | 79 | Remaining 80% from the same six subjects | 317 |
| AIME 2024 | Official 2024 problems | 30 | Historical AIME problems from 1983–2022 | 287 |
| Method | Acc. | Prefill | Decode | Latency (ms) |
|---|---|---|---|---|
| CoT | 77.00 | 105.9 | 597.4 | 22592.1 |
| CoD | 62.20 | 121.9 | 122.9 | 4393.3 |
| CoD+Memory | 78.20 | 1772.6 | 373.0 | 13940.4 |
| Model | Base | +Mem. | Gain | |
|---|---|---|---|---|
| Qwen2.5-7B | 0.1 | 52.62 | 74.60 | +21.99 |
| 0.2 | 60.65 | 74.53 | +13.87 | |
| 0.3 | 66.19 | 78.77 | +12.59 | |
| 0.4 | 68.08 | 80.74 | +12.66 | |
| 0.5 | 71.11 | 84.00 | +12.89 | |
| 0.6 | 77.26 | 84.99 | +7.73 |
| Model | Base | +Mem. | Gain | |
|---|---|---|---|---|
| Qwen2.5-7B | 0.1 | 12.00 | 13.20 | +1.20 |
| 0.2 | 19.60 | 22.20 | +2.60 | |
| 0.3 | 28.00 | 33.60 | +5.60 | |
| 0.4 | 34.40 | 44.80 | +10.40 | |
| 0.5 | 38.00 | 52.80 | +14.80 | |
| 0.6 | 42.60 | 58.40 | +15.80 |
| Dataset | Ratio | Base | +Mem. | |
|---|---|---|---|---|
| GSM8K | 0.2 | 5 | 74.07 | 67.70 |
| 0.4 | 5 | 78.92 | 71.65 | |
| 0.6 | 5 | 84.69 | 80.74 | |
| 0.8 | 5 | 85.75 | 80.52 | |
| 1.0 | 5 | 83.70 | 81.80 | |
| MATH | 0.2 | 5 | 29.20 | 24.40 |
| Method | Acc. (%) | Prefill + Decode (ms) | Query Tag + Embedding (ms) | Vector Search (ms) | End-to-End Latency (ms) | E2E Speedup |
|---|---|---|---|---|---|---|
| CoT | 91.4 | 3742.5 | – | – | 3742.5 | 1.00 |
| CoD+Memory | 89.3 | 2515.4 | 683.0 | 0.10 | 3198.5 | 1.17 |
| GSM8K | MATH | MMLU-Sci | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc. | Prefill | Decode | Acc. | Prefill | Decode | Acc. | Prefill | Decode | |||
| 1 | 73.39 | 259.0 | 57.9 | 1 | 52.20 | 348.8 | 152.8 | 1 | 55.07 | 267.1 | 51.6 |
| 3 | 76.27 | 509.4 | 59.9 | 3 | 53.20 | 751.0 | 190.6 | 3 | 65.64 | 493.5 | 68.3 |
| 5 | 77.26 | 759.8 | 61.3 | 5 | 53.40 | 1134.4 | 202.6 | 5 | 62.11 | 493.6 | 66.5 |
| 8 | 78.15 | 1132.1 | 61.7 | 8 | 58.60 | 1729.8 | 218.1 | 8 | 66.52 | 493.6 | 67.7 |
| 10 | 78.47 | 1379.2 | 61.9 | 10 | 58.80 | 2124.9 | 227.1 | 10 | 65.20 | 493.6 | 67.8 |
| LLaMA-3.1-8B | Qwen2.5-7B | |||
|---|---|---|---|---|
| Long | Short | Long | Short | |
| 0.1 | +30.71 | +31.54 | +33.66 | +29.04 |
| 0.2 | +14.25 | +13.57 | +17.97 | +16.15 |
| 0.3 | +7.28 | +7.05 | +11.75 | +8.49 |
| 0.4 | +6.44 | +4.85 | +4.40 | +1.67 |
| 0.5 | +4.70 | +3.18 | +3.56 | +1.06 |
| Temperature | Standard CoT | Memory | ||
| Acc. | Decode | Acc. | Decode | |
| 0.0 | 90.1 | 282 | 81.8 | 68.2 |
| 0.2 | 90.8 | 288 | 82.1 | 68.7 |
| 0.4 | 91.2 | 293 | 82.3 | 69.0 |
| 0.6 | 89.8 | 297 | 81.9 | 68.5 |
| 0.8 | 90.5 | 301 | 82.0 | 68.9 |
Efficient Language Model Reasoning
Efficient language model reasoning studies how to improve problem-solving accuracy while reducing inference, memory, latency, and training costs.
See all 356 papers