Source-linked AI summary
Free(): Learning to Forget in Malloc-Only Reasoning Models
Yilun Zheng, Dongyang Ma, Tian Liang, Jiahao Xu, Xinting Huang, Lihui Chen, Haitao Mi, Yan Wang
TL;DR
Reasoning models can lose accuracy when excessive thinking fills the context with redundant steps, revealing a limitation of malloc-only accumulation. Free()LM adds a LoRA-based Free-Module that alternates reasoning with context cleaning, and experiments report gains across scales while recovering long-horizon performance.
Problem
Excessive reasoning tokens can reduce accuracy or cause degeneration because standard models accumulate redundant context without pruning obsolete information.
Method
Free()LM uses a plug-and-play LoRA Free-Module that alternates unmerged reasoning with merged cleaning to identify and prune redundant context.
Results
Free()LM achieves a 3.3% average gain across six benchmarks for models from 8B to 685B, including a new IMOanswerBench SOTA and recovery from long-horizon collapse.
Takeaways & Limitations
The results support active context pruning as a way to sustain reasoning performance while retaining less context rather than generating more tokens.
Takeaways & Limitations
The authors stop short of claiming a definitive intelligence boost, emphasizing instead that Free()LM sustains reasoning capability.
Abstract
from arXiv · showhide
Reasoning models enhance problem-solving by scaling test-time compute, yet they face a critical paradox: excessive thinking tokens often degrade performance rather than improve it. We attribute this to a fundamental architectural flaw: standard LLMs operate as "malloc-only" engines, continuously accumulating valid and redundant steps alike without a mechanism to prune obsolete information. To break this cycle, we propose Free()LM, a model that introduces an intrinsic self-forgetting capability via the Free-Module, a plug-and-play LoRA adapter. By iteratively switching between reasoning and cleaning modes, Free()LM dynamically identifies and prunes useless context chunks, maintaining a compact and noise-free state. Extensive experiments show that Free()LM provides consistent improvements across all model scales (8B to 685B). It achieves a 3.3% average improvement over top-tier reasoning baselines, even establishing a new SOTA on IMOanswerBench using DeepSeek V3.2-Speciale. Most notably, in long-horizon tasks where the standard Qwen3-235B-A22B model suffers a total collapse (0% accuracy), Free()LM restores performance to 50%. Our findings suggest that sustainable intelligence requires the freedom to forget as much as the power to think.
1 Introduction
Reasoning models can degrade when excessive thinking accumulates redundant or obsolete context, eventually causing degeneration. Free()LM addresses this bottleneck by periodically pruning useless reasoning steps, improving performance across model scales and benchmarks.
- 70–90% context occupancy typically bounds the benefit of further reasoning, which can instead reduce accuracy or trigger repetitive degeneration.
- 84% of Qwen3-8B trajectories reaching the context limit were trapped in repetitive loops, and degeneration reached 100% by 48k tokens.
- Free()LM adds a plug-and-play Free-Module that switches between reasoning and cleaning modes to prune redundant context.
- 3.3% average gain across six reasoning benchmarks was achieved for models ranging from 8B to 685B, including a new IMOanswerBench SOTA.
- By generating only prefixes and suffixes, the pruning method removes large redundant chunks with minimal cost.
2 Method
Free()LM augments an LLM with a LoRA-based Free-Module that alternates reasoning and cleaning. Its training pipeline synthesizes pruning operations and retains only those that preserve or improve reasoning accuracy.
- Architecture & Inference: The Free-Module is a LoRA adapter dynamically merged and unmerged to switch between cleaning and reasoning modes.
- Architecture & Inference: During reasoning, the backbone generates tokens normally; during cleaning, the merged module scans context and outputs pruning commands.
- Architecture & Inference: Prefix and suffix anchors define spans for efficiently pruning long redundant chunks with only a few command tokens.
- Architecture & Inference: The main experiments adopt a merge-based strategy because standard serving frameworks like vLLM do not natively support the alternative strategy.
- Training: Learning to Forget: ICL-based redundancy identification produced only marginal gains of approximately 1% on Qwen3-8B, motivating explicit training.
- Training: Learning to Forget: The training pipeline sequentially synthesizes pruning instances from 1k-token trajectory chunks and conditions each operation on previously cleaned history.
- Training: Learning to Forget: Eight independent rollouts retain a pruning operation only when the cleaned context preserves or improves accuracy, yielding 6,648 training instances.
3 Experiments
Experiments evaluate Free()LM across model scales, baselines, benchmarks, and reasoning lengths. The method consistently improves accuracy while reducing context, preserves short-task performance, generalizes across backbones, and addresses long-horizon collapse at latency and implementation cost.
- Experimental Setup: Free()LM is evaluated across Qwen3 models from 8B to 235B, with comparisons against vanilla, heuristic compression, and ICL baselines.The benchmark suite tests long-horizon enhancement and safety on general tasks where pruning is unnecessary.
- Main Results: Free()LM consistently improves accuracy across benchmarks while maintaining a significantly more compact context.The qualitative analysis attributes this to precise redundancy removal without observed regeneration, unlike Gemini’s mistaken deletion of useful clues.
- Main Results: Free()LM improves Qwen3-8B average Pass@1 from 44.24% to 48.14%, a +3.9% gain, while retaining shorter reasoning than Gemini-2.5-Pro.Its average response length is 13.8k tokens versus Gemini-2.5-Pro’s 15.8k, while accuracy is higher by +2.3%.
- Main Results: Heuristic H2O and ThinkCleary compression fails to improve accuracy or response length because pruning disrupts reasoning and triggers repetitive loops.These methods can produce longer, redundant outputs and make reasoning prone to crashing.
- Scalability and Reasoning Length: On Qwen3-235B-A22B, Free()LM yields an 11.7% relative improvement on HLE while reducing context length by 27.5%.On trajectories exceeding 80k tokens, vanilla accuracy falls to 0%, whereas Free()LM recovers it to approximately 50% by compressing context by 40%–50%.
- Generalization and Efficiency: Free()LM preserves short-reasoning performance, and an 8B Free-Module transfers to larger backbones with comparable gains.The transferred module improves performance by +1.5% on Qwen3-235B-A22B, while the 235B module achieves +1.75%; another result reports +2.3% Pass@1 with 45.99% fewer response tokens.
- Efficiency: Free()LM incurs a 56% latency increase per sample but reduces KV cache usage by 45%, from 6.14 GB to 3.34 GB.The authors estimate overhead could fall to approximately 20% with KV Cache Pruning, which is not yet implemented in vLLM.
- Qualitative Analysis: Free()LM qualitatively prunes redundant self-correction without regeneration, whereas Gemini deletes essential anchors and must regenerate them.The comparison uses color coding for deleted, newly generated, and regenerated spans.
4 Related Work
Free()LM addresses context accumulation and CoT overthinking through logic-aware pruning rather than merely expanding context or compressing tokens heuristically. Its Free-Module targets semantic redundancy while preserving reasoning quality.
- Free()LM tackles context accumulation where unbounded intermediate thoughts crowd out information needed for subsequent reasoning.
- KV Cache Compression: KV cache methods bound memory through eviction, saliency clustering, adaptive budgets, reconstruction, or quantization, but lossy compression can distract precise reasoning.
- KV Cache Compression: Free()LM differs by training a Free-Module to detect semantic redundancy within reasoning traces and perform logic-aware pruning.
- Long Context Window: Long-context methods expand feasible windows, yet performance can decay as context grows because distraction persists even with perfect retrieval.
- CoT Overthinking: CoT overthinking produces redundant steps through dead ends, repeated computations, or over-verification, motivating budgeted generation, token pruning, and stopping rules.
5 Conclusion
The conclusion presents standard reasoning as a malloc-only, append-only process that becomes unsustainable when redundant tokens accumulate. Free()LM adds active context pruning, improving reasoning across scales and recovering performance on long-horizon tasks.
- Standard LLMs treat context as an append-only buffer, so redundant tokens eventually overwhelm long-horizon reasoning.
- Free()LM completes the memory-management cycle by introducing the missing free() operation for pruning redundant context.
- 3.3% average gain over leading baselines accompanies improvements across model scales from 8B to 685B and a new SOTA on IMOanswerBench.
- Free()LM suggests that long-horizon intelligence requires mastering forgetting alongside expanding test-time computation and context.
A.1 Prompts
The prompts instruct an analyst to identify redundant or irrelevant CoT paragraphs and return deletion spans in a structured JSON format. Safeguards permit no deletions and prohibit deleting the first or last paragraph.
- The reasoning analyst reads the CoT reasoning and marks paragraphs that are redundant or irrelevant for deletion.
- Redundancy includes tangential thoughts, corrected errors, and superseded lines that do not directly support the overall reasoning process.
- Each deletion is represented by a JSON object containing a prefix and suffix extracted from the targeted paragraph.
- The output may be an empty list when no deletion is needed, and the first and last CoT paragraphs must not be deleted.
A.2 Training Details
The Free-Module is trained to delete intermediate reasoning while operating on visible model-generated reasoning. Training uses LoRA with frozen backbones, and structured JSON output supports programmatic parsing.
- The Free-Module operates solely on visible model-generated reasoning because thinking mode is disabled during prompt construction.
- Training uses five epochs, learning rate 1 × 10^-5, global batch size 16, AdamW, FlashAttention-2, and DeepSpeed ZeRO.
- LoRA is applied to all linear layers while backbone parameters remain frozen and only Free-Module parameters are updated.
- A JSON schema guides Free-Module outputs so redundant or irrelevant reasoning can be parsed and removed programmatically.
A.3 Evaluation Details
The evaluation procedure resumes generation from a refined reasoning context by appending the previous response and rerunning the prompt. KV-cache reuse limits recomputation to the altered suffix after a free() operation.
- Prefilling appends the model’s previously generated response to the chat-templated prompt before rerunning it.This resumes generation from the refined context rather than restarting inference from scratch.
- Subsequent tokens are generated conditionally on the updated reasoning trace.
- After free(), unchanged-prefix key–value states are reused and only the altered suffix is re-prefilled.This avoids recomputing attention for the entire context and reduces the overhead of resuming inference.