Abstract
Large language models (LLMs) fine-tuned with reinforcement learning from human feedback (RLHF) have been used in some of the most widely deployed AI models to date, such as OpenAI's ChatGPT or Anthropic's Claude. While there has been significant work developing these methods, our understanding of the benefits and downsides of each stage in RLHF is still limited. To fill this gap, we present an extensive analysis of how each stage of the process (i.e. supervised fine-tuning (SFT), reward modelling, and RLHF) affects two key properties: out-of-distribution (OOD) generalisation and output diversity. OOD generalisation is crucial given the wide range of real-world scenarios in which these models are being used, while output diversity refers to the model's ability to generate varied outputs and is important for a variety of use cases. We perform our analysis across two base models on both summarisation and instruction following tasks, the latter being highly relevant for current LLM use cases. We find that RLHF generalises better than SFT to new inputs, particularly as the distribution shift between train and test becomes larger. However, RLHF significantly reduces output diversity compared to SFT across a variety of measures, implying a tradeoff in current LLM fine-tuning methods between generalisation and diversity. Our results provide guidance on which fine-tuning method should be used depending on the application, and show that more research is needed to improve the tradeoff between generalisation and diversity.
Introduction
The standard pipeline for training state-of-the-art Large Language Models (LLMs) involves three distinct stages: Pretraining, Supervised Fine-Tuning (SFT), and Reinforcement Learning from Human Feedback (RLHF). While this recipe has produced highly capable assistants, the specific contributions of each stage to the model's final behavior remain poorly understood. This research investigates two critical dimensions of this process:
- Generalization: Does RLHF improve performance on out-of-distribution (OOD) prompts that differ significantly from the training data?
- Diversity: Does the optimization for human preferences lead to "mode collapse," where the model sacrifices creative variety for a single high-reward style?
Methodology
The study compares three primary fine-tuning strategies: SFT, RLHF (using PPO), and Best-of-N (BoN) sampling. Evaluations were conducted using LLaMa-7B and OPT models on text summarization and instruction following tasks. Performance was measured using GPT-4 as a proxy for human judgment, while diversity was assessed through semantic, logical, and syntactic metrics.
Key Results and Insights
Superior Generalization of RLHF
A primary finding is that RLHF significantly outperforms SFT on OOD tasks. As the distribution shift between training and testing increases, the performance gap widens. In the "Sequential Instructions" task—which involves complex, multi-step prompts—RLHF maintained high performance while SFT's performance dropped significantly. This suggests that RLHF helps models learn the underlying intent of a task rather than just memorizing surface-level patterns.
The Diversity-Performance Tradeoff
While RLHF excels at generalization, it acts as a "diversity killer." RLHF models exhibit significant mode collapse, narrowing their output distribution toward a single "high-reward" style. This collapse is observed both per-input (repetitive responses to the same prompt) and across-input (similar phrasing across different prompts). Interestingly, increasing the KL penalty—intended to keep the RL model close to the SFT baseline—did not recover diversity; it only degraded overall performance.
Best-of-N as an Alternative
In summarization tasks, BoN (with $N=16$) often generalized better than RLHF. However, BoN's high computational cost during inference makes RLHF more practical for real-time deployment.
Conclusion and Future Work
The research highlights a fundamental tradeoff in current LLM fine-tuning: RLHF provides robust generalization at the cost of output diversity. This suggests that for creative domains or red-teaming, SFT or BoN might be preferable. Future research should focus on developing RL algorithms that can simultaneously optimize for both quality and diversity.
Summary updated