TL;DR
This paper introduces Learned Decoding Adapters, lightweight reinforcement learning policies that dynamically adjust LLM sampling strategies (like temperature and top-$p$) at inference time based on the specific prompt and available compute budget. By treating decoding as a control problem over a frozen language model, the authors achieve up to a 10.2% absolute improvement in Pass@1 accuracy on complex reasoning tasks without any fine-tuning of the underlying model.
What Problem Does This Paper Address?
When generating text or code from Large Language Models (LLMs), standard practice relies on fixed decoding hyperparameters—such as a constant temperature, top-$k$, or top-$p$—applied uniformly across all prompts and tokens. However, reasoning tasks are highly heterogeneous: some prompts are much harder than others, and uncertainty is often concentrated on a few critical "forking" tokens.
Using a static decoding strategy forces a sub-optimal trade-off between exploration (high creativity/stochasticity) and exploitation (deterministic/greedy decoding). Furthermore, standard setups ignore inference-time constraints like token or parallel sampling budgets, leading to a train-test mismatch when models are deployed under varying resource limits.
Methods
The authors keep the base LLM frozen and train lightweight Learned Decoding Adapters from scratch using policy-gradient reinforcement learning (REINFORCE). Crucially, they use verifiable terminal rewards (e.g., whether a math answer or code block is actually correct) rather than relying on noisy learned reward models or human preferences.
They propose two distinct granularities of control:
- Sequence-Level Adaptation (Contextual Bandit): For a given prompt and parallel sampling budget ($B$), the adapter selects a single optimal decoding configuration from a data-driven action space to use for the entire generation.
- Token-Level Adaptation (POMDP): At each individual token step, the adapter observes the model's internal hidden states and the remaining token budget ($b_t$), dynamically adjusting the sampling temperature.
To stabilize token-level training, they filter out noisy prompts and mask out tokens where the next-token probability is already highly concentrated ($>0.95$).
Datasets
The framework is evaluated on challenging reasoning benchmarks:
- MATH: Competition-style math problems requiring multi-step reasoning.
- CodeContests: Algorithmic programming problems.
- AIME 2025: A highly difficult mathematical reasoning dataset used strictly for out-of-domain generalization testing (no additional tuning was performed).
Key Insights and Ideas
- Stochasticity as a Learnable Control Surface: Instead of trying to change what the model knows via expensive fine-tuning, we can significantly boost performance just by learning how to sample from its existing distribution.
- Budget-Awareness Matters: Explicitly conditioning the adapter on the remaining compute budget allows it to adapt its risk profile. With a large budget, it explores diverse paths; under tight constraints, it defaults to safer, near-greedy strategies.
- Entropy Heuristics Aren't Enough: An ablation study where the adapter only observed token entropy (instead of full hidden states) performed significantly worse. This proves that simple rule-based heuristics (like "turn up temperature when entropy is high") cannot capture the nuanced context needed for optimal decoding.
Key Results
- MATH Benchmark: The token-level adapter achieved a massive 10.2% absolute increase in Pass@1 accuracy over the best static baseline under a mixed Chain-of-Thought (CoT) setting. The sequence-level adapter also yielded consistent 2–3% gains under fixed parallel sampling budgets.
- CodeContests: Under mixed CoT prompting, the sequence-level adapter improved Pass@1 accuracy by 4.90% absolute (a 33.11% relative improvement) when budget-conditioned.
- Generalization: When the adapter trained on MATH was evaluated directly on AIME 2025, it improved thinking-mode performance from 65.6% to 71.1%, demonstrating that the learned strategy-selection policy transfers well to unseen distributions.
Limitations and Future Work
- Discrete Action Space: The current implementation restricts the adapters to a small, discrete set of pre-selected decoding configurations or temperatures. Moving to continuous parameter spaces could offer finer control but introduces optimization challenges.
- Frozen Base Model: While keeping the LLM frozen makes the method lightweight, joint or alternating training of the adapter and the underlying model could potentially yield even stronger synergies.
- Expanded Control Surfaces: The authors suggest extending the action space to include structural inference controls, such as dynamically triggering early stopping, adaptive termination, or allocating compute within tree-search algorithms.
Summary updated