Online Self-Preferring Language Models

Yuanzhao Zhai, Zhuo Zhang, Kele Xu, Hanyang Peng, Yue Yu, Dawei Feng, Cheng Yang, Bo Ding, Huaimin WangarXiv 2024 · DOI

Introduction

Aligning Large Language Models (LLMs) with human values typically relies on Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO). While RLHF is computationally expensive and often unstable, DPO is efficient but limited by its treatment of preferences as binary labels (e.g., "Response A is better than Response B"). This binary approach ignores the nuanced "preference strength"—the degree to which one response outperforms another. Neglecting this information can lead to overfitting, where models over-optimize for marginal gains, or data inefficiency, where valuable signal is lost.

Methodology: Online Self-Preferring (OSP)

The authors propose Online Self-Preferring (OSP), a framework that enables models to judge the strength of their own preferences through on-policy sampling and a novel loss function.

Overview of the OSP framework compared to traditional RLHF and offline methods like DPO.

OSP introduces three primary innovations:

  1. On-Policy Self-Judging: Instead of relying on static datasets, the model generates $K$ candidate responses for a given prompt. It then functions as its own judge to assign "soft" preference scores to pairs of these responses.
  2. Ranked Pairing: To avoid the $O(K^2)$ complexity of all-pairs comparison, OSP ranks responses against a baseline and pairs the strongest with the weakest ($O(K)$), ensuring the model learns from a wide spectrum of preference strengths.
  3. Soft-Preference Cross-Entropy (SPCE) Loss: This loss function utilizes the model’s internal preference probability (e.g., "Response A is 80% better than B") rather than a hard binary target. This creates a "dynamic margin" that prevents the model from over-optimizing once it reaches the desired preference level, mitigating the "reward hacking" common in RLHF.

Experimental Setup

The OSP framework was evaluated across several key datasets:

  • Anthropic Helpfulness (HH): Human-assistant dialogue alignment.
  • OpenAI Summarization (TL;DR): Task-specific alignment for condensing text.
  • Stanford Human Preferences (SHP): Specifically the "askbaking" and "askacademia" subsets, used to evaluate generalization to out-of-domain (OOD) tasks.

Key Results and Insights

OSP demonstrates significant improvements over existing methods like SFT, DPO, IPO, and RLHF. A critical finding is the model's extreme data efficiency; OSP remains effective even when trained on as little as 2% of the available data (approximately 1,500 samples). In contrast, RLHF performance often collapses under such low-data regimes.

Performance metrics on out-of-domain tasks (Askbaking and Askacademia) showing OSP's robustness and data efficiency compared to RLHF.

Furthermore, OSP exhibits superior robustness to reward hacking. In OOD tasks, traditional RLHF often produces high-scoring but low-quality text by exploiting flaws in the reward model. OSP avoids this by modeling general preferences rather than specific numerical reward values.

The framework also enables a "self-correction" loop. Using Mistral-7B-Instruct, the authors showed that the model could align itself with just 200 prompts and no external human labels, achieving a 95% win rate against the base model in summarization tasks. GPT-4 validation further supported these results, preferring OSP's summaries over IPO's 74% of the time.

Limitations and Future Work

Despite its advantages, OSP is an "online" method, making it more computationally intensive than offline alternatives like DPO due to the real-time generation and judging of responses. Additionally, the "LLM-as-a-judge" mechanism can exhibit a length bias, favoring longer responses—a common challenge in alignment research. Future work will focus on scaling OSP to larger models (70B+) to determine if self-preferring proficiency scales linearly with parameter count.

Summary updated

BibTeX
@misc{zhai2024online,
  author = {Yuanzhao Zhai and Zhuo Zhang and Kele Xu and Hanyang Peng and Yue Yu and Dawei Feng and Cheng Yang and Bo Ding and Huaimin Wang},
  title = {{Online Self-Preferring Language Models}},
  year = {2024},
  eprint = {2405.14103},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.14103},
}
Figure