cs.LGMay 28, 2026

The Sample Complexity of Multiclass and Sparse Contextual Bandits

Authors: Liad ErezFan ChenAlon CohenTomer KorenYishay MansourShay MoranAlexander Rakhlin

Organizations: 1Tel Aviv University, Israel · 2Massachusetts Institute of Technology, USA · 3Google Research Tel Aviv, Israel · 4Technion—Israel Institute of Technology, Haifa, Israel

Abstract

We study contextual bandits in the stochastic i.i.d.\ setting, where a learner observes contexts drawn from an unknown distribution, selects actions from a finite set AA, and aims to identify an approximately optimal policy from a given class based on bandit feedback. Motivated by bandit multiclass classification with zero-one rewards, we focus on the \emph{ss-sparse} setting in which, for every context, the reward vector has L1L_1-norm at most sAs \ll |A|. Our main result is the design of algorithms that, with high probability, output an εε-optimal policy compared to policy class ΠΠ using O~((s/ε2+A/ε)logΠ/δ)\tilde{O} ((s/ε^2 + |A|/ε)\log |Π|/δ) samples. We extend this bound to general Natarajan classes and complement it with a matching lower bound (up to logarithmic factors), thereby closing a substantial gap left by prior work (Erez et al., 2024, 2025), which incurred an additional Θ(A9)Θ(|A|^9) dependence. We obtain these results via two complementary approaches. First, we analyze contextual bandits through the lens of contextual decision making with structured observations, designing an exploration-by-optimization algorithm whose sample complexity is governed by the \emph{decision-estimation coefficient} (DEC; Foster et al., 2021, 2022). We show that, with ss-sparse rewards, the induced model class admits a sharp DEC bound that scales with ss and directly yields the optimal rate. Since this approach is largely information-theoretic and involves solving complex min-max optimization problems, we also develop a second, more specialized algorithmic method based on a low-variance exploration technique. This approach leads to concrete, tractable algorithms and naturally extends to contextual combinatorial semi-bandits, leading to improved sample complexity guarantees for bandit multiclass list classification.

Explore similar work

May 24, 2026cs.LG

Active Learning for Stochastic Contextual Linear Bandits

A key goal in stochastic contextual linear bandits is to efficiently learn a near-optimal policy. Prior algorithms for this problem learn a policy by strategically sampling actions but naively (passively) sampling contexts from the underlying context distribution. However, in many practical scenarios -- including online content recommendation, survey research, and clinical trials -- practitioners can actively sample or recruit contexts based on prior knowledge of the context distribution. Despite this potential for active learning, the role of strategic context sampling in stochastic contextual linear bandits is underexplored. We propose an algorithm that learns a near-optimal policy by strategically sampling rewards of context-action pairs. We prove instance-dependent theoretical guarantees demonstrating that our active context sampling strategy can improve over the minimax rate by up to a factor of d\sqrt{d}, where dd is the linear dimension. We show empirically that our algorithm reduces the number of samples needed to learn a near-optimal policy, in tasks such as warfarin dose prediction and joke recommendation.
Emma Brunskill, Ishani Karmarkar, Zhaoqi Li
May 19, 2026cs.LG

Active Context Selection Improves Simple Regret in Contextual Bandits

We study the contextual multi-armed bandit problem with a finite context space (a.k.a. subpopulations), where the learner recommends a best action for each context and is evaluated by context-weighted simple regret. Our guarantees are worst-case over the reward distributions, while remaining instance-dependent with respect to the context distribution vector pp. Akin to experimental design problems where the population of interest is fixed but the sampled subpopulation can be controlled, we allow the learner to actively choose which context to sample from. For a known pp, we characterize tight regret rates: passive sampling where contexts are randomly revealed achieves regret of order n/Tp1/2\sqrt{n/T \, \lVert p \rVert_{1/2}}, whereas active sampling with allocation qjpj2/3q_j \propto p_j^{2/3} achieves the tight rate n/Tp2/3\sqrt{n/T} \, \lVert p \rVert_{2/3}. The resulting improvement can be as large as Θ(k1/4)Θ(k^{1/4}), where kk is the number of contexts. We further extend the analysis to budgeted active sampling, characterize the corresponding tight rate, and identify when a limited active budget suffices to recover the fully active rate. When pp is unknown, we propose the Explore-Explore-Then-Commit (EETC) algorithm, which optimally balances estimating the context distribution and the time to switch to active allocation, such that for large horizons, it matches the known-pp active rate up to constants. Experiments on synthetic and real-world data support our theoretical findings.
Mohammad Shahverdikondori, Jalal Etesami, Negar Kiyavash
Sep 14, 2026cs.LG

Nearly Minimax-Optimal Regret for Linear Contextual Bandits with Arbitrary Adaptive Action Sets

We study stochastic linear contextual bandits with arbitrary action menus that may depend on the fixed parameter and the interaction history. We establish matching upper and lower bounds, up to logarithmic factors. Let dd be the dimension, KK be the menu size, and TT the time horizon. For 2Kd2\le K\le d, we prove an upper bound O~(K1/4dT)\widetilde O(K^{1/4}\sqrt{dT}). When Td2T\ge d^2, we further prove a lower bound Ω(K1/4dT)Ω(K^{1/4}\sqrt{dT}). Thus, for Td2T\ge d^2 and 2Kd2\le K\le d, the upper and lower bounds match up to logarithmic factors, and the polynomial dependence on KK is optimal. Compared with the previous O~(dKT)\widetilde O(\sqrt{dKT}) bound, our upper bound improves the dependence on KK by a factor of K1/4K^{1/4}. For KdK\ge d, we prove an upper bound O~d,T(dTmin{d,(dlogK)1/4})\widetilde O_{d,T}\left(\sqrt{dT}\min\{\sqrt d,(d\log K)^{1/4}\}\right) and a lower bound Ω(dTmin{d,(dlogKlog(2d))1/4})Ω\left(\sqrt{dT}\min\left\{\sqrt d,\left(\frac{d\log K}{\log(2d)}\right)^{1/4}\right\}\right). Here, O~d,T\widetilde O_{d,T} omits logarithmic factors only in dd and TT. In particular, for polynomially large KdK\ge d, the upper and lower bounds both scale as d3/4Td^{3/4}\sqrt T up to logarithmic factors, improving the standard O~(dT)\widetilde O(d\sqrt T) rate by a factor of d1/4d^{1/4}. As KK grows further, the regret smoothly recovers the dTd\sqrt T scale once logK\log K reaches order dd.
Tianyuan Jin