Bandits with Anytime Knapsacks

Eray Can Elumar, Cem Tekin, Osman Yagan · Submission to ICLR 2025 · Rejected

TL;DR

The authors introduce Bandits with Anytime Knapsacks (BwAK), a bandit setting where an agent must satisfy an average cost budget constraint at every single round, rather than just once at the end of the horizon. They propose SUAK (Strategic Under-utilization for Anytime Knapsacks), an algorithm that intentionally under-budgets by a logarithmic factor to avoid forced skips, achieving the standard problem-dependent regret bound of $O(K \log T)$.

What Problem Does This Paper Address?

In traditional Bandits with Knapsacks (BwK), an agent pulls arms that consume resources and earn rewards, aiming to maximize cumulative reward subject to a cumulative budget limit over $T$ rounds. However, in many real-world systems—such as factory inventory management (where negative inventory is impossible), daily marketing spend caps, or energy-harvesting satellites (which run off real-time solar generation)—the budget constraint must hold continuously at every round: $$\frac{1}{u}\sum_{s=1}^u c(s) \le c, \quad \forall u \le t$$

Simply taking a standard BwK algorithm and "skipping" (pulling a zero-reward, zero-cost null arm) whenever the constraint is about to be violated causes excessive, sublinear skips and severely harms cumulative reward. The challenge is maintaining the right mixture of cheap and expensive arms dynamically without repeatedly triggering constraint violations due to stochastic variance.

Methods

The paper introduces SUAK (Strategic Under-utilization for Anytime Knapsacks), which balances optimism with a safety margin:

  • Optimistic Base Identification: Uses Upper Confidence Bounds (UCB) on rewards and Lower Confidence Bounds (LCB) on costs to formulate an optimistic linear program (LP), identifying the optimal "base" (a mixture of at most two arms).
  • Cost Disambiguation: Actively checks whether an arm's cost confidence interval contains the threshold $c$. If so, it samples that arm to quickly verify if its mean cost is above or below $c$, ensuring the chosen base contains a viable sub-$c$ arm.
  • Strategic Under-Budgeting: Rather than aiming for average cost $c$, SUAK targets an average cost of: $$c - \frac{\log t}{\omega^2 t}$$ This buffer absorbs stochastic fluctuations in realized costs so the agent rarely hits the hard boundary.

  • Adaptive Mixing: Inside a two-arm base (one above $c$, one below), the algorithm adaptively tunes the selection probability $p(t)$ based on the remaining safety buffer $b(t)$, while clipping probabilities to $[\omega, 1-\omega]$ to ensure continuous exploration.

Datasets

The authors evaluate SUAK using synthetic bandit environments; no real-world benchmark datasets were used:

  • 4-arm instance ($K+1 = 4$): Evaluated over $T = 100{,}000$ rounds with mean rewards $\boldsymbol{\mu} = [0.45, 0.7, 0.8, 0]$, mean costs $\boldsymbol{\rho} = [0.25, 0.75, 0.8, 0]$, and cost limit $c = 0.5$.
  • 11-arm instance ($K+1 = 11$): Evaluated over $T = 2.5 \times 10^6$ rounds across 20 trials, with 10 active arms and 1 null arm. Cost and reward distributions are sampled independently from Beta distributions parameterized around their respective means.

Key Insights and Ideas

  • Why Naive Skipping Fails: A naive skip-rule algorithm (like One Phase Skip) operates right against the boundary $c$. Due to random walk fluctuations in cumulative cost—which naturally oscillate at $\Omega(1/\sqrt{t})$—it repeatedly hits the wall, accumulating excessive skips and high regret.
  • Controlled Drift via Logarithmic Buffer: By under-spending by an $O(\frac{\log t}{t})$ margin, the likelihood of crossing the anytime budget becomes exponentially small via Chernoff-Hoeffding bounds.
  • Cost of Safety is Logarithmic: The regret penalty from deliberately under-spending is only $O(\frac{r^* \log T}{c \omega^2})$, matching the $O(\log T)$ asymptotic order of arm-estimation errors.
  • Theoretical Parity: Despite the significantly stricter anytime constraint, SUAK achieves an expected cumulative regret of $O(K \log T)$, matching the optimal problem-dependent order of the unconstrained/terminal BwK setting.

Key Results

  • Theoretical Regret Bound: Theorem 3.1 proves that expected cumulative regret is bounded by: $$R_T \le \sum_{i=1}^K \frac{96 r^* (\frac{\rho_i+1}{\rho_i})^2 \log T}{\omega \Delta_{\min, i}^2} + \frac{202 K r^* \log T}{c \omega^2} + \frac{3\pi^2 r^*}{\delta_{\min}^2} + R_K + r^* t_{\text{init}} = O(K \log T) + O(1)$$ where $\Delta_{\min, i}$ is the minimum reward gap, $\delta_{\min} = \min_i |\rho_i - c|$ is the cost gap, and $\omega$ is a safety parameter.

  • Empirical Performance: In $2.5 \times 10^6$-round simulations against modified baselines (Primal-Dual Skip, UCB-Simplex Skip, and One Phase Skip):

  • Primal-Dual Skip and UCB-Simplex Skip suffered high regret due to inefficient uniform exploration.
  • While One Phase Skip started with lower initial regret, SUAK surpassed it around $t \approx 1.7 \times 10^6$ rounds because SUAK accumulated drastically fewer skips over time.

Limitations and Future Work

  • Small Cost Gaps: Regret scales inversely with $\omega$ and the minimum cost gap $\delta_{\min} = \min_i |\rho_i - c|$. When an arm's cost is extremely close to $c$, the problem-dependent regret can degrade substantially.
  • Single-Dimensional Costs: The model only accounts for a single resource/cost dimension. Extending anytime constraints to multidimensional knapsacks ($d > 1$) requires satisfying simultaneous constraints across all dimensions.
  • Known Stationary Distributions: The current formulation assumes stationary reward and cost distributions; extending this to non-stationary or adversarial environments remains an open challenge.

Summary updated

BibTeX
@misc{elumar2025bandits,
  author = {Eray Can Elumar and Cem Tekin and Osman Yagan},
  title = {{Bandits with Anytime Knapsacks}},
  year = {2025},
  eprint = {2501.18560},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.18560},
}
Figure