Constrained Contextual Bandits with Adversarial Contexts

Dhruv Sarkar, Abhishek Sinha
5/7/2026
cs.LG

No confident code implementation found for this paper.

Abstract

We study constrained contextual bandits with adversarial contexts, where each action yields a random reward and incurs a random cost. The conditional mean reward and cost belong to known function classes and are learned through online regression oracles.

Show full abstract

The benchmark is a stationary randomized policy whose expected cost is non-positive at every observed context. We extend the seminal $\mathsf{SquareCB}$ algorithm of Foster and Rakhlin (2020), which reduces the contextual bandits to a regression problem, to the constrained setting. A surrogate reward function is constructed which penalizes the positive part of the expected cost of an action distribution, and an auxiliary variable accumulates its predicted value. Then we use an exponential Lyapunov function to control both regret and cumulative constraint violation via a single inequality. If the cumulative squared prediction error is at most $U_T$, our algorithm achieves $O(\sqrt{KTU_T})$ regret and $O(\sqrt{KTU_T}\log T)$ cumulative expected cost, with high probability, improving upon the previous $O(T^{3/4})$ type bounds obtained in stochastic contextual settings with an unknown context distribution. Our results require neither additional margin conditions nor probabilistic assumptions on the context sequence.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{sarkar2026constrained,
  title  = {Constrained Contextual Bandits with Adversarial Contexts},
  author = {Dhruv Sarkar and Abhishek Sinha},
  year   = {2026},
  eprint = {2605.06190},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.06190v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.06190.svg)](https://codeofpaper.com/paper/2605.06190)

Discussion