Reward-Augmented Decoding: Efficient Controlled Text Generation With a Unidirectional Reward Model

Haikang Deng, Colin Raffel
10/14/2023
91 citations
cs.CL
rlhf-rlvr-dpo

No official code found. Best implementation: r-three/RAD (45 stars, Python, last commit 2025-10-01).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

r-three/RADCommunity100%

Reference implementation for Reward-Augmented Decoding: Efficient Controlled Text Generation With a Unidirectional Reward Model

451PythonOct 14, 20231 years ago

Similar Papers

Cite this paper

@article{deng2023rewardaugmented,
  title  = {Reward-Augmented Decoding: Efficient Controlled Text Generation With a Unidirectional Reward Model},
  author = {Haikang Deng and Colin Raffel},
  year   = {2023},
  eprint = {2310.09520},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.09520v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.09520.svg)](https://codeofpaper.com/paper/2310.09520)

Discussion