The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions. Saad, F. A., Freer, C. E., Rinard, M. C., & Mansinghka, V. K. In AISTATS 2020: Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics, volume 108, of Proceedings of Machine Learning Research, pages 1036–1046, Palermo, Sicily, Italy, 2020. PMLR.
The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions [pdf]Paper  The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions [pdf]Supplement  The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions [link]Link  The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions [link]Code  The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions [link]Experiments  The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions [link]Mit news  The fast loaded dice roller: A near-optimal exact sampler for discrete probability distributions [link]Quanta  abstract   bibtex   71 downloads  
This paper introduces a new algorithm for the fundamental problem of generating a random integer from a discrete probability distribution using a source of independent and unbiased random coin flips. This algorithm, which we call the Fast Loaded Dice Roller (FLDR), has efficient complexity properties in space and time: the size of the sampler is guaranteed to be linear in the number of bits needed to encode the target distribution and the sampler consumes (in expectation) at most 6.5 bits of entropy more than the information-theoretically minimal rate, independently of the values or size of the target distribution. We present an easy-to-implement, linear-time preprocessing algorithm and a fast implementation of the FLDR using unsigned integer arithmetic. Empirical evaluations establish that the FLDR is 2x–10x faster than multiple baseline algorithms for exact sampling, including the widely-used alias and interval samplers. It also uses up to 10000x less space than the information-theoretically optimal sampler, at the expense of a less than 1.5x runtime overhead.

Downloads: 71