Aligning language models with human preferences

Tomasz KorbakarXiv 2024 · DOI

Abstract

As Large Language Models (LLMs) become increasingly integrated into society, ensuring they adhere to human values—a process known as alignment—is paramount. Traditional methods like Reinforcement Learning from Human Feedback (RLHF) often treat alignment as a final fine-tuning stage, leading to issues like distribution collapse and reduced creativity. This paper, based on the doctoral thesis of Tomasz Korbak, proposes a fundamental shift: viewing alignment as a form of Bayesian inference. By integrating human preferences earlier in the model's lifecycle through distribution matching and conditional pretraining, we can develop AI systems that are more robust, diverse, and inherently safer.

Introduction: The Alignment Challenge

The rapid advancement of Artificial Intelligence has brought the "alignment problem" to the forefront of research. Currently, most Large Language Models are trained on massive datasets scraped from the internet. While this provides them with vast knowledge, it also imbues them with the internet's less desirable traits: toxicity, bias, and misinformation.

The industry standard for correcting these behaviors is Reinforcement Learning from Human Feedback (RLHF). However, RLHF is often applied as a "patch" after the model has already been fully trained. This approach suffers from significant drawbacks, most notably distribution collapse. When a model is incentivized solely to maximize a reward score, it tends to converge on a narrow set of "safe" responses, losing the rich diversity and creative potential of the original base model. Furthermore, trying to align a model after it has already learned bad habits is significantly more difficult than teaching it correctly from the start.

Alignment as Bayesian Inference

Tomasz Korbak’s research reframes the alignment problem through the lens of Bayesian statistics. In this framework, the base language model (trained on the internet) acts as a prior distribution. Human preferences are treated as evidence. The goal of alignment is then to calculate the posterior distribution—a model that retains the knowledge of the prior but is conditioned on the evidence of human values.

Korbak demonstrates that the standard RLHF objective is mathematically equivalent to Variational Inference. This insight allows researchers to move beyond simple reward maximization and toward more sophisticated methods of distribution matching.

Methodological Innovations

The thesis introduces several key technical shifts to implement this Bayesian perspective:

  1. Distributional Policy Gradients (DPG): Instead of standard Reinforcement Learning (RL), which seeks to find a single optimal output to maximize a scalar reward, Korbak utilizes Distribution Matching (DM). This forces the model to match a target distribution that balances human preferences with the model's original linguistic fluency, preventing the "boringness" associated with distribution collapse.
  2. Conditional DPG (CDPG): This extension applies distribution matching to conditional tasks such as machine translation and summarization. In these contexts, the "correctness" of an output is strictly tied to the input context. CDPG allows for precise control over output characteristics without sacrificing overall performance.
  3. Pretraining with Human Feedback (PHF): The most radical proposal is moving alignment to the very beginning of the training process. Using Conditional Training, models are taught to associate specific "control tokens" (e.g., <|good|> or <|bad|>) with the quality of text during the initial pretraining phase. This "alignment-by-design" approach makes the resulting models significantly more resilient to adversarial attacks and "red-teaming."

Key Results and Insights

The effectiveness of these methods was validated across several benchmarks:

  • Constraint Following: In translation tasks using the Europarl dataset, the CDPG method increased the model's ability to adhere to specific terminology constraints (e.g., translating "two" as "2") by 116x compared to the base model, without the catastrophic drop in quality seen in standard RL.
  • Toxicity Reduction: Models trained using PHF on the RealToxicityPrompts dataset showed a reduction in undesirable content by up to an order of magnitude compared to standard training.
  • The "Wedding Cake" Analogy: Korbak views alignment as a multi-layered process. Pretraining with feedback is the base, followed by supervised finetuning, then RLHF, and finally prompt engineering. Each layer conditions the model on more specific evidence of human preferences.
  • Efficiency: Conditional training was found to be on the Pareto frontier, offering the best possible trade-off between staying aligned with humans and maintaining the model's raw intelligence and capabilities.

Conclusion and Future Directions

While the Bayesian approach offers a more robust framework for alignment, challenges remain. Human preferences are too complex to be captured by a single scalar reward; future work must represent "moral uncertainty" and diverse viewpoints. Additionally, as models become smarter than humans, we must develop methods for "scalable oversight" to provide feedback on topics humans do not fully understand. By moving alignment from an afterthought to a foundation, this research provides a roadmap for building AI that is safer and more reliable by design.

University of Sussex Logo

Summary updated

BibTeX
@misc{korbak2024aligning,
  author = {Tomasz Korbak},
  title = {{Aligning language models with human preferences}},
  year = {2024},
  eprint = {2404.12150},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.12150},
}
Figure