NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

An Efficient Algorithm For Generalized Linear Bandit: Online Stochastic Gradient Descent and Thompson Sampling

Qin Ding, Cho-Jui Hsieh, James Sharpnack

Introduction

Contextual bandits are fundamental to modern recommendation systems and online advertising. While linear models are widely used, Generalized Linear Models (GLMs), such as logistic regression, offer greater flexibility and accuracy in real-world scenarios. However, standard GLM bandit algorithms suffer from high computational costs, requiring full Maximum Likelihood Estimation (MLE) and matrix inversions at every step. This paper introduces SGD-TS, an efficient algorithm that achieves optimal regret with significantly reduced per-step complexity.

Problem Formulation

In the Generalized Linear Bandit (GLB) setting, an agent chooses an arm $a_t$ from a set of contexts $\mathcal{X}_t$ at each round $t$. The reward $y_t$ is generated according to a GLM: $E[y_t | x_t] = \mu(x_t^\top \theta^*)$, where $\mu$ is a link function and $\theta^*$ is an unknown parameter. Existing algorithms like GLM-UCB or GLM-TS typically require solving an optimization problem and inverting a $d \times d$ covariance matrix every round, leading to $O(T^2)$ or $O(Td^2)$ total time complexity, which is prohibitive for high-speed applications.

The SGD-TS Algorithm

The proposed SGD-TS algorithm replaces expensive batch optimization with a single-step Stochastic Gradient Descent (SGD) update and utilizes Thompson Sampling (TS) for exploration.

Schematic of the SGD-TS algorithm workflow showing periodic updates and parameter sampling.

Key features of SGD-TS include:

  • Online SGD Updates: Instead of re-calculating the MLE, the algorithm performs a single-step SGD update every $\tau$ rounds, aggregating losses to ensure convergence.
  • Diagonal Covariance Sampling: To avoid $O(d^3)$ matrix inversions, SGD-TS uses a diagonal approximation of the covariance matrix for Thompson Sampling, reducing per-step complexity to $O(d)$.
  • Calibrated Exploration: The algorithm re-calibrates the Thompson Sampling exploration factor to account for the additional noise introduced by the SGD estimator, maintaining theoretical $\tilde{O}(\sqrt{T})$ regret bounds.

Experimental Evaluation

The authors evaluated SGD-TS against several state-of-the-art baselines, including UCB-GLM, GLOC, and Laplace-TS, across synthetic and real-world datasets.

Cumulative regret comparison on synthetic data ($d=6, K=100$), showing SGD-TS achieving the lowest regret.

Experimental results demonstrate:

  • Theoretical Optimality: SGD-TS matches the theoretical lower bounds for regret while being computationally superior.
  • Significant Speedups: On the Yahoo! Today Module dataset, SGD-TS was approximately 230 times faster than UCB-GLM.
  • Robust Performance: Across datasets like Forest Cover Type, SGD-TS consistently achieved lower cumulative regret than more complex alternatives, even with its simplified diagonal covariance structure.

Conclusion

SGD-TS represents a significant advancement in making Generalized Linear Bandits practical for large-scale systems. By combining online SGD with calibrated Thompson Sampling, it breaks the computational bottleneck of traditional GLB algorithms without sacrificing theoretical guarantees or empirical performance. Future work may extend these principles to more complex models, such as neural bandits.

Summary updated

BibTeX
@inproceedings{ding2021efficient,
  author = {Qin Ding and Cho-Jui Hsieh and James Sharpnack},
  title = {{An Efficient Algorithm For Generalized Linear Bandit: Online Stochastic Gradient Descent and Thompson Sampling}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
}
Figure