Abstract
Aligning Large Language Models (LLMs) with human preferences is a critical step in developing helpful and safe AI assistants. While Reinforcement Learning from Human Feedback (RLHF) has traditionally relied on either complex online methods like Proximal Policy Optimization (PPO) or simpler offline contrastive methods like Direct Preference Optimization (DPO), both have limitations. This paper introduces BRAIn (Bayesian Reward-conditioned Amortized INference), a framework that reframes model alignment as a Bayesian inference problem. By introducing a novel self-normalized baseline to stabilize training signals, BRAIn overcomes the high-variance issues that have historically hindered distribution matching approaches. Experimental results on summarization and dialogue tasks demonstrate that BRAIn significantly outperforms current industry standards.
Introduction
The process of turning a raw, pre-trained LLM into a conversational assistant typically involves Supervised Fine-Tuning (SFT) followed by RLHF. Currently, the field is bifurcated: Online RL methods are powerful but notoriously unstable and computationally expensive, while Offline Contrastive Learning methods like DPO are stable but often limited by their reliance on pairwise comparisons.
A third category, Distribution Matching, seeks to align the model with a target distribution of high-reward responses. Despite its theoretical appeal, distribution matching has struggled to gain traction because its gradients—the signals used to update the model—are often characterized by extreme noise (high variance). BRAIn addresses this fundamental flaw, proving that with the right variance-reduction techniques, distribution matching is a superior paradigm for LLM alignment.
Methodology
The Bayesian Framework
BRAIn treats the alignment process through the lens of Bayesian Inference. The original SFT model is treated as a prior distribution, while the Reward Model (RM), which predicts human preference, acts as the likelihood. The goal is to derive a posterior distribution—a version of the model that prioritizes high-reward text generation while remaining anchored to the original language capabilities of the prior.
Importance Sampling and the Self-Normalized Baseline
Because direct sampling from this ideal posterior is computationally infeasible, BRAIn employs Importance Sampling. The algorithm generates multiple samples from the current model, evaluates them using the reward model, and updates the model parameters to move toward higher-reward samples.
The primary technical innovation in BRAIn is the self-normalized baseline. Previous distribution matching methods suffered from erratic training because their gradient signals were uncentered. BRAIn introduces a mathematical correction that subtracts a specific value from the training signal, effectively canceling out noise without introducing bias. This stabilization allows the model to learn efficiently from a diverse set of samples.
DPO as a Special Case
One of the paper's key theoretical contributions is the proof that DPO is a restricted case of the BRAIn framework. Specifically, if BRAIn is limited to only two samples and utilizes a "winner-takes-all" (argmax) approach rather than a smooth distribution (softmax), it mathematically collapses into the DPO objective. This suggests that BRAIn is a more generalized and flexible version of current preference-learning techniques.
Experimental Setup
The researchers evaluated BRAIn against several baselines, including DPO, DPO-sft, and Rejection Sampling Optimization (RSO), using two primary benchmarks:
- Reddit TL;DR: A summarization task requiring the model to condense long-form posts into high-quality, concise summaries.
- Anthropic HH (Helpful and Harmless): A multi-turn dialogue dataset focused on utility and safety.
The experiments utilized Llama-7b and GPT-J as base models to ensure the findings were consistent across different architectures.
Key Insights
Overcoming Gradient Variance
The study confirms that the historical failure of distribution matching was not a conceptual error but a practical one. By applying the self-normalized baseline, the authors observed a significant drop in gradient variance, leading to stable training and superior performance compared to traditional contrastive methods.
Richer Learning Signals
Unlike DPO, which typically compares a single "chosen" response against a "rejected" one, BRAIn can process a large batch of samples (e.g., $n=32$) simultaneously. This allows the model to learn from a much richer gradient signal. Instead of merely learning that one response is better than another, the model learns the relative quality across a wide spectrum of potential outputs.
The Reward-KL Frontier
Alignment involves a trade-off: maximizing human preference (reward) while minimizing the drift from the original model (KL divergence). BRAIn achieves a more efficient "frontier," providing higher rewards with less distortion to the underlying language model's capabilities than its predecessors.
Results
BRAIn demonstrated consistent superiority across all tested metrics:
- Win Rates: On the Anthropic HH task, BRAIn achieved a 95.4% win rate against human-preferred responses when measured by the training reward model, significantly higher than DPO-sft’s 87.3%.
- LLM-as-a-Judge: To mitigate the risk of "reward hacking," the authors used Mixtral-8x7B as an independent judge. BRAIn maintained its lead, scoring a 74.3% win rate on Anthropic HH, compared to 66.6% for DPO-sft.
- Sample Scaling: Performance scaled positively with the number of samples per prompt. While DPO-style methods showed diminishing returns quickly, BRAIn’s performance continued to improve as the sample count increased to 8–16 samples.
Conclusion and Future Work
BRAIn represents a significant step forward in offline LLM alignment. By solving the variance problem in distribution matching, it offers a more robust and high-performing alternative to DPO. However, the method does involve higher initial computational costs during the data preparation phase due to the requirement for multiple samples per prompt. Future research will explore whether the BRAIn objective can be extended to other domains of probabilistic machine learning and how to further optimize the dependency on reward model accuracy.
Summary updated