Adaptive Decoding via Test-Time Policy Learning for Self-Improving Generation
Organizations: UC San Diego San Diego, CA · Plastic Labs San Jose, CA · IBM Research Cambridge, MA · IBM Research San Jose, CA
Abstract
Decoding strategies largely determine the quality of Large Language Model (LLM) outputs, yet widely used heuristics such as greedy or fixed temperature/top-p decoding are static and often task-agnostic, leading to suboptimal or inconsistent generation quality across domains that demand stylistic or structural flexibility. We introduce a reinforcement learning-based decoder sampler that treats decoding as sequential decision-making and learns a lightweight policy to adjust sampling parameters at test-time while keeping LLM weights frozen. We evaluated summarization datasets including BookSum, arXiv, and WikiHow using Granite-3.3-2B and Qwen-2.5-0.5B. Our policy sampler consistently outperforms greedy and static baselines, achieving relative gains of up to +88% (BookSum, Granite) and +79% (WikiHow, Qwen). Reward ablations show that overlap-only objectives underperform compared to composite rewards, while structured shaping terms (length, coverage, repetition, completeness) enable stable and sustained improvements. These findings highlight reinforcement learning as a practical mechanism for test-time adaptation in decoding, enabling domain-aware and user-controllable generation without retraining large models.
Figures & tables
| Granite-3.3-2B | Qwen-2.5-0.5B | |||||
|---|---|---|---|---|---|---|
| WikiHow | arXiv | BookSum | WikiHow | arXiv | BookSum | |
| Greedy | 0.333 | 0.220 | 0.147 | 0.114 | 0.154 | 0.014 |
| Static | 0.369 | 0.275 | 0.212 | 0.140 | 0.174 | 0.083 |
| RL (Proposed) | 0.390 | 0.353 | 0.277 | 0.204 | 0.226 | 0.147 |
| vs Greedy (%) | +17.17 | +60.45 | +88.44 | +78.95 | +46.75 | +950.00 |
| vs Static (%) | +5.69 | +28.36 | +30.66 | +45.71 | +29.89 | +77.11 |
| Reward Variant | PPO | Greedy | Static | vs Greedy (%) | vs Static (%) | Early Late (%) |
|---|---|---|---|---|---|---|
| ROUGE-only | 0.169 | 0.158 | 0.170 | +6.96 | -0.59 | +15.38 |
| Core shaping | 0.448 | 0.335 | 0.400 | +33.73 | +12.00 | -4.56 |
| No coverage bonus | 0.349 | 0.219 | 0.275 | +59.36 | +26.91 | +24.91 |
| Soft repetition penalty | 0.503 | 0.431 | 0.462 | +16.72 | +8.88 | +6.81 |
| Sigmoid scaling | 0.382 | 0.302 | 0.323 | +26.49 | +18.27 | -4.27 |
| Proposed (ours) | 0.353 | 0.220 | 0.275 | +60.45 | +28.36 | -4.38 |