TL;DR
Fine-tuning smaller language models on distilled Long Chain-of-Thought (Long-CoT) data often causes them to fall into "cyclical reasoning" loops, where they repeat the same inference steps until hitting token limits. The authors discover that this looping behavior is strongly linked to low representation divergence between adjacent tokens in the model's hidden states. To fix this, they introduce Shift-FFN, a novel architecture that uses the preceding token's hidden state to dynamically amplify adjacent token differences, significantly reducing loops and boosting mathematical reasoning accuracy.
What Problem Does This Paper Address?
Frontier models like OpenAI-o1 and DeepSeek-R1 achieve massive reasoning gains by using Long Chain-of-Thought (Long-CoT) processing—essentially thinking out loud with extensive step-by-step verification and self-correction. While distilling this long-form reasoning data into smaller student models is highly effective, it introduces a major bug: Cyclical Reasoning.
When student models are fine-tuned on long CoT data using standard methods (like full parameter tuning or low-rank LoRA), they frequently get stuck in infinite loops. They will repeatedly reiterate previous inference steps or paragraphs until they hit the maximum generation length limit (e.g., 32k tokens), destroying both accuracy and efficiency.
Methods
To understand why models loop, the authors first analyzed the relative change in embedding trajectories between adjacent tokens across all layers. They discovered that answers suffering from cyclical reasoning show significantly smaller internal representation differences between adjacent tokens compared to normal answers.
To actively push the model's hidden states forward and prevent representational stagnation, they propose the Shift Feedforward Network (Shift-FFN).
Instead of passing the standard token representation $x_i$ directly to the Feedforward Network (FFN), Shift-FFN introduces an Editor module right before it. This module uses a lightweight gating mechanism to calculate a "gating shift" based on both the current token $x_i$ and the preceding token $x_{i-1}$:
$$fs(x_{i-1}, x_i) = W_c [ReLU(W_b [x_{i-1}; x_i]) \odot (W_a x_{i-1})]$$
This shift vector is added directly to the current token's representation:
$$\text{Shift-FFN}(x_i) = \text{FFN}(x_i + fs(x_{i-1}, x_i))$$
To ensure training stability, the output matrix $W_c$ is initialized to all zeros, meaning the Shift-FFN safely degenerates into a standard FFN at the start of training and gradually learns how to amplify token differences.
Datasets
The authors evaluated their approach using parallel datasets of short and long CoT solutions:
- Training Data: Long CoT data was extracted from the mathematics portion of the OpenThoughts dataset (sourced from DeepSeek-R1 outputs), filtered to exclude responses longer than 16k tokens to avoid training on truncated paths. Short CoT data was sourced from the Numina-Math dataset.
- Evaluation Benchmarks: The models were tested across four difficult mathematical reasoning benchmarks: AIME24, AMC23, MATH500, and OlympiadBench.
Key Insights and Ideas
- The Representational Momentum Link: The core "aha!" moment is that cyclical reasoning isn't just a surface-level text repetition issue; it is deeply rooted in the model's internal geometry. When adjacent tokens have highly similar hidden representations, the model lacks the representational momentum to break out of its current state, causing it to loop.
- Long CoT Demands Higher LoRA Ranks: While a low rank (like $r=32$) is typically sufficient for standard instruction tuning or short CoT tasks, long CoT distillation requires much higher ranks (such as $r=256$) to mitigate looping and match full fine-tuning performance.
- FFN as Multi-Key Retrieval: Mathematically, the authors show that Shift-FFN transforms the standard FFN (which acts as an unnormalized key-value memory) from a single-key retrieval mechanism into a multi-key retrieval mechanism, explicitly conditioning the current token's memory lookup on the immediate past token.
Key Results
- Higher Accuracy, Fewer Loops: Integrating Shift-FFN consistently improved performance across multiple model families (Qwen2.5-3B, Llama3.1-8B, Qwen2.5-7B). For instance, a Qwen2.5-7B model trained with LoRA ($r=256$) plus Shift-FFN achieved an average accuracy of 51.2%, outperforming both standard LoRA (50.4%) and full fine-tuning (49.3%).
- Reduced Length Exceedance: Shift-FFN successfully reduced the overall cyclical reasoning rate ($P_E$) from 15.0% down to 12.7% for the 7B model.
- Architecture > Parameter Count: To prove the gains weren't just from adding parameters, the authors compared Shift-FFN ($r=256$) against a standard LoRA model scaled up to match the exact same parameter count ($r=296$). Shift-FFN still won comfortably (51.2% vs 50.6% accuracy), demonstrating that dynamically editing representations via token shifting is fundamentally superior to simply adding low-rank capacity.
Limitations and Future Work
- Scale Constraints: Due to computational resource limits, the authors did not validate Shift-FFN on massive datasets (e.g., >1M examples) or larger model scales (e.g., 32B or 70B parameter models).
- Mechanistic Depth: While the paper establishes a clear correlation between low adjacent token divergence and cyclical reasoning, a deeper causal explanation of why the hidden states collapse into these tight, repetitive trajectories remains an open question for future mechanistic interpretability research.
Summary updated