Aligning Language Models with Offline Learning from Human Feedback

Jian Hu, Tao Li, June Yong Yang, Chandler ZhouarXiv 2023 · DOI

Abstract

Learning from human preferences is crucial for language models (LMs) to effectively cater to human needs and societal values. Previous research has made notable progress by leveraging human feedback to follow instructions. However, these approaches rely primarily on online learning techniques like Proximal Policy Optimization (PPO), which have been proven unstable and challenging to tune for language models. Moreover, PPO requires complex distributed system implementation, hindering the efficiency of large-scale distributed training. In this study, we propose an offline learning from human feedback framework to align LMs without interacting with environments. Specifically, we explore filtering alignment (FA), reward-weighted regression (RWR), and conditional alignment (CA) to align language models to human preferences. By employing a loss function similar to supervised fine-tuning, our methods ensure more stable model training than PPO with a simple machine learning system (MLSys) and much fewer (around 9%) computing resources. Experimental results demonstrate that conditional alignment outperforms other offline alignment methods and is comparable to PPO.

Introduction

Aligning large language models (LLMs) to be helpful, honest, and harmless is a cornerstone of modern AI development. Traditionally, this alignment is achieved through Reinforcement Learning from Human Feedback (RLHF), specifically using Proximal Policy Optimization (PPO). However, PPO is notoriously difficult to implement and maintain. It requires a complex distributed system to manage multiple models simultaneously—the actor, critic, initial policy, and reward model—leading to significant communication overhead and massive computational requirements. Furthermore, PPO is highly sensitive to hyperparameters, often resulting in unstable training cycles that can collapse without precise tuning.

To address these challenges, researchers at NVIDIA have developed an offline learning framework that aligns LMs without the need for environment interaction. By treating alignment as a supervised learning task, this framework significantly reduces system complexity and resource consumption while maintaining high performance.

The Offline Alignment Framework

The proposed framework transitions the alignment process into an offline pipeline consisting of four distinct stages: Supervised Fine-Tuning (SFT), Reward Model (RM) training, Sample Labeling, and Offline Fine-Tuning.

The offline alignment pipeline, illustrating the transition from SFT and RM training to final model alignment.
  1. Supervised Fine-Tuning (SFT): The base model is trained on high-quality instruction-following data from sources like Open Assistant and Flan v2.
  2. Reward Model (RM) Training: A separate model is trained to rank responses based on human preference datasets, such as the Anthropic Helpful dataset.
  3. Sample Labeling: The RM assigns scores to a large pool of prompts and generated responses, creating a "mixed dataset" for the final alignment phase.
  4. Offline Fine-Tuning: The SFT model is updated using the labeled samples via specialized algorithms that prioritize high-reward outputs.

Alignment Algorithms

Three primary offline algorithms were explored to replace the PPO actor-critic loop:

  • Filtering Alignment (FA): This method filters the dataset to include only the highest-scoring samples (e.g., those with rewards above a specific threshold), performing standard fine-tuning on this elite subset.
  • Reward-Weighted Regression (RWR): RWR utilizes the entire labeled dataset but weights the loss function based on the reward score, ensuring high-quality samples have a dominant influence on the model's parameter updates.
  • Conditional Alignment (CA): This is the most novel approach. During training, a reward token (e.g., <rm_score> 5.0) is prepended to the prompt. The model learns to associate specific output distributions with quality levels. At inference, a high-reward token is used to "ask" the model for a superior response.

Experimental Results

The methods were evaluated using 160 high-quality prompts from the LMSys ChatBot Arena. Performance was measured via both human preference and GPT-4 "judge" rankings across categories like coding, ethics, and reasoning.

Comparative performance of alignment methods based on human and GPT-4 evaluations.

As shown in the results, Conditional Alignment (CA) emerged as the most effective offline method, achieving performance parity with PPO. In many instances, CA produced more structured, detailed, and balanced responses than SFT or FA, which occasionally lacked depth.

Computational Efficiency

The most striking advantage of the offline approach is its efficiency. While PPO required approximately 730 GPU hours on NVIDIA A100s due to its complex multi-node requirements, the entire offline pipeline—including data preprocessing and training—required only 65 GPU hours. This represents a 91% reduction in computational cost, effectively democratizing high-performance alignment for researchers with fewer resources.

Conclusion

Offline learning from human feedback offers a stable, simple, and highly efficient alternative to the "distributed system nightmare" of PPO. Conditional Alignment, in particular, proves that LLMs can effectively navigate their existing knowledge based on quality "dials" when prompted correctly. By reducing the resource budget by over 10x, this framework paves the way for more scalable and accessible model alignment in the future.

Summary updated

BibTeX
@misc{hu2023aligning,
  author = {Jian Hu and Tao Li and June Yong Yang and Chandler Zhou},
  title = {{Aligning Language Models with Offline Learning from Human Feedback}},
  year = {2023},
  eprint = {2308.12050},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.12050},
}
Figure