Online Preference Alignment for Language Models via Count-based Exploration

Chenjia Bai, Yang Zhang, Shuang Qiu, Qiaosheng Zhang, Kang Xu, Xuelong Li

Abstract

Reinforcement Learning from Human Feedback (RLHF) is essential for aligning Large Language Models (LLMs) with human values. However, traditional offline methods are constrained by the coverage of static datasets, often leading to poor generalization in out-of-distribution scenarios. While online RLHF allows for iterative data collection, it introduces the fundamental challenge of exploration. We present Count-based Online Preference Optimization (COPO), a framework that integrates a count-based exploration bonus into the Direct Preference Optimization (DPO) objective. By utilizing a lightweight Coin Flipping Network (CFN) to estimate pseudo-counts, COPO encourages models to explore novel prompt-response pairs. Our experiments on Zephyr and Llama-3 models demonstrate that COPO significantly enhances performance across instruction-following and academic benchmarks.

Introduction

The alignment of LLMs typically relies on RLHF, where a model is fine-tuned based on human preference data. Most existing approaches operate in an offline manner, utilizing a fixed dataset. This static nature limits the model's ability to explore the vast space of natural language, often resulting in reward models that fail to generalize when the LLM generates responses outside the initial data distribution.

Online RLHF addresses this by iteratively collecting new prompt-response pairs and updating the model. However, without a principled exploration strategy, the model may converge to local optima or fail to discover more effective response strategies. COPO addresses this by applying the "optimism in the face of uncertainty" principle to the LLM alignment process.

Methodology: Count-based Online Preference Optimization

COPO bridges the gap between theoretical reinforcement learning and practical LLM fine-tuning through three key components.

1. Theoretical Foundation

The authors provide a theoretical motivation within a linear reward assumption. They demonstrate that incorporating an Upper Confidence Bound (UCB) term into the reward function leads to a provably efficient RLHF policy with low regret. This provides a rigorous basis for adding exploration bonuses to preference optimization objectives.

2. Pseudo-counts and the Coin Flipping Network (CFN)

In traditional RL, exploration bonuses are often derived from the count of state-action pairs ($N$). In the high-dimensional, continuous space of natural language, exact counting is impossible. COPO employs pseudo-counts estimated via a Coin Flipping Network (CFN).

The CFN is a lightweight module designed to predict the average of random Rademacher trials (coin flips) assigned to specific prompt-response pairs. As a pair is repeatedly encountered, the network's prediction converges, and the variance of its output serves as a proxy for the inverse count ($1/\sqrt{N}$). This allows the system to estimate the "novelty" of a response without modeling the entire density of natural language.

3. The COPO Objective

The standard Direct Preference Optimization (DPO) objective is modified to include the CFN-based exploration bonus. The resulting objective encourages the LLM to maximize human preference while simultaneously seeking out regions of the response space that have been under-explored in previous iterations. This balance is controlled by an exploration factor, $\alpha$.

Experimental Evaluation

The researchers evaluated COPO using the UltraFeedback 60K dataset for training, focusing on single-turn conversations. The performance was measured across several dimensions:

  • Instruction Following: AlpacaEval 2.0 and MT-Bench.
  • Academic Reasoning: A suite including GSM8K (mathematics), HellaSwag (commonsense), ARC (science), and TruthfulQA.

Key Results

COPO demonstrated substantial improvements over standard online DPO and other state-of-the-art methods like SELM:

  • Performance Gains: On the Zephyr-7B model, COPO improved the AlpacaEval 2.0 Length-Controlled (LC) win rate from 22.19% to 27.21%. For Llama-3-8B-Instruct, the win rate rose from 33.17% to 35.54%.
  • Scaling Efficiency: The COPO-aligned Llama-3-8B model outperformed significantly larger models, such as Yi-34B-Chat, on multiple benchmarks.
  • Data Efficiency: In scenarios with limited initial data (only 20% of the preference dataset), COPO maintained high performance, whereas competing methods saw significant degradation. This suggests that systematic exploration can effectively compensate for data scarcity.

Discussion and Limitations

While COPO represents a significant step forward, the authors identified areas for further refinement:

  • Length Bias: The exploration bonus occasionally encouraged longer responses, as verbosity can be interpreted as novelty. Future iterations may need to decouple exploration from response length.
  • Hyperparameter Tuning: The exploration factor $\alpha$ currently requires manual adjustment. Developing an automated mechanism to tune $\alpha$ based on model confidence or data diversity is a promising direction for future research.
  • Prompt Diversity: The study utilized a fixed prompt set; expanding to dynamic prompt generation could further improve generalization.

Conclusion

COPO introduces a principled, count-based exploration mechanism to online RLHF. By transforming the theoretical UCB framework into a practical algorithm using Coin Flipping Networks, COPO enables LLMs to systematically expand their knowledge frontier. The resulting improvements in instruction-following and reasoning benchmarks highlight the critical role of exploration in the next generation of language model alignment.

Summary updated

BibTeX
@inproceedings{bai2025online,
  author = {Chenjia Bai and Yang Zhang and Shuang Qiu and Qiaosheng Zhang and Kang Xu and Xuelong Li},
  title = {{Online Preference Alignment for Language Models via Count-based Exploration}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=cfKZ5VrhXt},
}
Figure