cs.LGFeb 16, 2026

Truly Adapting to Adversarial Constraints in Constrained MABs

Authors: Francesco Emanuele Stradi, Kalana Kalupahana, Matteo Castiglioni, Alberto Marchesi, Nicola Gatti

Organizations: Politecnico di Milano

Abstract

We study the constrained variant of the multi-armed bandit (MAB) problem, in which the learner aims not only at minimizing the total loss incurred during the learning dynamic, but also at controlling the violation of multiple unknown constraints, under both full and bandit feedback. We consider a non-stationary environment that subsumes both stochastic and adversarial models and where, at each round, both losses and constraints are drawn from distributions that may change arbitrarily over time. In such a setting, it is provably not possible to guarantee both sublinear regret and sublinear violation. Accordingly, prior work has mainly focused either on settings with stochastic constraints or on relaxing the benchmark with fully adversarial constraints (e.g., via competitive ratios with respect to the optimum). We provide the first algorithms that achieve optimal rates of regret and positive constraint violation when the constraints are stochastic while the losses may vary arbitrarily, and that simultaneously yield guarantees that degrade smoothly with the degree of adversariality of the constraints. Specifically, under full feedback we propose an algorithm attaining O~(T+C)\widetilde{\mathcal{O}}(\sqrt{T}+C) regret and O~(T+C)\widetilde{\mathcal{O}}(\sqrt{T}+C) {positive} violation, where CC quantifies the amount of non-stationarity in the constraints. We then show how to extend these guarantees when only bandit feedback is available for the losses. Finally, when bandit feedback is available for the constraints, we design an algorithm achieving O~(T+C)\widetilde{\mathcal{O}}(\sqrt{T}+C) {positive} violation and O~(T+CT)\widetilde{\mathcal{O}}(\sqrt{T}+C\sqrt{T}) regret.

Figures & tables

Explore similar work

Sep 24, 2025

Beyond Slater's Condition in Online CMDPs with Stochastic and Adversarial Constraints

We study online episodic Constrained Markov Decision Processes (CMDPs) under both stochastic and adversarial constraints. We provide a novel algorithm whose guarantees greatly improve those of the state-of-the-art best-of-both-worlds algorithm introduced by Stradi et al. (2025). In the stochastic regime, i.e., when the constraints are sampled from fixed but unknown distributions, our method achieves O~(T)\widetilde{\mathcal{O}}(\sqrt{T}) regret and constraint violation without relying on Slater's condition, thereby handling settings where no strictly feasible solution exists. Moreover, we provide guarantees on the stronger notion of positive constraint violation, which does not allow to recover from large violation in the early episodes by playing strictly safe policies. In the adversarial regime, i.e., when the constraints may change arbitrarily between episodes, our algorithm ensures sublinear constraint violation without Slater's condition, and achieves sublinear αα-regret with respect to the unconstrained optimum, where αα is a suitably defined multiplicative approximation factor. We further validate our results through synthetic experiments, showing the practical effectiveness of our algorithm.
May 7, 2026

Constrained Contextual Bandits with Adversarial Contexts

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. The benchmark is a stationary randomized policy whose expected cost is non-positive at every observed context. We extend the seminal SquareCB\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 UTU_T, our algorithm achieves O(KTUT)O(\sqrt{KTU_T}) regret and O(KTUTlog⁡T)O(\sqrt{KTU_T}\log T) cumulative expected cost, with high probability, improving upon the previous O(T3/4)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.
Oct 8, 2026

Toward Optimal Regret in Adversarial MDPs with Stochastic Hard Constraints

We study episodic constrained Markov decision processes with adversarial losses under stochastic hard constraints. Specifically, starting from a known strictly feasible policy with margin dd, we seek to obtain optimal regret while satisfying the expected cost constraints in every episode. In this setting, Stradi et al. (2025) show that a carefully designed mixing rule attains regret of order O~(T/min⁡{d,d2})\widetilde{\mathcal{O}}(\sqrt{T}/\min\{d,d^2\}). Interestingly, they also provide a lower bound of order Ω(T/ρ)Ω(\sqrt{T}/ρ) for the same setting, where ρρ is the Slater margin of the offline problem and can be much larger than dd. In this work, we build on their approach to obtain optimal regret dependence on these margins. Specifically, we propose MA-OPS, an algorithm that combines an optimistic search for the Slater margin with a pessimistic evaluation of the selected policies to safely learn a policy with a large feasibility margin. This policy is then used to minimize regret while satisfying the constraints at every episode. In particular, we show that MA-OPS attains regret O~(T/ρ+1/(dρ))\widetilde{\mathcal{O}}(\sqrt{T}/ρ+ 1/(dρ)). Finally, we provide a matching lower bound, showing that the dependence on TT, dd, ρρ in the regret bound is optimal up to logarithmic factors.