TL;DR
This paper introduces RELC, a novel framework that uses a Large Language Model (LLM) as a "critic" to provide dense, step-by-step rewards during reinforcement learning (RL) for text generation. This approach tackles the problem of sparse rewards in RL, significantly improving sample efficiency and overall performance across tasks like sentiment control, detoxification, and summarization.
What Problem Does This Paper Address?
Reinforcement learning (RL) is a powerful tool for aligning language models (LLMs) with human preferences, especially when direct gradient-based optimization is difficult. However, a major bottleneck in RL for text generation is the sparsity of reward signals. Typically, an LLM receives a single reward only after generating an entire piece of text (e.g., a sentence or paragraph). This makes it hard for the model to learn which specific tokens or phrases contributed to the final reward, leading to inefficient and unstable training. Existing solutions like reward shaping or manual annotation are often complex, costly, or task-specific.
Methods
The core innovation of RELC is the introduction of a "critic LLM" that works alongside the "policy LLM" (the text generator). The critic LLM, guided by the task description, the policy LLM's output, and the external reward, generates intrinsic rewards for intermediate steps of the generation process. These intrinsic rewards are then combined with the sparse extrinsic reward from the environment into a dense reward signal.
The framework is flexible and can be implemented in two main ways:
- Separate Policy and Critic: A smaller policy LLM is paired with a more powerful critic LLM (e.g., GPT-2 large as policy, GPT-3.5 as critic).
- Self-Critique: A single, more capable LLM (e.g., Llama 2) acts as both the policy and the critic.
The combined reward signal is then used to train the policy LLM using standard policy gradient methods, specifically Proximal Policy Optimization (PPO). The critic LLM's parameters are kept frozen during training.
Datasets
The paper evaluates RELC on three tasks using the following datasets:
- Sentiment Control: IMDB dataset for training and OpenWebText (OWT) Corpus for testing.
- LM Detoxification: REALTOXICITYPROMPTS (RTP) benchmark.
- Summarization: Reddit TL;DR dataset.
No new benchmarks were introduced; existing, well-established datasets were used.
Key Insights and Ideas
- LLMs as Critics for Dense Rewards: The most significant insight is that LLMs, with their strong understanding of language and context, can effectively act as critics to provide granular, step-by-step feedback. This bypasses the need for manual annotation or complex reward engineering.
- Bridging the Sparse Reward Gap: RELC directly addresses the temporal credit assignment problem in RL by providing intermediate rewards, making learning more efficient and stable.
- Improved Sample Efficiency: The dense rewards from the critic LLM allow the policy model to learn much faster, requiring fewer training samples to reach a desired performance level.
- Alignment with Human Preferences: By combining intrinsic rewards with extrinsic rewards (often derived from human feedback or preferences), the model is better guided towards generating outputs that align with desired qualities.
Key Results
RELC demonstrated significant improvements across all tested tasks:
- Sentiment Control: RELC achieved better sample efficiency and outperformed baselines in steering towards positive sentiment, with minimal impact on fluency.
- LM Detoxification: The framework significantly reduced toxic generations compared to all baselines, while maintaining fluency and diversity. The self-critique setting with Llama 2 also outperformed a prompting-based method.
- Summarization: RELC achieved higher preference scores and better sample efficiency compared to PPO baselines, indicating summaries that are more aligned with human judgment. Human evaluations also showed RELC's superiority in coverage, coherence, and factuality.
Limitations and Future Work
- Critic Model Size: The framework's effectiveness relies on the critic LLM being sufficiently capable. This might limit its applicability in resource-constrained environments.
- API Latency: When using critic LLMs via APIs, training duration can be extended due to network delays.
- Fixed Critic: The current approach keeps the critic LLM fixed during training. As the policy model improves, the critic's task becomes harder. Future work could involve fine-tuning the critic model to adapt to the evolving policy.
- Computational Overhead: While RELC improves sample efficiency, it does introduce additional computational cost due to the critic LLM. However, the paper shows that RELC achieves better performance than baselines for the same amount of computation (FLOPs).
Summary updated