Skip to main content
QUICK REVIEW

[Paper Review] RRHF: Rank Responses to Align Language Models with Human Feedback without tears

Zheng Yuan, Hongyi Yuan|arXiv (Cornell University)|Apr 11, 2023
Topic ModelingComputer Science34 citations
TL;DR

RRHF ranks multiple sampled responses by their log-probability under the model and uses ranking loss plus supervised fine-tuning to align language models with human preferences, using only 1–2 models and various sources of responses. It achieves PPO-parity performance with simpler implementation and training requirements.

ABSTRACT

Reinforcement Learning from Human Feedback (RLHF) facilitates the alignment of large language models with human preferences, significantly enhancing the quality of interactions between humans and models. InstructGPT implements RLHF through several stages, including Supervised Fine-Tuning (SFT), reward model training, and Proximal Policy Optimization (PPO). However, PPO is sensitive to hyperparameters and requires multiple models in its standard implementation, making it hard to train and scale up to larger parameter counts. In contrast, we propose a novel learning paradigm called RRHF, which scores sampled responses from different sources via a logarithm of conditional probabilities and learns to align these probabilities with human preferences through ranking loss. RRHF can leverage sampled responses from various sources including the model responses from itself, other large language model responses, and human expert responses to learn to rank them. RRHF only needs 1 to 2 models during tuning and can efficiently align language models with human preferences robustly without complex hyperparameter tuning. Additionally, RRHF can be considered an extension of SFT and reward model training while being simpler than PPO in terms of coding, model counts, and hyperparameters. We evaluate RRHF on the Helpful and Harmless dataset, demonstrating comparable alignment performance with PPO by reward model score and human labeling. Extensive experiments show that the performance of RRHF is highly related to sampling quality which suggests RRHF is a best-of-n learner. Codes available at https://github.com/GanjinZero/RRHF.

Motivation & Objective

  • Motivate a simpler RLHF alternative to PPO for aligning LLMs with human preferences.
  • Propose RRHF, which uses ranking over log-probabilities of multiple responses from varied sources.
  • Show that RRHF achieves comparable alignment to PPO with fewer models and hyperparameters.
  • Demonstrate RRHF's effectiveness on Anthropic’s Helpful and Harmless dataset and analyze sampling quality impact.

Proposed method

  • Sample multiple responses from diverse sources (e.g., model, other LLMs, human experts).
  • Compute the log-probability of each response under the current model as a length-normalized score p_i (log P_pi(y_i|x,y_i<t)).
  • Optimize with a ranking loss L_rank that encourages higher p_i for higher human-reward r_i (L_rank = sum_{r_i<r_j} max(0, p_i - p_j)).
  • Inject a supervised fine-tuning loss L_ft using the highest-reward response to keep fidelity to instruction following.
  • Total loss is L = L_rank + L_ft, with no margin terms in ranking and no need for a separate value model or KL term.
  • RRHF can be viewed as an extension of SFT and a lightweight alternative to PPO, avoiding multiple models and complex hyperparameter tuning.

Experimental results

Research questions

  • RQ1Can RRHF achieve comparable alignment to PPO using ranking over log-probabilities with minimal model counts?
  • RQ2How does the quality of sampled responses affect RRHF performance?
  • RQ3Can RRHF leverage diverse sources (self, other LLMs, humans) to learn human-preferred rankings?
  • RQ4Is RRHF simpler to implement and scale compared to PPO while maintaining similar results?

Key findings

  • RRHF with diverse sampling (DP or SP) reaches reward levels on par with PPO on the HH dataset.
  • RRHF performance scales with the quality of sampled responses and approaches the max reward of the sampled set.
  • RRHF requires only 1–2 models and significantly less coding and hyperparameter tuning than PPO.
  • Ranking loss is essential; removing it degrades performance.
  • Iterative training (RRHF IP-2) further improves human-evaluation outcomes compared to single-pass RRHF.
  • A Wombat model trained with RRHF using ChatGPT, InstructGPT, LLaMA, and Alpaca samples can surpass SFT baselines under similar resources.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.