Neural Garbage Collection: Learning to Forget while Learning to Reason
On the map: LLM reasoning → Test-time compute and efficient thinking
Abstract (arXiv)
Chain-of-thought reasoning has driven striking advances in language model capability, yet every reasoning step grows the KV cache, creating a bottleneck to scaling this paradigm further. Current approaches manage these constraints on the model's behalf using hand-designed criteria. A more scalable approach would let end-to-end learning subsume this design choice entirely, following a broader pattern in deep learning. After all, if a model can learn to reason, why can't it learn to forget? We introduce Neural Garbage Collection (NGC), in which a language model learns to forget while learning to reason, trained end-to-end from outcome-based task reward alone. As the model reasons, it periodically pauses, decides which KV cache entries to evict, and continues to reason conditioned on the remaining cache. By treating tokens in a chain-of-thought and cache-eviction decisions as discrete actions sampled from the language model, we can use reinforcement learning to jointly optimize how the model reasons and how it manages its own memory: what the model evicts shapes what it remembers, what it remembers shapes its reasoning, and the correctness of that reasoning determines its reward. Crucially, the model learns this behavior entirely from a single learning signal - the outcome-based task reward - without supervised fine-tuning or proxy objectives. On Countdown, AMC, and AIME tasks, NGC maintains strong accuracy relative to the full-cache upper bound at 2-3x peak KV cache size compression and substantially outperforms eviction baselines. Our results are a first step towards a broader vision where end-to-end optimization drives both capability and efficiency in language models.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Test-time compute and efficient thinking, one of 17 directions in LLM reasoning. Builds on 37 of its 46 references that are in the map. First posted on arXiv 20 Apr 2026.
Builds on
37 of 46 references.
Closest ancestors · 8
Same direction, newest first
- 2026MEMENTO: Teaching LLMs to Manage Their Own Context10 Apr
- 2025Breadcrumbs Reasoning: Memory-Efficient Reasoning with Compression Beacons15 Oct
- 2025Metacognitive Reuse: Turning Recurring LLM Reasoning Into Concise Behaviors16 Sep
- 2025Inference-Time Hyper-Scaling with KV Cache Compression5 Jun
- 2025Learning Adaptive Parallel Reasoning with Language Models21 Apr
- 2024Stream of Search (SoS): Learning to Search in Language1 Apr
- 2023Think before you speak: Training Language Models With Pause Tokens3 Oct
- 2022STaR: Bootstrapping Reasoning With Reasoning28 Mar
Other references · 29
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,413
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2025DAPO: An Open-Source LLM Reinforcement Learning System at Scalecited by 2,678
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,283
- 2025Understanding R1-Zero-Like Training: A Critical Perspectivecited by 1,276
17 more
- 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 848
- 2025DeepSeek-V3.2: Pushing the Frontier of Open Large Language Modelscited by 755
- 2017Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithmcited by 723
- 2024Self-Rewarding Language Modelscited by 654
- 2023Reinforced Self-Training (ReST) for Language Modelingcited by 486
- 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 391
- 2023Learning to Compress Prompts with Gist Tokenscited by 379
- 2025Cognitive Behaviors that Enable Self-Improving Reasoners, or, Four Habits of Highly Effective STaRscited by 373
- 2024Quiet-STaR: Language Models Can Teach Themselves to Think Before Speakingcited by 292
- 2019Stochastic Beams and Where to Find Them: The Gumbel-Top-k Trick for Sampling Sequences Without Replacementcited by 205
- 2023Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Lawscited by 155
- 2024A Simple and Effective L2 Norm-Based Strategy for KV Cache Compressioncited by 84
- 2025Cartridges: Lightweight and general-purpose long context representations via self-studycited by 74
- 2025KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environmentscited by 49
- 2024Learning Formal Mathematics From Intrinsic Motivationcited by 45
- 2026Fast KV Compaction via Attention Matchingcited by 28
- 2026MSA: Memory Sparse Attention for Efficient End-to-End Memory Model Scaling to 100M Tokenscited by 5
Built on by
Citing papers per year: 2026: 2.
2 papers.
- 2026Simplified Sparse Attention via Gist Tokenscited by 4
- 2026SPIRAL: Learning to Search and Aggregatecited by 3
- 2026SPIRAL: Learning to Search and Aggregate22 Jun 2026
- 2026Simplified Sparse Attention via Gist Tokens22 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2026Random Attention: Rethinking KV Cache Eviction for Efficient Reasoning
- 2026LatentHarness: Learning Latent Actions for Memory and Reasoning via Counterfactual Policy Distillation
- 2026Free(): Learning to Forget in Malloc-Only Reasoning Models
- 2025Forgetting as a Feature: Cognitive Alignment of Large Language Models
- 2026Forgetting in Language Models: Capacity, Optimization, and Self-Generated Replay
- 2025Reason to Rote: Rethinking Memorization in Reasoning
- 2026GUARD: Natural Forgetting in Large Reasoning Models via Guided Answer-Reasoning Distillation
- 2025Reasoning Under 1 Billion: Memory-Augmented Reinforcement Learning for Large Language Models