Pairwise Proximal Policy Optimization: Harnessing Relative Feedback for LLM Alignment

Tianhao Wu, Banghua Zhu, Ruoyu Zhang, Zhaojin Wen, Kannan Ramchandran, Jiantao Jiao

Aligning Large Language Models (LLMs) with human values is a notoriously finicky process. The industry standard, Reinforcement Learning from Human Feedback (RLHF), typically relies on Proximal Policy Optimization (PPO). However, PPO is complex, often unstable, and requires a "value function" that is difficult to train accurately.

In their paper, "Pairwise Proximal Policy Optimization: Harnessing Relative Feedback for LLM Alignment," researchers from UC Berkeley introduce P3O. This new algorithm simplifies the alignment process by ditching absolute reward scores in favor of relative comparisons, leading to more stable training and better performance.

TL;DR

P3O is a trajectory-wise policy gradient algorithm that aligns LLMs using the difference between rewards of response pairs rather than absolute scores. It eliminates the need for complex value function estimation and is theoretically more robust to reward model inconsistencies, outperforming PPO and DPO in human preference alignment.

What Problem Does This Paper Address?

The standard RLHF pipeline involves three stages: Supervised Fine-Tuning (SFT), Reward Modeling, and RL Fine-Tuning (usually via PPO). The authors identify three major headaches with PPO in this context:

  1. Instability: PPO is sensitive to hyper-parameters like reward scaling and normalization.
  2. Reward Inconsistency: Most reward models are trained using Bradley-Terry Loss (BTL), which only cares about the relative difference between two responses. PPO, however, relies on absolute reward values. If you shift all rewards by a constant, the BTL model doesn't change, but PPO's behavior does.
  3. Token-wise Complexity: PPO operates at the token level, requiring a learned "Value Function" ($V$) and "Generalized Advantage Estimation" (GAE) to distribute a single end-of-sentence reward back to every token. This adds significant architectural overhead and noise.

Methods

P3O shifts the paradigm from Absolute Feedback to Relative Feedback.

Figure 1: The figure on the left illustrates the prevalent method for fine-tuning LMs using RL, which relies on Absolute Feedback. In this paradigm, algorithms like PPO has to learn a V function, which capture not only the valuable relative preference information, but also less part, which is the scale of the reward for a given prompt. Contrastingly, the figure on the right presents paradigm for optimizing reward model trained via comparative loss, e.g., Bradley-Terry Loss (Bradley & Terry, 1952). Our algorithm generate a pair of responses per prompt, leveraging only the Relative Feedback - derived from the difference in reward - for policy gradient updates. This method obviates the need for additional V function approximations and intricate components like GAE (Schulman et al., 2015b).

Instead of asking "How good is response A?", P3O asks "How much better is response A than response B?"

  • Pairwise Policy Gradient (PPG): The authors derive a new gradient expression that depends directly on $(r(y_1) - r(y_2))$. By comparing two trajectories for the same prompt, the algorithm naturally cancels out prompt-specific biases.
  • Trajectory-wise Updates: Unlike PPO, P3O treats the entire response as a single action (Contextual Bandit setting). This removes the need for a $V$ function or GAE.
  • Clipping: To maintain the stability benefits of PPO, the authors introduce two versions of clipping (Separate and Joint) to ensure the policy doesn't change too drastically in a single update.

Datasets

The researchers evaluated P3O on two primary open-ended text generation tasks:

  • TL;DR: A summarization dataset based on Reddit posts.
  • Anthropic Helpful and Harmless (HH): A large-scale dataset for training conversational agents to be safer and more useful.

They tested these using model sizes of 1B and 6B parameters (Pythia and GPT-J variants).

Key Insights and Ideas

  • Reward Equivalence Invariance: This is the paper's core theoretical contribution. The authors prove that P3O is invariant to "equivalent" reward functions (those that differ only by a constant shift per prompt). PPO is not, which explains why PPO can be so erratic when reward scales aren't perfectly calibrated.
  • Simplicity is Stability: By moving to a trajectory-wise approach, P3O avoids the "credit assignment" problem of trying to figure out which specific token earned the reward.
  • Online DPO: The authors also show that Direct Preference Optimization (DPO), usually an offline method, can be adapted for online training, though P3O still tends to be more KL-efficient.

Key Results

P3O consistently achieves a better KL-Reward frontier. In RLHF, there is always a trade-off: you want high rewards, but if you drift too far from the original model (high KL divergence), the text becomes gibberish or "gamey."

Figure 3: KL-Reward frontier for HH: x-axis and y-axis represents DKL(πθ∥πSFT) and the reward respectively. Each point represent an average of results over 280 test prompts and calculated every 500 gradient updates. Left two figure compare P3O-V1 and PPO with varying base model sizes; Right two figures compare P3O-V2 and online-DPO. Results showing that P3O can not only achieve higher reward but also yield better KL control.
  • Better Trade-offs: On the HH dataset, P3O delivered a substantial reward increase (0.1–0.3 higher) over PPO for the same KL budget.
  • GPT-4 Evaluation: In head-to-head battles judged by GPT-4, P3O-aligned models were preferred over PPO-aligned models 57% of the time and over SFT models 69.3% of the time.
  • Efficiency: P3O achieved nearly the same reward as DPO but with significantly lower KL divergence, meaning it stays closer to the high-quality language of the base model.

Limitations and Future Work

The authors acknowledge a few areas for further exploration:

  • Reward Over-optimization: Like all RLHF methods, P3O is susceptible to "cutting corners" if the reward model has flaws (Goodhart's Law).
  • Scaling Beyond Pairs: Currently, P3O works on pairs of responses. The authors are interested in generalizing the algorithm to handle $K$ ranked responses simultaneously.
  • Broader Applications: While focused on LLMs, the framework of "Reinforcement Learning with Relative Feedback" could potentially be applied to other RL domains where relative preferences are easier to obtain than absolute scores.

Summary updated

BibTeX
@inproceedings{wu2023pairwise,
  author = {Tianhao Wu and Banghua Zhu and Ruoyu Zhang and Zhaojin Wen and Kannan Ramchandran and Jiantao Jiao},
  title = {{Pairwise Proximal Policy Optimization: Harnessing Relative Feedback for LLM Alignment}},
  booktitle = {FMDM @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=yQT406rH72},
}
Figure