cs.LGMay 7, 2026

Constrained Contextual Bandits with Adversarial Contexts

Authors: Dhruv SarkarAbhishek Sinha

Organizations: Indian Institute of Technology Kharagpur, India · Tata Institute of Fundamental Research, Mumbai, India

Abstract

We study budget-constrained contextual bandits with adversarial contexts, where each action yields a random reward and incurs a random cost. We adopt the standard realizability assumption: conditioned on the observed context, rewards and costs are drawn independently from fixed distributions whose expectations belong to known function classes. We focus on the continuing setting, in which the algorithm operates over the entire horizon even after the budget for cumulative cost is exhausted. In this setting, the objective is to simultaneously control regret and the violation of the budget constraint. Building on the seminal SquareCB\mathsf{SquareCB} framework of Foster et al. [2018], we propose a simple and modular framework that leverages online regression oracles to reduce the constrained problem to a standard unconstrained contextual bandit problem with adaptively defined surrogate reward functions. In contrast to prior works, which focus on stochastic contexts, our reduction yields improved guarantees for more general adversarial contexts, together with an efficient algorithm with a compact and transparent analysis.

Explore similar work

Oct 8, 2025cs.LG

Best-of-Both Worlds for linear contextual bandits with paid observations

We study linear contextual bandits with paid observations, where at each round the learner observes a context, selects an action, and may pay a fixed cost to observe feedback from a subset of arms. We propose two Follow-the-Regularized-Leader algorithms with Best-of-Both-Worlds guarantees. The first, Agg-SPB, extends the SPB-matching framework of Tsuchiya and Ito (2024) by aggregating context-dependent stability terms, achieving the characteristic T2/3T^{2/3} adversarial regret rate and logarithmic dependence on TT in stochastic environments. The second, CE-SPB, combines arm-dependent observation probabilities with an entropy-adaptive learning rate inspired by Kuroki et al. (2024). It achieves an entropy-adaptive O~(T2/3)\widetilde{O}(T^{2/3}) adversarial guarantee and polylogarithmic stochastic regret, while avoiding the minimum-context-mass dependence arising in the stochastic analysis of Agg-SPB. Both algorithms further extend to corrupted stochastic environments with explicit corruption-dependent guarantees. These results establish that logarithmic stochastic regret is compatible with the T2/3T^{2/3} adversarial regime for linear contextual bandits with paid observations, while highlighting a tradeoff between sharper horizon dependence in stochastic settings and path-dependent matching without explicit minimum-context-mass dependence.
Nathan Boyer, Dorian Baudry, Patrick Rebeschini
May 19, 2026cs.LG

Active Context Selection Improves Simple Regret in Contextual Bandits

We study the contextual multi-armed bandit problem with a finite context space (a.k.a. subpopulations), where the learner recommends a best action for each context and is evaluated by context-weighted simple regret. Our guarantees are worst-case over the reward distributions, while remaining instance-dependent with respect to the context distribution vector pp. Akin to experimental design problems where the population of interest is fixed but the sampled subpopulation can be controlled, we allow the learner to actively choose which context to sample from. For a known pp, we characterize tight regret rates: passive sampling where contexts are randomly revealed achieves regret of order n/Tp1/2\sqrt{n/T \, \lVert p \rVert_{1/2}}, whereas active sampling with allocation qjpj2/3q_j \propto p_j^{2/3} achieves the tight rate n/Tp2/3\sqrt{n/T} \, \lVert p \rVert_{2/3}. The resulting improvement can be as large as Θ(k1/4)Θ(k^{1/4}), where kk is the number of contexts. We further extend the analysis to budgeted active sampling, characterize the corresponding tight rate, and identify when a limited active budget suffices to recover the fully active rate. When pp is unknown, we propose the Explore-Explore-Then-Commit (EETC) algorithm, which optimally balances estimating the context distribution and the time to switch to active allocation, such that for large horizons, it matches the known-pp active rate up to constants. Experiments on synthetic and real-world data support our theoretical findings.
Mohammad Shahverdikondori, Jalal Etesami, Negar Kiyavash
Aug 11, 2026cs.LG

Reoptimization Algorithms for Contextual Bandits with Knapsack Constraints

We study new algorithms for Contextual Bandits with Knapsack. In these problems, there are finitely many types of customers, products, and resources. Each product is made from a fixed combination of resources, and resources have finite capacity. A decision maker must assign each arriving customer one out of a set of multiple possible products. Every assignment of a customer to a product will generate a random reward, which equals an unknown linear function of customer and product features, plus a noise term. The objective is to jointly learn the mean reward function, and to make online assignments to minimize the expected revenue loss relative to an optimal policy that knows the reward function. We propose a natural and simple extension of the Upper-Confidence-Bound (UCB) family of algorithms and apply re-optimization techniques. We show that by taking advantage of re-optimization, our algorithm achieves an average regret of O((lnT)3T)O(\frac{(\ln T)^3}{T}) where TT is the horizon length. Our bound significantly reduces the O(1T)O(\frac{1}{\sqrt{T}}) bound in the literature for closely related dynamic-pricing problems that are based on re-optimization.
Zhen Xu