TL;DR
Standard inference-time alignment methods for large language models (LLMs) waste computational resources by treating every part of a response with equal importance. This paper introduces AdaSearch, a blockwise decoding strategy that front-loads the compute budget onto the critical initial tokens of a response, boosting alignment win-rates by over 10% across safety, sentiment, and reasoning tasks without increasing total compute.
What Problem Does This Paper Address?
Aligning LLMs with human values typically relies on resource-heavy fine-tuning (like RLHF or DPO) or inference-time methods like Best-of-N sampling. However, existing inference-time techniques allocate computational effort uniformly across the entire generation process.
The authors argue that this uniform allocation is highly inefficient. For many alignment tasks, the initial tokens of a response are disproportionately more critical because they establish the trajectory of the output. If a model makes a misstep in its opening sentence—such as failing to refuse a harmful prompt or setting the wrong emotional tone—no amount of downstream compute can salvage the alignment quality.
Methods
The authors propose Adaptive Blockwise Search (AdaSearch), a training-free, gradient-free decoding strategy that generates responses in fixed-size token blocks (segments) and dynamically allocates a fixed compute budget using a sampling schedule ($\alpha$):
- Decay Schedule (AdaSearch-Decay): Instead of sampling every block an equal number of times, this approach front-loads the compute budget. It generates a large number of candidate samples for the first block to secure a safe, well-aligned opening trajectory, and then progressively decays the number of samples for subsequent blocks.
- AdaBeam: To demonstrate the generality of this paradigm, the authors also extend it to tree-search algorithms via an adaptive, reward-guided beam search where the beam width shrinks over successive blocks.
Selection at each block is guided by a Process Reward Model (PRM), which scores intermediate text chunks rather than waiting for the entire response to finish.
Datasets
The method was comprehensively evaluated across eight LLMs using four diverse standard benchmarks:
- HH-RLHF: Anthropic's Helpful and Harmless dataset for safety alignment.
- HarmfulQA: A dataset containing socially biased or dangerous questions to evaluate toxicity mitigation.
- IMDb: Movie reviews used for controlled positive sentiment generation.
- GSM-8K: Grade-school math problems to test multi-step logical reasoning.
Key Insights and Ideas
- The Reality of Early Uncertainty: By analyzing reward scores, the authors discovered a sharp 46% drop in score variance from block 1 to block 2, and an overall decrease of over 75% by block 4. This empirical evidence proves that models face the highest uncertainty at the very beginning of a response, strongly justifying the need to concentrate search efforts there.
- Early Blocks Predict Final Success: The authors found that partial rewards from early blocks are highly correlated with the final complete response reward (climbing to a Pearson correlation of 0.97 by block 3). This validates the blockwise selection approach.
- Decay Consistently Beats Growth: Across almost all tasks, a search strategy that prioritizes initial tokens (Decay) consistently outperformed uniform allocation (Uniform) and strategies that prioritize later tokens (Growth). Even in complex mathematical reasoning, avoiding early missteps proved more critical than refining later steps.
Key Results
- Outperforming Best-of-N: Operating under an identical compute budget, AdaSearch-Decay improved win-rates by over 10% absolute points relative to standard Best-of-N baselines for harmlessness, sentiment control, and math. On the GSM-8K math benchmark, it boosted Mistral-7B's win-rate by over 23% absolute points.
- Surpassing Fine-Tuning Baselines: On the IMDb sentiment task, AdaSearch-Decay applied to base models outperformed Supervised Fine-Tuning (SFT) by over 33% for Mistral-7B. On safety tasks, it similarly outperformed Direct Preference Optimization (DPO).
- David Beats Goliath: Remarkably, equipping small ~7B parameter models (like Mistral-7B or Llama-3.1-8B) with AdaSearch-Decay allowed them to achieve higher alignment quality than the massive Llama-3-405B baseline model.
Limitations and Future Work
- Dependency on PRMs: The success of AdaSearch relies heavily on the quality of the underlying Process Reward Model.
- Reasoning Bottlenecks: While AdaSearch significantly improves reasoning win-rates over baselines, the absolute performance on complex multi-step tasks like GSM-8K remains low for smaller models. The authors hypothesize that this stems from the limitations of current reward models in accurately scoring complex, multi-step logical chains, pointing to more robust logical reward functions as a promising direction for future work.
Summary updated