Introduction
To get the best possible performance out of Large Language Models (LLMs), researchers increasingly rely on test-time scaling—giving the model more compute during inference to explore multiple reasoning paths. A common method is best-of-$n$ sampling, where the model generates $n$ possible answers and a Reward Model picks the best one. However, running a massive LLM $n$ times is computationally expensive and slow.
To speed up standard inference, the field often uses speculative decoding, where a small, fast "draft" model generates text, and the large "base" model verifies it in parallel. The challenge lies in combining these two ideas: how do we perform reward-guided test-time scaling efficiently using speculative decoding? Existing methods, like Reward-guided Speculative Decoding (RSD), rely on heuristics that lack theoretical guarantees. As the number of samples ($n$) grows, these methods often collapse, effectively just outputting the small draft model's distribution and ignoring the base model's superior knowledge.
The authors introduce Guided Speculative Inference (GSI), a fast test-time scaling algorithm that aligns LLM outputs to a reward model using a smaller draft model. By mathematically adjusting the reward scores based on the difference between the draft and base models, GSI provably matches the optimal aligned distribution of the large model while cutting end-to-end latency by up to 28%.
Guided Speculative Inference (GSI)
GSI builds on Soft Best-of-$n$ (S-BoN), a variant of best-of-$n$ that samples proportionally to exponentiated rewards to prevent reward hacking.
At each reasoning step, GSI operates as follows:
- Drafting: Generate $n$ candidate reasoning steps using a small, fast draft model ($\pi_S$).
- The "Tilted" Reward: Instead of just scoring these drafts with the Process Reward Model ($r$), GSI calculates a tilted reward. It adds the reward to the log-likelihood ratio of the base model vs. the draft model: $\tilde{r} = r + \frac{1}{\beta} \log(\pi_B / \pi_S)$.
- Selection: Sample one of the $n$ draft steps using S-BoN based on these tilted rewards.
- Verification: If the tilted reward of the chosen step is above a certain threshold $u$, accept it.
- Fallback: If it falls below the threshold, reject the draft and fall back to generating $n$ steps directly from the heavy base model ($\pi_B$) using standard S-BoN.
Key Insights
- The Mathematical Trick: The optimal reward-aligned distribution of a massive model can be rewritten exactly as a distribution over a small model, provided the reward is adjusted by the log-likelihood ratio between the two. This allows the heavy lifting of sampling to be done on the cheap model.
- Avoiding Draft Collapse: In previous methods like RSD, generating many draft samples (high $n$) almost guarantees finding one with a high reward, even if the base model would never have generated it. GSI's tilted reward naturally penalizes draft samples that the base model thinks are unlikely, maintaining high quality.
- Rejection is a Feature: GSI actively catches when the draft model generates a step that "looks" good to the reward model but is out-of-distribution for the base model. By rejecting these and resampling, it maintains fidelity to the base model's capabilities.
Experimental Results
The authors evaluated GSI on several standard reasoning and math benchmarks, including MATH500, OlympiadBench, Minerva Math, MMLU-STEM, and GSM8K.
- Accuracy: Across different model families (e.g., Qwen2.5-Math 1.5B draft / 7B base, and Qwen3 1.7B draft / 14B base), GSI consistently outperformed RSD and S-BoN on the draft model. It closely approached, and in some settings even surpassed, the accuracy of running S-BoN purely on the expensive base model.
- Speed: GSI achieved up to a 51% increase in throughput (steps generated per second) compared to the base model. This translated to up to a 28% reduction in end-to-end latency.
- Theoretical Guarantees: The authors provide formal proofs showing that as $n$ increases, GSI's output distribution converges to the optimal target distribution (bounded KL divergence), and the expected reward gap goes to zero.
Limitations and Future Work
- Fixed Thresholds: GSI currently uses a static acceptance threshold ($u=0.5$). The optimal threshold actually changes depending on $n$. Developing an adaptive threshold schedule could further improve the accuracy-vs-latency tradeoff.
- Implementation Optimizations: In the current implementation, the verification of draft steps by the Reward Model and the log-likelihood computation by the base model are not fully parallelized. Doing so would yield even greater wall-clock speedups.
- Asymmetric $n$: The algorithm currently generates the same number of samples ($n$) whether it is drafting or falling back to the base model. Future work could explore using a massive $n$ for the cheap draft model and a smaller $n$ for the expensive base model fallback.
Summary updated