TL;DR
Base pre-trained language models often perform poorly on benchmarks not because they lack knowledge, but because standard decoding forces them into "text continuation" mode rather than "task-solving" mode. This paper introduces Energy-Based Decoding (EBD), a training-free framework that uses a lightweight reward model and a clever Metropolis-Hastings sampling trick to unlock task-oriented behavior from frozen base models at inference time with minimal computational overhead.
What Problem Does This Paper Address?
When we evaluate a base (pre-trained) LLM, we typically use task-oriented prompts (e.g., "Solve this math problem: ..."). However, because these models are trained purely to predict the next token on raw internet text, they often fail to recognize the prompt as a task. Instead of answering, they might simply repeat the prompt, write a similar question, or trail off into irrelevant text.
This creates a "benchmark mismatch" where a model's true latent capabilities are underestimated due to decoding failures. While post-training techniques like Supervised Fine-Tuning (SFT) or Reinforcement Learning from Human Feedback (RLHF) fix this behavior, they alter the model's parameters, making it impossible to isolate what the base model actually learned during pre-training. Existing inference-time alternatives either blindly sharpen token probabilities (which can amplify the wrong generation mode) or rely on expensive independent sampling (like Best-of-N), which is too slow for benchmark-scale evaluation.
Methods
The authors propose Energy-Based Decoding (EBD), which frames decoding as sampling from a reward-tilted posterior distribution. It treats the frozen pre-trained model as a prior and combines it with an external reward model (RM) that acts as an energy function to steer the text toward high-utility answers.
To make this practical without retraining the LLM, EBD implements a two-stage block-wise Metropolis-Hastings (MH) sampler:
- Stage I: Initialization: EBD samples a small pool of candidate responses (typically just 4) from the base model and selects the one with the highest prompt-level reward advantage to serve as the starting state.
- Stage II: Block-wise MH Refinement: The current response is partitioned into token blocks. EBD randomly selects a cut point, keeps the prefix fixed, and regenerates the remaining suffix using the base model's conditional distribution.
The mathematical breakthrough here is Proposal-Prior Cancellation. Because the new suffix is proposed directly from the base model's own conditional prior, the complex prior likelihood terms completely cancel out in the MH acceptance ratio. As a result, the acceptance rule simplifies to a straightforward comparison of reward scores. This eliminates the massive computational bottleneck of having to recalculate full-sequence token probabilities under the base model at every step.
Datasets
The authors evaluated EBD across five prominent open-source base models (including Llama-3-8B, Mistral-7B-v0.3, Qwen2.5-7B, Qwen3-8B-Base, and Olmo-3-1025-7B) using six diverse benchmarks:
- Objective Reasoning Tasks: GPQA (graduate-level science), Math500 (mathematics), and HumanEval (code generation).
- Subjective/Open-Ended Tasks: AlpacaEval 2.0 (instruction following), MT-Bench (multi-turn conversation), and WritingBench (open-ended writing proficiency).
Key Insights and Ideas
- Steering over Sharpening: Traditional decoding interventions try to sharpen the model's existing probability distribution (e.g., lowering temperature or greedy search). However, if the base model's most likely mode is a plain text continuation, sharpening just makes it fail more confidently. EBD uses an external reward model to actively steer the generation into a task-answering mode.
- The Knowledge is Already There: EBD demonstrates that base models inherit massive task-solving capabilities directly from pre-training; they simply lack the behavioral trigger to surface them under standard greedy decoding.
- Zero-Parameter Alignment: EBD achieves behavioral alignment with instruction-tuned models purely at inference time, proving that task alignment can be decoupled from parameter updates.
Key Results
- Massive Performance Leaps: On AlpacaEval 2.0, EBD boosted Qwen3-8B-Base's win rate from a baseline of 8.8 to 44.5—a massive +405% relative improvement in instruction-following quality.
- Objective Task Gains: Across objective reasoning benchmarks, average scores jumped significantly; for instance, Qwen2.5-7B's average score rose from 0.398 to 0.557.
- Dramatic Speedups: Compared to prior MCMC decoding methods like Power Sampling, EBD is highly efficient, reducing per-question latency by 17.6× on Mistral-7B for Math500.
- Robust to Reward Model Scale: EBD is highly robust to the size of the guide model. Replacing an 8B reward model with a lightweight 0.6B reward model yielded nearly identical accuracy while cutting video memory requirements almost in half (from 29.6 GB to 16.4 GB).
Limitations and Future Work
- Inference Overhead: Although EBD is significantly faster than previous search or MCMC baselines, it still requires multiple refinement steps (12 steps by default), making it inherently slower than a single-pass standard greedy decode.
- Dependency on Reward Quality: The framework's success is fundamentally bounded by the accuracy of the external reward model. If the reward model is prone to reward hacking or poor calibration, EBD will inadvertently steer the generation into low-quality states.
- Multi-turn Scaling: The current implementation and evaluation focus primarily on single-turn task execution; extending this efficiently to long, multi-turn interactive dialogues remains an open area for future research.
Summary updated