Abstract: While large language models have proven effective in a huge range of downstream applications, they often generate text that is problematic or lacks a desired attribute. In this paper, we introduce Reward-Augmented Decoding (RAD), a text generation procedure that uses a small unidirectional reward model to encourage a language model to generate text that has certain properties. Specifically, RAD uses the reward model to score generations as they are produced and rescales sampling probabilities to favor high-reward tokens. By using a unidirectional reward model, RAD can cache activations from prior generation steps to decrease computational overhead. Through experiments on generating non-toxic and sentiment-controlled text, we demonstrate that RAD performs best among methods that change only the generation procedure and matches the performance of state-of-the-art methods that involve re-training the language model. We further validate that RAD is effective on very large language models while incurring a minimal computational overhead.
Introduction: Steering Giants with Tiny Guides
Large Language Models (LLMs) are incredibly capable, but they are also notoriously difficult to "steer." Left to their own devices, they might generate toxic content or fail to adhere to a specific sentiment. While techniques like Reinforcement Learning from Human Feedback (RLHF) can bake preferences into a model, they are computationally expensive and inflexible. Once a model is fine-tuned for a specific behavior, it cannot be easily repurposed for another without significant additional training.
Researchers from UNC-Chapel Hill and the University of Toronto have introduced Reward-Augmented Decoding (RAD), a lightweight way to control LLMs at generation time without modifying their underlying weights. RAD acts as a modular guide, allowing a small, efficient model to steer a much larger giant toward desired attributes like non-toxicity or positive sentiment.
The Bottleneck in Controllable Generation
Controllable text generation is the quest to make LLMs follow specific constraints—becoming more polite, more factual, or less biased. Currently, researchers usually choose between two approaches:
- Fine-tuning/RLHF: This involves retraining the model. It is effective but incredibly expensive and lacks modularity.
- Weighted Decoding: These methods modify the probability of the next token during generation using an external "classifier" or "expert." While modular, these are often slow because they require multiple passes through auxiliary models for every single word generated.
Most reward models used for steering are bidirectional (like BERT), meaning they must re-process the entire sentence every time a new word is added. This leads to quadratic complexity ($O(m^2)$) that significantly degrades generation speed. RAD addresses this by utilizing a unidirectional reward model.
Methods: The RAD Workflow
The core innovation of RAD is the use of a unidirectional reward model (specifically a modified GPT-2 Small). Because the reward model is unidirectional—looking only "backwards" at previous tokens—it can leverage KV-caching. When the LLM proposes the next word, the reward model does not need to re-read the whole prompt; it only needs to process the new token. This drops the computational complexity from quadratic to linear ($O(m)$).
The RAD Workflow involves four key steps: 1. Propose: At each step, the base LLM identifies the top-$k$ most likely next tokens. 2. Score: The small reward model calculates a "reward score" for each of those $k$ candidates. 3. Steer: The base LLM’s original logits are shifted by the reward using a "steering intensity" parameter ($\beta$). A higher $\beta$ forces the model to prioritize the reward over its original linguistic preference. 4. Sample: A token is sampled from this new, "steered" distribution.
The reward model itself is trained with a cumulative squared error loss, which encourages it to predict the final reward of a sequence based on any of its prefixes.
Experimental Results and Efficiency
The authors evaluated RAD across two primary domains: Detoxification (using RealToxicityPrompts) and Sentiment Control (using OpenWebText). They found that a 124M parameter model (GPT-2 Small) is perfectly capable of steering a 65B parameter model (LLaMA).
RAD outperformed existing weighted decoding methods like PPLM and GeDi, matching the performance of "gold standard" retraining methods (like PPO and Quark) without the massive training cost. Crucially, RAD is highly efficient. On LLaMA 65B, the computational overhead of RAD was a negligible 3%. In contrast, older methods like PPLM can increase the cost by 4x (400%).
Limitations and Future Work
Despite its efficiency, RAD has some limitations. It scales linearly with $k$ (the number of candidates), meaning memory requirements grow if a very large candidate pool is used. Additionally, a "Tokenization Trap" exists: RAD works best when the reward model and the LLM share the same tokenizer. When steering LLaMA with a GPT-2 based reward model, the different sub-word chunking can introduce noise into the scores.
Future work may involve training "universal" reward models or small adapters to bridge the gap between different vocabularies, as well as testing RAD on more complex instructions and structural constraints.
Summary updated