Beyond Sparse Rewards: Enhancing Reinforcement Learning with Language Model Critique in Text Generation

Meng Cao, Lei Shu, Lei Yu, Yun Zhu, Nevan Wichers, Yinxiao Liu, Lei Meng · DOI

Abstract

Reinforcement learning (RL) can align language models with non-differentiable reward signals, such as human preferences. However, a major challenge arises from the sparsity of these reward signals - typically, there is only a single reward for an entire output. This sparsity of rewards can lead to inefficient and unstable learning. To address this challenge, our paper introduces an novel framework that utilizes the critique capability of Large Language Models (LLMs) to produce intermediate-step rewards during RL training. Our method involves coupling a policy model with a critic language model, which is responsible for providing comprehensive feedback of each part of the output. This feedback is then translated into token or span-level rewards that can be used to guide the RL training process. We investigate this approach under two different settings: one where the policy model is smaller and is paired with a more powerful critic model, and another where a single language model fulfills both roles. We assess our approach on three text generation tasks: sentiment control, language model detoxification, and summarization. Experimental results show that incorporating artificial intrinsic rewards significantly improve both sample efficiency and the overall performance of the policy model, supported by both automatic and human evaluation.

Introduction: The Sparse Reward Problem

Reinforcement Learning (RL) has become the standard paradigm for aligning Large Language Models (LLMs) with human values and specific task requirements, often through Reinforcement Learning from Human Feedback (RLHF). However, applying RL to text generation faces a significant hurdle: the sparse reward problem. In a typical setup, a model generates a complete sequence, and the environment provides a single scalar reward at the very end.

This creates a severe temporal credit assignment problem. When a model receives a low score for a paragraph, it is unclear which specific words or sentences were responsible for the failure. Was it the opening hook, a specific toxic phrase in the middle, or the overall concluding tone? Standard RL algorithms struggle to disentangle these signals, leading to slow convergence and training instability.

The RELC Framework: Dense Feedback via LLM Critique

To address this, we propose RELC (Rewards from Language model Critique). The core idea is to leverage the inherent capability of LLMs to critique text to generate dense, intermediate feedback during the training process. Instead of relying solely on a single end-of-sequence reward, RELC introduces a Critic LM that provides "intrinsic" rewards at the token or span level.

The RELC framework workflow: A Critic LLM identifies specific positive and negative spans in a generated trajectory to produce dense, token-level intrinsic rewards.

How RELC Works

  1. Generation: The Policy LM (the model being optimized) generates a text sequence.
  2. Critique: The Critic LM analyzes the sequence and identifies specific spans that align with or violate the task objectives. For instance, in a detoxification task, the Critic pinpoints toxic phrases.
  3. Reward Mapping: These identified spans are converted into token-level intrinsic rewards ($r^{in}$). Tokens within positive spans receive a +1, while those in negative spans receive a -1.
  4. Hybrid Optimization: The final reward used for Proximal Policy Optimization (PPO) is a weighted combination of the standard extrinsic reward ($r^{ex}$) from the environment and the new intrinsic reward ($r^{in}$): $r = \alpha_1 r^{ex} + \alpha_2 r^{in}$.

We explored two primary configurations: a Strong Critic setup (GPT-2 Large policy with a GPT-3.5 critic) and a Self-Critique setup (Llama 2 7B acting as both policy and critic).

Experimental Results and Discussion

We evaluated RELC across three challenging text generation tasks: sentiment control (IMDB/OWT), detoxification (RealToxicityPrompts), and summarization (Reddit TL;DR).

Performance Gains and Sample Efficiency

RELC consistently outperformed standard PPO baselines across all metrics. In detoxification, RELC reduced the probability of toxic content generation to 0.7%, a significant improvement over the 4.4% achieved by standard PPO. In sentiment control tasks starting from negative prompts, RELC achieved a 59.06% positive continuation rate, compared to PPO's 43.13%.

Comparison of training efficiency: Combining extrinsic and intrinsic rewards (RELC) leads to faster convergence and higher sentiment scores compared to using extrinsic rewards alone.

As shown in the training curves, the inclusion of intrinsic rewards drastically improves sample efficiency. The model learns to navigate the reward landscape much faster because the feedback is localized and immediate. Interestingly, the "Intrinsic Only" baseline also performs remarkably well, suggesting that the LLM's critique capability is a powerful signal even in the absence of external environment rewards.

Human Evaluation and Summarization

In the summarization task, RELC-generated summaries were preferred by humans, achieving a preference score of 3.88, outperforming both PPO (3.25) and Supervised Fine-Tuning (2.34). This indicates that the dense feedback from the Critic LM helps the policy capture the nuances of high-quality summarization that sparse rewards often miss.

Conclusion

The RELC framework demonstrates that the "critique" ability of LLMs can be effectively harnessed to solve the credit assignment problem in RL for text generation. By transforming sparse environment signals into dense, token-level rewards, we can train more aligned and efficient models. Future work will focus on dynamic critics that evolve alongside the policy and extending this framework to more complex reasoning tasks where defining "good" spans is more challenging.

Summary updated

BibTeX
@misc{cao2024beyond,
  author = {Meng Cao and Lei Shu and Lei Yu and Yun Zhu and Nevan Wichers and Yinxiao Liu and Lei Meng},
  title = {{Beyond Sparse Rewards: Enhancing Reinforcement Learning with Language Model Critique in Text Generation}},
  year = {2024},
  eprint = {2401.07382},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.07382},
}
Figure