No-Regret is not enough! Bandits with General Constraints through Adaptive Regret Minimization

Martino Bernasconi, Matteo Castiglioni, Andrea Celli

Abstract

In the bandits with knapsacks framework (BwK) the learner has $m$ resource-consumption (packing) constraints. We focus on the generalization of BwK in which the learner has a set of general long-term constraints. The goal of the learner is to maximize their cumulative reward, while at the same time achieving small cumulative constraints violations. In this scenario, there exist simple instances where conventional methods for BwK fail to yield sublinear violations of constraints. We show that it is possible to circumvent this issue by requiring the primal and dual algorithm to be weakly adaptive. Indeed, even in absence on any information on the Slater's parameter $\rho$ characterizing the problem, the interplay between weakly adaptive primal and dual regret minimizers yields a "self-bounding" property of dual variables. In particular, their norm remains suitably upper bounded across the entire time horizon even without explicit projection steps. By exploiting this property, we provide best-of-both-worlds guarantees for stochastic and adversarial inputs. In the first case, we show that the algorithm guarantees sublinear regret. In the latter case, we establish a tight competitive ratio of $\rho/(1+\rho)$. In both settings, constraints violations are guaranteed to be sublinear in time. Finally, this results allow us to obtain new result for the problem of contextual bandits with linear constraints, providing the first no-$\alpha$-regret guarantees for adversarial contexts.

Introduction

In online learning, the "no-regret" property is often considered the gold standard. It ensures that, on average, a learner performs as well as the best fixed strategy in hindsight. However, in constrained environments like "Bandits with Knapsacks" (BwK), where a learner must maximize rewards while respecting resource budgets, standard no-regret guarantees can be deceptively insufficient. This paper, authored by researchers from Bocconi University and Politecnico di Milano, demonstrates that global no-regret algorithms can be "lazy," failing to satisfy long-term constraints when environments change over time.

The Limitation of Standard No-Regret

The core issue identified by the authors is that a global no-regret guarantee is a weak average. An algorithm can perform exceptionally well in the early rounds, accumulating "negative regret" or "slack." It can then spend this slack in later rounds by ignoring constraints entirely while still maintaining a sublinear regret over the total time horizon $T$.

Figure 1: Temporal decoupling of rewards (left) and constraints (right) in a synthetic adversarial instance.

As illustrated in Figure 1, the authors construct adversarial instances where rewards and constraints are temporally decoupled. In this example, rewards for certain actions are high early on (left), while the associated constraint costs only appear much later (right). A standard learner might exploit the early rewards and then fail to adapt when the constraints become active, leading to linear constraint violations.

Proposed Framework: Weak Adaptivity and Self-Bounding

To address this, the authors propose a modular Primal-Dual Framework that replaces standard no-regret learners with weakly adaptive ones. A weakly adaptive algorithm minimizes regret not just over the full horizon $T$, but over every possible sub-interval. This requirement forces the algorithm to remain "alert" and responsive to changes at any point in time.

The Self-Bounding Property

The mathematical breakthrough of the paper is the Self-Bounding Lemma. The authors prove that if both the primal (reward-maximizing) and dual (constraint-enforcing) algorithms are weakly adaptive and "scale-free," the Lagrange multipliers (dual variables) will naturally remain bounded.

Usually, researchers must manually "cap" or project dual variables to keep a system stable, which often requires knowing Slater’s parameter ($\rho$)—a measure of the problem's feasibility—beforehand. This framework achieves stability automatically through the interaction of the two adaptive players, even without prior knowledge of $\rho$.

Key Results

The authors evaluate their framework theoretically, establishing optimal bounds for both stochastic and adversarial settings:

  • Adversarial Setting: The algorithm achieves a competitive ratio of $\rho / (1 + ho)$ against the best unconstrained strategy. This is proven to be strictly optimal; no algorithm can achieve a better ratio while maintaining sublinear constraint violations.
  • Stochastic Setting: The algorithm matches the performance of state-of-the-art methods that do know $\rho$, achieving sublinear regret ($O(\sqrt{T})$).
  • Constraint Violations: In both scenarios, total constraint violations are guaranteed to be sublinear (typically $\tilde{O}(\sqrt{T})$), ensuring constraints are satisfied on average as time progresses.

Conclusion and Future Work

By shifting the focus from global no-regret to weak adaptivity, this work provides a robust solution for bandits with general long-term constraints. The framework also extends to contextual bandits, offering the first no-$\alpha$-regret guarantees for adversarial contexts.

Future research may explore the computational efficiency of these methods, particularly the requirement for frequent "regression oracle" calls in contextual settings, and investigate which existing no-regret algorithms naturally satisfy the necessary "scale-free" properties to be integrated into this adaptive framework.

Summary updated

BibTeX
@inproceedings{bernasconi2025no,
  author = {Martino Bernasconi and Matteo Castiglioni and Andrea Celli},
  title = {{No-Regret is not enough! Bandits with General Constraints through Adaptive Regret Minimization}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=vxM49M5B4s},
}
Figure