Abstract: We consider the task of generating exact samples from a target distribution, known up to normalization, over a finite alphabet. The classical algorithm for this task is rejection sampling, and although it has been used in practice for decades, there is surprisingly little study of its fundamental limitations. In this work, we study the query complexity of rejection sampling in a minimax framework for various classes of discrete distributions. Our results provide new algorithms for sampling whose complexity scales sublinearly with the alphabet size. When applied to adversarial bandits, we show that a slight modification of the EXP3 algorithm reduces the per-iteration complexity from O(K) to O(log(K) log(K/\ensuremath{\delta})) with probability 1-\ensuremath{\delta}, where K is the number of arms.
Introduction
Sampling from a discrete distribution $p$ over an alphabet of size $N$ typically requires $O(N)$ time, especially when only unnormalized access to $p$ is available. This linear complexity becomes a significant bottleneck in large-scale applications such as recommendation systems or multi-armed bandit problems with millions of arms. This paper investigates whether structural assumptions—specifically shape constraints like monotonicity or log-concavity—can be leveraged to achieve sublinear sampling complexity.
Rejection Sampling Complexity
The authors adopt a minimax framework to study "rejection sampling complexity," defined as the minimum number of queries to an unnormalized distribution $\tilde{p}$ required to construct a valid proposal distribution $\tilde{q}$ for rejection sampling. The core idea is to find an "upper envelope" that sits above the target distribution. By exploiting geometric structure, one can construct an envelope that is "tight enough" for efficient sampling without querying every possible outcome.
Theoretical Results
The paper establishes sublinear query complexities for several important classes of distributions. For monotone distributions, a staircase-shaped envelope can be constructed in $O(\log N)$ queries. Even more impressively, log-concave distributions (which include discrete Gaussians) allow for sampling in $O(\log \log N)$ time by using binary search to locate the distribution's exponential decay. This is effectively constant for any practical alphabet size.
Fast-Exp3 for Adversarial Bandits
The theoretical insights are applied to the Exp3 algorithm for adversarial bandits. Standard Exp3 requires $O(K)$ time per iteration to update probabilities and sample an arm. By maintaining arm losses in a specialized data structure (an augmented binary search tree), the authors transform the sampling step into a monotone sampling problem. The resulting "Fast-Exp3" algorithm reduces the per-iteration complexity to logarithmic scales.
Empirical Evaluation
Experiments on synthetic bandit problems, including "bumpy" loss scenarios and stochastic settings, demonstrate the practical utility of the sublinear approach. While the standard Exp3 algorithm's runtime grows linearly with the number of arms, Fast-Exp3 remains nearly flat. Crucially, this efficiency gain does not compromise the algorithm's performance; the evolution of regret remains nearly identical between the two versions.
Conclusion and Limitations
This work demonstrates that structural properties of distributions can be exploited to bypass the $O(N)$ sampling barrier. While the current focus is on 1D linear orders and simple trees, future research may extend these sublinear techniques to more complex structures, such as general graphs or high-dimensional continuous spaces. Additionally, while the theoretical bounds are strong, the constant factors involved in maintaining specialized data structures like augmented trees may be relevant for smaller alphabet sizes.
Summary updated