Contextual Bandits with Packing and Covering Constraints: A Modular Lagrangian Approach via Regression

Aleksandrs Slivkins, Karthik Abinav Sankararaman, Dylan J. Foster

Abstract

We consider contextual bandits with linear constraints (CBwLC), a variant of contextual bandits in which the algorithm consumes multiple resources subject to linear constraints on total consumption. This problem generalizes contextual bandits with knapsacks (CBwK), allowing for packing and covering constraints, as well as positive and negative resource consumption. We provide the first algorithm for CBwLC (or CBwK) that is based on regression oracles. The algorithm is simple, computationally efficient, and admits vanishing regret. It is statistically optimal for the variant of CBwK in which the algorithm must stop once some constraint is violated. Further, we provide the first vanishing-regret guarantees for CBwLC (or CBwK) that extend beyond the stochastic environment. We side-step strong impossibility results from prior work by identifying a weaker (and, arguably, fairer) benchmark to compare against. Our algorithm builds on LagrangeBwK (Immorlica et al., FOCS 2019), a Lagrangian-based technique for CBwK, and SquareCB (Foster and Rakhlin, ICML 2020), a regression-based technique for contextual bandits. Our analysis leverages the inherent modularity of both techniques.

Introduction

In the standard contextual bandit setting, an agent observes a context, selects an action, and receives a reward. While this framework is powerful, real-world applications often involve complex constraints on resource consumption. For instance, a medical trial must operate within a fixed budget (a packing constraint), while an advertising platform may be contractually obligated to deliver a minimum number of impressions for a specific campaign (a covering constraint).

This paper addresses the Contextual Bandits with Linear Constraints (CBwLC) problem. This setting generalizes the well-known "Bandits with Knapsacks" (BwK) framework by incorporating both packing and covering constraints, and by allowing for actions that can replenish resources (negative consumption). The authors introduce LagrangeCBwLC, the first computationally efficient framework for this problem that utilizes standard regression oracles.

The Challenge of Constrained Bandits

Previous research into Bandits with Knapsacks (BwK) faced three primary hurdles:

  1. Contextual Complexity: Efficiently integrating high-dimensional user features into the decision-making process.
  2. Constraint Diversity: Most prior models focused solely on packing (resource limits) and struggled to incorporate covering (minimum targets).
  3. Computational Overhead: Many existing solutions required solving complex, often NP-hard, optimization problems at every time step.

Furthermore, in non-stationary environments where the underlying distributions change, standard benchmarks for regret often lead to impossibility results. This paper seeks to overcome these barriers by providing a modular, regression-based approach that is both statistically sound and computationally practical.

Methodology: The LagrangeCBwLC Framework

The core of the proposed solution is a modular framework that treats the bandit problem as a repeated zero-sum game between two players:

  • The Primal Player: This player aims to select actions that maximize a "Lagrangian payoff"—a weighted combination of the expected reward and the costs (or benefits) associated with resource consumption.
  • The Dual Player: This player manages the Lagrange multipliers (weights), adjusting them to ensure that the long-term constraints are satisfied.

Regression Oracles and SquareCB

A key innovation of this work is the use of Regression Oracles. Instead of performing a global search over policy spaces, the algorithm employs a subroutine—such as a neural network or gradient-boosted tree—to predict rewards and resource consumption for each action given a context.

To bridge the gap between regression and action selection, the authors adapt SquareCB, a technique that converts regression estimates into exploration probabilities. This modularity allows practitioners to "plug in" any state-of-the-art regression model, making the algorithm highly adaptable to different data types and domains.

Key Theoretical Insights

Modularity and Flexibility

By decoupling the learning of the environment (regression) from the management of constraints (the Lagrangian game), the authors create a flexible "theoretical interface." This allows for the independent optimization of the bandit strategy and the underlying predictive models.

The Pacing Benchmark

In environments that change over time (switching environments), traditional regret benchmarks are often unattainable. The authors identify a "pacing benchmark," which compares the algorithm's performance to a strategy that distributes resource consumption uniformly over time. This allows for the first vanishing-regret guarantees in non-stationary CBwLC settings.

Beyond Hard-Stopping

Unlike traditional BwK models that assume the algorithm must terminate as soon as a budget is exhausted, this framework allows the algorithm to continue. This is essential for covering constraints, where the system may start in a state of violation and must work toward a target over the duration of the horizon.

Results and Performance

The paper provides rigorous proofs for the algorithm's performance across different scenarios:

  • General Regret: For general CBwLC problems, the algorithm achieves an outcome-regret (a combination of reward loss and constraint violation) of $\tilde{O}(T^{3/4})$.
  • Optimal Rates: In scenarios involving only packing constraints (CBwK) or when a "constant margin" feasibility condition is met, the regret improves to $\tilde{O}(\sqrt{T})$, which is statistically optimal.
  • Efficiency: The algorithm is oracle-efficient, requiring only a logarithmic number of calls to the regression oracle per round, ensuring viability for real-time systems.

Conclusion and Future Directions

LagrangeCBwLC represents a significant step forward in making constrained contextual bandits practical for large-scale applications. By leveraging regression oracles, it bypasses the computational bottlenecks of previous methods while providing robust theoretical guarantees.

While the $\tilde{O}(T^{3/4})$ bound for general constraints is a major milestone, future work may explore whether this can be improved to $\tilde{O}(\sqrt{T})$ for all cases. Additionally, empirical validation on real-world datasets in fields like dynamic pricing and clinical trial management remains an important next step for this research.

Summary updated

BibTeX
@inproceedings{slivkins2023contextual,
  author = {Aleksandrs Slivkins and Karthik Abinav Sankararaman and Dylan J. Foster},
  title = {{Contextual Bandits with Packing and Covering Constraints: A Modular Lagrangian Approach via Regression}},
  booktitle = {Conference on Learning Theory},
  year = {2023},
  url = {https://openreview.net/forum?id=bgQr8Vx8HY},
}
Figure