Feel-Good Thompson Sampling for Contextual Dueling Bandits

Xuheng Li, Heyang Zhao, Quanquan Gu

Abstract: Contextual dueling bandits, where a learner compares two options based on context and receives feedback indicating which was preferred, extends classic dueling bandits by incorporating contextual information for decision-making and preference learning. Several algorithms based on the upper confidence bound (UCB) have been proposed for linear contextual dueling bandits. However, no algorithm based on posterior sampling has been developed in this setting, despite the empirical success observed in traditional contextual bandits. In this paper, we propose a Thompson sampling algorithm, named FGTS.CDB, for linear contextual dueling bandits. At the core of our algorithm is a new Feel-Good exploration term specifically tailored for dueling bandits. This term leverages the independence of the two selected arms, thereby avoiding a cross term in the analysis. We show that our algorithm achieves nearly minimax-optimal regret, i.e., $\tilde{\mathcal{O}}(d\sqrt T)$, where $d$ is the model dimension and $T$ is the time horizon. Finally, we evaluate our algorithm on synthetic data and observe that FGTS.CDB outperforms existing algorithms by a large margin.

Introduction

In modern AI alignment, particularly in Reinforcement Learning from Human Feedback (RLHF), the challenge often lies in learning from relative preferences rather than absolute scores. It is significantly more intuitive for a human evaluator to state that "Response A is better than Response B" than to assign a precise numerical value to either. This framework is known as the dueling bandit problem. When these choices are conditioned on a specific prompt or environment, it becomes a contextual dueling bandit problem.

While existing literature has explored this setting using Upper Confidence Bound (UCB) methods, these approaches often suffer from high computational overhead, requiring the maintenance of active sets or complex optimization routines. Thompson Sampling (TS) offers a more computationally efficient and often more performant alternative in practice, yet its application to contextual dueling bandits has remained limited due to theoretical challenges in ensuring "worst-case" performance. This paper introduces FGTS.CDB, the first Thompson Sampling-based algorithm for linear contextual dueling bandits that achieves minimax-optimal regret.

The FGTS.CDB Algorithm

The core innovation of FGTS.CDB (Feel-Good Thompson Sampling for Contextual Dueling Bandits) is the adaptation of the "Feel-Good" exploration mechanism to the pairwise comparison setting. The algorithm operates through several key steps:

  1. Independent Parameter Sampling: In each round $t$, the agent samples two independent model parameters, $\theta_t^1$ and $\theta_t^2$, from a posterior distribution.
  2. Arm Selection: The agent then selects two arms (responses) that maximize the predicted reward according to their respective sampled parameters.
  3. The Feel-Good Likelihood: The posterior is constructed using a likelihood function that combines a standard logistic regression term (based on the Bradley-Terry-Luce model) with a novel Feel-Good exploration term. This term encourages the agent to explore parameters that yield high rewards.
  4. Efficient Computation: To handle large or infinite action spaces, the authors utilize Stochastic Gradient Langevin Dynamics (SGLD) for sampling, ensuring the algorithm remains scalable.

Crucially, the authors designed the Feel-Good term to account for the "adversarial" arm (the other arm in the pair). By sampling the two arms independently and incorporating this term, the mathematical analysis decouples, eliminating the complex "cross terms" that previously hindered the development of TS algorithms in this space.

Theoretical and Empirical Results

Theoretical Optimality

The researchers provide a rigorous proof demonstrating that FGTS.CDB achieves a regret bound of $\tilde{O}(d\sqrt{T})$, where $d$ is the feature dimension and $T$ is the time horizon. This matches the theoretical lower bound, making the algorithm minimax-optimal. This result is significant as it proves that Thompson Sampling can be as theoretically robust as UCB-based methods while maintaining its practical advantages.

Empirical Performance

The algorithm was evaluated against state-of-the-art UCB-based baselines, including MaxInP, CoLSTIM, and VACDB, using synthetic datasets with feature dimensions of 5, 10, and 15. The results indicated:

  • Superior Efficiency: FGTS.CDB outperformed all baselines by a substantial margin in terms of cumulative regret.
  • Robustness: The algorithm exhibited lower variance across different random seeds, suggesting higher stability than UCB counterparts.
  • Scalability: Unlike UCB methods that require calculating uncertainty for every possible choice—a task that becomes impossible in infinite action spaces—FGTS.CDB only requires solving a maximization problem, making it more suitable for real-world applications with vast response spaces.

Conclusion and Future Work

FGTS.CDB represents a significant step forward in preference-based learning. By successfully adapting Feel-Good Thompson Sampling to the contextual dueling bandit setting, the authors have provided a tool that is both theoretically sound and empirically superior to existing methods.

Future research directions include testing the algorithm on real-world LLM alignment tasks and extending the framework to incorporate variance-awareness, which could further tighten regret bounds when feedback noise is low. Additionally, while this work focuses on linear rewards, extending these principles to general function approximation (such as deep neural networks) remains a vital frontier for scaling RLHF techniques.

Summary updated

Abstract

Contextual dueling bandits, where a learner compares two options based on context and receives feedback indicating which was preferred, extends classic dueling bandits by incorporating contextual information for decision-making and preference learning. Several algorithms based on the upper confidence bound (UCB) have been proposed for linear contextual dueling bandits. However, no algorithm based on posterior sampling has been developed in this setting, despite the empirical success observed in traditional contextual bandits. In this paper, we propose a Thompson sampling algorithm, named FGTS.CDB, for linear contextual dueling bandits. At the core of our algorithm is a new Feel-Good exploration term specifically tailored for dueling bandits. This term leverages the independence of the two selected arms, thereby avoiding a cross term in the analysis. We show that our algorithm achieves nearly minimax-optimal regret, i.e., $\tilde{\mathcal{O}}(d\sqrt T)$, where $d$ is the model dimension and $T$ is the time horizon. Finally, we evaluate our algorithm on synthetic data and observe that FGTS.CDB outperforms existing algorithms by a large margin.
BibTeX
@inproceedings{li2024feel,
  author = {Xuheng Li and Heyang Zhao and Quanquan Gu},
  title = {{Feel-Good Thompson Sampling for Contextual Dueling Bandits}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=l9ga3iQuHt},
}
Figure