TL;DR
Large Language Models (LLMs) often produce repetitive or structurally identical responses when asked the same prompt multiple times, even with random sampling. OverRIDE (Reweighting-based Iterative DEcoding) solves this by using lightweight, inference-time adapters to "remember" what was previously generated and dynamically suppress those patterns in subsequent rounds. This significantly boosts output diversity and quality with minimal performance overhead.
The Problem: The Autoregressive "Repetition Rut"
If you’ve ever asked an LLM to generate five different versions of a Python function, you’ve likely noticed a frustrating trend: the model often gives you five versions that are nearly identical, perhaps only changing a variable name or a comment.
This happens because of the autoregressive nature of LLMs. Standard decoding processes treat each generation round as an independent event. Even with stochastic sampling techniques like top-p or top-k, the model is still drawn toward the same high-probability "ruts" in the generation space. It doesn't "learn" from the first response to make the second one different. This lack of diversity is a major bottleneck in tasks like "Best-of-N" sampling for code or mathematical reasoning, where we want the model to explore different logical paths to find the correct solution.
Methods: How OverRIDE Works
The authors introduce OverRIDE, a framework that turns decoding into an iterative, self-correcting process by penalizing previously used semantic patterns.
- The Guide Model: Starting from the second round of generation, the system fine-tunes a "guide model" ($M_{qt}$) on the responses generated in previous rounds. To keep this efficient, they don't fine-tune the whole LLM; instead, they use tiny low-rank adapters (LoRA) specifically on the output heads.
- Iterative Reweighting: The guide model learns the semantic patterns of previous responses. When generating the next response, the system compares the original model's predictions with the guide model's predictions. If the guide model assigns a high probability to a token (meaning "I've seen this pattern before"), OverRIDE penalizes that token.
- The Formula: The new probability distribution is calculated as: $$p_t \propto p \cdot \left(\frac{p}{q}\right)^\lambda$$ Where $p$ is the original distribution, $q$ is the guide model's distribution, and $\lambda$ is a hyperparameter controlling the "strength" of the diversity push.
To make this viable for production systems like vLLM, the authors developed a "synchronized fine-tuning" approach. They process requests in a specific order to reuse the KV cache and update the adapters on-the-fly, allowing for parallel decoding with very low latency.
Key Insights and Results
The researchers evaluated OverRIDE across code generation (HumanEval), mathematical reasoning (MATH500, GSM8K), and story generation (CCNews), using models like the Qwen-2.5 series (3B to 72B) and Mistral-7B.
- Massive Gains in Code and Math: Diversity isn't just about "variety"—it's about finding the right answer. By forcing the model out of its initial (potentially incorrect) logic, OverRIDE significantly improved reasoning metrics. On HumanEval, Qwen-2.5-7B’s
PASS@10jumped from 64.9% to 86.0%. On MATH500, it improved from 72.5% to 87.0%. - The "Entropy Spike": Analysis showed that in the second round of generation, the token entropy (randomness) spikes as the model actively avoids the "easy" path it took in round one. In later rounds, it stabilizes as it finds new, valid regions of the search space.
- Context-Aware Diversity: Unlike simple temperature scaling (which just flattens the whole probability distribution), OverRIDE is surgical. If there is only one mathematically correct answer, the model maintains 100% confidence. It only encourages diversity when multiple valid paths exist.
- Production Ready: Efficiency scales up with model size. Because the adapters are a fixed size, they represent a smaller percentage of the total parameters in larger models. When implemented in a parallel decoding setup on vLLM, the throughput loss was only 6.4% for the 72B model—a negligible cost for such a significant jump in reasoning performance.
Limitations and Future Work
While powerful, OverRIDE comes with a few considerations:
- Safety Alignment: By forcing the model into "low-probability" regions, there is a risk of bypassing safety filters or generating biased content that was suppressed during RLHF. The authors recommend implementing additional safety filters when using high $\lambda$ values.
- Hyperparameter Sensitivity: The optimal $\lambda$ (reweighting strength) varies by model. For example, Mistral-7B was more sensitive to reweighting than Qwen-2.5, requiring a lower $\lambda$ to avoid generating gibberish.
Future directions include exploring how this iterative approach could be used for "self-correction" during a single long-form generation, rather than just across multiple independent responses.
Summary updated