Risk-Averse Finetuning of Large Language Models

Sapana Chaudhary, Ujwal Dinesha, Dileep Kalathil, Srinivas Shakkottai · DOI

Standard Reinforcement Learning from Human Feedback (RLHF) is the current gold standard for aligning Large Language Models (LLMs). However, RLHF typically aims to maximize the expected (average) reward, which can be fundamentally flawed for safety. In an average calculation, a model that is perfect 99% of the time but extremely toxic 1% of the time might still appear high-performing because high scores offset rare failures. In real-world applications, these "tail events" cause the most significant harm.

This paper, presented at NeurIPS 2024, introduces Risk-Averse RLHF (RA-RLHF). By borrowing the concept of Conditional Value at Risk (CVaR) from financial risk management, the authors propose a method to specifically target and mitigate these rare, high-stakes failures.

Methodology: Optimizing for the Tail

The core innovation of RA-RLHF is the integration of CVaR into the Proximal Policy Optimization (PPO) pipeline. Instead of maximizing the mean reward, RA-RLHF minimizes the expected cost of the worst $\alpha$-quantile of outcomes.

Figure 1: Reward distributions and quantile performance across different training stages. The Reward vs Quantile plot (right) shows RA-RLHF significantly lifting the performance of the worst-case trajectories.

To implement this effectively, the authors utilized two key strategies:

  1. CVaR Optimization: The model is instructed to focus specifically on the prompts where it is currently failing the hardest.
  2. Soft-Risk Scheduling: To prevent instability, training begins with a full batch of data (risk-neutral) and gradually narrows the focus to the riskiest trajectories as the model learns the basic task.
  3. KL-Regularization: Standard KL-divergence constraints are maintained to ensure the model does not drift into "reward hacking" or lose linguistic coherence.

Experimental Evaluation

The researchers evaluated RA-RLHF on three primary tasks using models ranging from GPT-2 (117M) to GPT-J (6B):

  • IMDB-Gen: Completing movie reviews while maintaining positive sentiment.
  • Jigsaw-Gen: Completing Wikipedia talk page comments in a non-toxic manner.
  • RealToxicityPrompts: Testing the ability to avoid toxic continuations across diverse prompts.

Key Results and Insights

RA-RLHF consistently outperformed standard RLHF, particularly in the most challenging scenarios. By shifting the objective function from the mean to the tail, the method closes the loophole where average "good" behavior masks dangerous edge cases.

Figure 5: Quantitative comparison of model performance. RA-RLHF achieves the highest sentiment score in the worst-case quantile while maintaining competitive perplexity (PP) and diversity (Dist).
  • Superior Mitigation: In the IMDB sentiment task, when evaluating the "worst" prompts, RA-RLHF achieved a reward of -0.44, vastly outperforming standard RLHF (-1.161) and the supervised fine-tuning (SFT) baseline (-2.465).
  • Robustness: Interestingly, RA-RLHF often improved performance across the entire distribution, not just the tail. This suggests that risk-awareness forces the model to handle difficult edge cases more gracefully in general.
  • Maintained Coherence: Despite the focus on safety, the models remained fluent. Perplexity (PP) measurements showed only marginal increases, indicating that the models did not become "lobotomized" by the safety constraints.

Limitations and Future Work

While effective, the authors note several areas for future exploration. The current study focused on generative completion tasks; future work should investigate application to conversational AI and Question-Answering (Q&A) formats. Additionally, the experiments were limited to English-language datasets. Finally, while the computational complexity is similar to standard RLHF, there is a slight overhead involved in sorting and filtering batches to identify the riskiest trajectories.

Summary updated

BibTeX
@inproceedings{chaudhary2024risk,
  author = {Sapana Chaudhary and Ujwal Dinesha and Dileep Kalathil and Srinivas Shakkottai},
  title = {{Risk-Averse Finetuning of Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=1BZKqZphsW},
}
Figure