Queue Length Regret Bounds for Contextual Queueing Bandits

Seoungbin Bae, Garyeong Kang, Dabeen Lee

In modern service platforms—such as cloud schedulers, ride-hailing applications, and large-scale LLM inference engines—efficiency is paramount. However, optimizing efficiency is notoriously difficult when the exact processing speeds of servers for specific types of jobs are unknown. System operators must learn these service rates on the fly while simultaneously making critical scheduling decisions.

This paper introduces contextual queueing bandits, a novel framework designed to handle jobs with diverse features (contexts) while learning unknown, server-specific service rates. The authors provide the first provable decay rates for "queue length regret," overcoming a major technical hurdle known as "queue state misalignment" through a sophisticated policy-switching and coupling argument.

The Challenge of Queue State Misalignment

Traditional "queueing bandits" involve an agent learning service rates for different servers to minimize queue length. However, most existing models assume all jobs are identical or belong to a few fixed, homogeneous categories. In reality, jobs possess unique contexts: a cloud computing task might have specific memory and CPU requirements, or a recommendation request might originate from a highly specific user profile.

When jobs are heterogeneous, a massive technical challenge arises: Queue State Misalignment.

Illustration of Queue State Misalignment

If a learning algorithm chooses to process Job A while the optimal policy chooses Job B, the respective queues will subsequently contain different sets of remaining jobs. Because the future "action set" (the jobs available to be scheduled) depends entirely on which jobs are left in the queue, it becomes exceedingly difficult to compare the learning agent's performance to the optimal policy. Standard bandit proofs break down here because the sets of "available arms" diverge over time.

Methodology: Policy-Switching and Coupling

To model the service rate, the authors utilize a logistic function based on the job's contextual features and an unknown server parameter. To tackle the misalignment problem, they introduce two key analytical innovations:

  1. Policy-Switching Queues: The authors analyze a sequence of hypothetical queues. The $t$-th queue follows the agent's policy until time $t$ and then switches to the optimal policy. This construction allows them to decompose the total regret into a "telescoping sum," where each term isolates the impact of a single scheduling decision.
  2. Sophisticated Coupling: They employ a coupling argument to "align" these hypothetical queues. This makes it possible to mathematically bound how a suboptimal choice at time $t$ propagates its effect on the queue length all the way to the end of the time horizon ($T$).

Based on this framework, they propose two main algorithms:

  • CQB-$\epsilon$: Designed for stochastic contexts (where job features are drawn from a distribution). It utilizes a "pure exploration" phase followed by an $\epsilon$-greedy approach combined with Upper Confidence Bound (UCB) rules.
  • CQB-Opt: Designed for adversarial contexts (where an opponent or worst-case environment chooses the job features). This is a more traditional UCB-style algorithm that does not rely on a separate exploration phase.

Key Insights and Results

The authors validated their algorithms using synthetic simulations and three real-world datasets adapted for the contextual bandit setting: MNIST (image features as contexts), UCI Heart Disease (patient data), and UCI In-Vehicle Coupon Recommendation (driver/environmental features).

Theoretical Guarantees

  • Stochastic Contexts: The CQB-$\epsilon$ algorithm achieves a queue length regret bound of $\tilde{\mathcal{O}}(T^{-1/4})$. Crucially, this is a decaying rate, meaning the average difference in queue length between the agent and the optimal policy converges to zero as time progresses. This is proven using Chebyshev’s sum inequality, showing that immediate error decreases over time while the long-term impact of state differences increases, balancing each other out.
  • Adversarial Contexts: The CQB-Opt algorithm achieves a regret bound of $\mathcal{O}(\log^2 T)$. Because adversarial settings lack a guaranteed smooth decrease in uncertainty, the authors use a counting argument to bound the number of "bad rounds," leading to this polylogarithmic bound.

The Long-Term Cost of a Mistake

A core insight of this work is highlighting the difference between standard bandits and queueing bandits. In standard bandits, a mistake only costs immediate reward. In queueing, a mistake (processing the "wrong" job) alters the fundamental state of the system, potentially causing a backlog that persists for many subsequent steps. Empirical results confirmed this: on real-world datasets, CQB-$\epsilon$ converged to the optimal queue level significantly faster than non-contextual baselines (like Q-UCB and Q-ThS), demonstrating that ignoring context leads to substantially longer queues.

Limitations and Future Directions

While groundbreaking, the current analysis is limited to a system with a single central queue and multiple servers. Extending this to "multi-queue" systems (where jobs are routed to specific queues upon arrival) is significantly harder due to the increased complexity of the coupling arguments. Additionally, the proofs rely on knowing a lower bound for "traffic slack" ($\epsilon$)—a guarantee that the system can be stabilized. Future work could explore adaptively estimating this slack, as well as investigating non-preemptive routing rules for physical systems where jobs cannot be interrupted once started.

Summary updated

BibTeX
@inproceedings{bae2026queue,
  author = {Seoungbin Bae and Garyeong Kang and Dabeen Lee},
  title = {{Queue Length Regret Bounds for Contextual Queueing Bandits}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=bBPOcj5dOg},
}
Figure