NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Reasoning Path Compression: Compressing Generation Trajectories for Efficient LLM Reasoning

Jiwon Song, Dongwon Jo, Yulhwa Kim, Jae-Joon Kim

Abstract

Modern reasoning-focused Large Language Models (LLMs) achieve state-of-the-art performance by scaling test-time compute, generating extensive intermediate "thinking" trajectories. However, these long-form reasoning paths create a significant memory bottleneck in the Key-Value (KV) cache, leading to Out-of-Memory (OOM) errors and reduced inference throughput. We introduce Reasoning Path Compression (RPC), a training-free method designed to compress these trajectories by exploiting the inherent semantic sparsity of reasoning processes. RPC reduces memory overhead by up to 75% and improves throughput by up to 1.60× while maintaining high accuracy across complex benchmarks.

Introduction

The paradigm shift toward "reasoning" models, such as OpenAI’s o1 and DeepSeek-R1, has demonstrated that LLM performance on complex tasks can be significantly enhanced by allowing the model to generate long Chain-of-Thought (CoT) sequences. These trajectories often exceed 64,000 tokens, placing immense pressure on the KV cache. In standard autoregressive generation, the KV cache grows linearly with sequence length, eventually exhausting GPU memory and slowing down generation speeds.

While existing KV cache compression techniques like H2O or SnapKV effectively manage long input prompts, they are less effective for long generated outputs. Reasoning paths differ from general text in their dynamic nature; the importance of specific tokens shifts as the model progresses through different logical steps. Reasoning Path Compression (RPC) addresses this by identifying and pruning redundant information within the generated trajectory without requiring model retraining.

The Concept of Semantic Sparsity

The core insight behind RPC is that reasoning paths exhibit high semantic sparsity. By analyzing n-gram Shannon entropy, researchers found that reasoning models often revisit previous logic, re-derive intermediate steps, or use repetitive linguistic structures. This redundancy suggests that much of the generated context can be compressed or evicted without losing the essential logical thread required to reach a correct conclusion.

The RPC Framework

RPC is a plug-and-play, training-free algorithm that manages the KV cache through a periodic, importance-based pruning mechanism. It consists of three primary components:

  1. Periodic Compression ($P$): Unlike traditional methods that evaluate token importance at every step, RPC performs compression at set intervals of $P$ tokens. This reduces the computational overhead associated with the pruning process itself.
  2. Selector Window ($R$): To determine which historical tokens remain relevant, RPC utilizes the $R$ most recently generated tokens as "selectors." By analyzing the attention weights of these recent tokens, the algorithm identifies which parts of the past trajectory are still actively influencing the current reasoning step.
  3. Importance Scoring and Local Pooling: Rather than keeping isolated tokens, RPC applies local average pooling to attention scores. This ensures that semantically related "chunks" of tokens are preserved together, maintaining the structural integrity of the reasoning steps.

Experimental Evaluation

The effectiveness of RPC was evaluated using two prominent reasoning models: DeepSeek-R1-Distill-Qwen-7B and QwQ-32B. Testing was conducted across three rigorous benchmarks:

  • AIME 2024: Competitive high-school mathematics.
  • LiveCodeBench: Complex programming and algorithmic tasks.
  • IFEval: Strict adherence to complex instructions.

Key Results

  • Memory and Throughput: On the QwQ-32B model, RPC achieved a 1.60× speedup in token throughput. It successfully reduced the KV cache size of generated tokens by up to 75%, effectively cutting peak memory usage by over half for long sequences. This allows for long-form reasoning on hardware that would otherwise suffer from OOM errors.
  • Accuracy Preservation: Despite aggressive compression, the impact on model performance was negligible. On the AIME 2024 math benchmark, the accuracy drop was limited to just 1.2%.
  • Comparison to Baselines: RPC significantly outperformed general-purpose KV compression methods such as H2O and TOVA. These baselines often failed to maintain the logical consistency required for reasoning tasks when applied to long-form generation.

Discussion and Future Work

RPC demonstrates that the "thinking" process of LLMs is highly compressible. By focusing on the most recent context as a guide for historical relevance, RPC enables efficient scaling of test-time compute.

However, several avenues for future research remain. The current implementation relies on fixed hyperparameters for the compression interval ($P$) and selector window ($R$). Future iterations could explore adaptive compression, where the model dynamically adjusts its compression ratio based on the perceived complexity of the current reasoning step. Additionally, integrating RPC with optimized attention kernels like FlashAttention could further enhance the throughput gains observed in this study.

Conclusion

Reasoning Path Compression provides a robust solution to the memory bottlenecks inherent in modern reasoning LLMs. By exploiting semantic sparsity through a periodic, training-free pruning strategy, RPC allows models to engage in deep, long-form thinking without the prohibitive hardware costs typically associated with test-time compute scaling.

Summary updated

BibTeX
@inproceedings{song2025reasoning,
  author = {Jiwon Song and Dongwon Jo and Yulhwa Kim and Jae-Joon Kim},
  title = {{Reasoning Path Compression: Compressing Generation Trajectories for Efficient LLM Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=894Yo61h1P},
}
Figure