The recent explosion of reasoning-focused Large Language Models (LLMs), such as OpenAI’s o1 and DeepSeek-R1, has demonstrated a profound capability shift: given enough time to "think" through a problem using long Chain-of-Thought (CoT) prompting, model performance skyrockets. However, this "slow thinking" paradigm introduces a severe computational bottleneck. As reasoning traces stretch into tens of thousands of tokens, the Key-Value (KV) cache balloons linearly, and attention complexity scales quadratically. Inference speed inevitably crawls to a halt.
To address this efficiency trap, researchers from HKUST and ETH Zurich have introduced Accordion-Thinking, an end-to-end framework that enables LLMs to dynamically compress their own reasoning traces. By teaching models to periodically summarize their thoughts and discard verbose details from active memory, Accordion-Thinking achieves significant throughput gains without sacrificing reasoning power.
The "Memory Wall" in Long-Form Reasoning
The primary obstacle in scaling test-time compute is the "Memory Wall." When an LLM generates a 10,000-token internal monologue to solve a complex math problem, it must retain all previous tokens in its KV cache. This not only risks exhausting GPU memory but also slows down generation significantly.
Furthermore, exhaustive reasoning traces are often meandering and unstructured, making them difficult for human overseers to read or verify. Prior attempts to mitigate this issue relied on external heuristics, such as randomly deleting tokens or aggressively truncating context, which frequently disrupted the model's logical flow and degraded accuracy.
The Accordion-Thinking Framework
Accordion-Thinking proposes a dynamic "Fold" and "Unfold" mechanism, conceptually similar to an accordion expanding and contracting:
- Structured Reasoning Steps: The reasoning process is divided into $K$ distinct steps. Each step consists of a detailed segment ($d_k$) for raw calculation and exploration, followed by a step summary ($s_k$) that distills the essential logic and outcomes of that step.
- Fold Mode Inference: Once a step summary is generated, the model "folds" its context. It discards the verbose detailed segment from its KV cache. For subsequent steps, the model only attends to the original prompt and the sequence of previous summaries.
- Data Synthesis: To initialize this capability, the researchers used a teacher model (DeepSeek-V3.2) to rewrite 10,000 existing math reasoning traces into this "Step + Summary" format, providing a cold-start via Supervised Fine-Tuning (SFT).
The Crucial Role of Reinforcement Learning
The core innovation of Accordion-Thinking lies in its application of Reinforcement Learning (RL), specifically Group Relative Policy Optimization (GRPO).
The researchers discovered that SFT alone is insufficient; without the pressure of RL, models fail to encode critical details into their summaries, leading to cascading errors in Fold mode. By rewarding the model for arriving at the correct final answer while strictly operating in Fold mode, the model is forced to learn "lossless" summarization. Every piece of information necessary for the next step must be captured in the summary.
This training regimen revealed a striking "Gap-Vanishing" phenomenon. Initially, models perform significantly worse in Fold mode compared to the full-context Unfold mode. However, as RL training progresses, the performance of the Fold mode steadily catches up until the accuracy gap entirely disappears. The model effectively learns the skill of self-compression. Furthermore, attention map analysis showed that folded reasoning leads to much denser, higher-signal attention patterns compared to the scattered focus seen in standard long CoT.
Key Results
Evaluated on models like Qwen2.5-Math-7B and Qwen3-4B across rigorous math benchmarks (MATH-500, AIME24, AMC23) and out-of-distribution scientific datasets (ARC-Challenge, GPQA-Diamond), Accordion-Thinking demonstrated remarkable improvements:
- Efficiency: On a 48GB GPU configuration, Accordion-Thinking achieved 3x the throughput of standard models. It successfully reduced peak token counts by 50-60% across various benchmarks.
- Accuracy: On the challenging AIME24 benchmark, the Accordion-Thinker-7B achieved a 32.2% Pass@1 in Fold mode. This not only surpassed the 26.7% baseline of the unfolded SFT model but also matched the performance of much more computationally expensive RL baselines.
- Readability: Human and LLM evaluations confirmed that the generated summaries are semantically faithful to the detailed steps. The sequence of summaries acts as an accurate "TL;DR" of the model's internal monologue, vastly improving human interpretability.
Limitations and Future Directions
While highly effective, the current iteration of Accordion-Thinking has a few limitations. The framework currently relies on a rule-based filter to maintain a fixed step count (between 2 and 6 steps). Future iterations could allow the model to dynamically determine when a reasoning step is complete and requires folding. Additionally, the method depends heavily on high-quality synthetic data from a teacher model to bootstrap the initial SFT phase. Finally, while proven on 4B and 7B architectures, scaling this self-regulation technique to frontier-class models (70B+ parameters) remains an exciting frontier for future research.
Conclusion
Accordion-Thinking represents a significant step forward in making long-form LLM reasoning practically deployable. By transitioning LLMs from passive text generators to active managers of their own cognitive load—expanding to think deeply and folding to stay efficient—this framework offers a scalable solution to the memory and compute bottlenecks of modern AI reasoning.
Summary updated