Energy-Efficient Random Variate Generation via Compressed Lookup Tables
Johann Ukrow, Anna Kazachkova, Nicolas Alder, Sven Köhler, Rainer Schlosser, Ralf Herbrich
Abstract
Generating (pseudo-)random variates lies at the core of probabilistic machine learning and prediction algorithms and yet remains a major bottleneck due to its high computational and energy cost. In this paper, we introduce a general and scalable sampling strategy that enables fast and energy-efficient random variate generation from arbitrary distributions. Our approach is based on compressed lookup tables (cLUT) combined with a fast index sampling scheme. Using only a handful of fast and energy-efficient compute operations on simple array structures, we achieve superior speed, energy efficiency, and precision at near-optimal entropy cost compared to state-of-the-art techniques. Microbenchmarking our approach with a C implementation shows up to 40% savings in time and 50% in energy compared to state-of-the-art approaches. Compared to commonly employed Python samplers, we achieve a 100× time improvement. * Equal contribution. i -p i log 2 (p i ) is the Shannon entropy. While entropy-optimal, discrete distribution generating trees typically require exponential memory in the distribution precision. Lumbroso (2013) overcame this limitation for uniform and Bernoulli distributions with a linear-memory implementation, but the approach does not generalize to arbitrary distributions. The generic interval algorithm (Hao and Hoshi, 2006) achieves linear memory usage while consuming at most H(p) + 3 bits per sample. However, implementations require expensive binary searches at each sampling step, limiting practical efficiency (Devroye and Gravel, 2020; Uyematsu and Li, 2003) . Saad et al. (2020) presented the FLDR algorithm that combines entropy-optimal sampling with rejection sampling, achieving an upper bound of H(p) + 6 bits per sample. ? improved this to H(p) + 2 bits with faster sampling speed for the ALDR algorithm, though at a higher memory cost. Building on Marsaglia (1963 ), Marsaglia et al. (2004) proposed compressed lookup tables for discrete sampling. However, their compression scheme requires conditional branching and searches across multiple tables during sampling,
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 18f5fdc0-9943-4836-b9d0-c0fe9d73e86dBuilds on5
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
- PLATYPUS: Software-based Power Side-Channel Attacks on x86Moritz Lipp, Andreas Kogler, David F. Oswald, Michael Schwarz et al.S&P 2021 · 242 citations
- PriorGrad: Improving Conditional Denoising Diffusion Models with Data-Dependent Adaptive PriorSang-gil Lee, Heeseung Kim, Chaehun Shin, Xu Tan et al.ICLR 2022 · 117 citations
- Microcanonical Langevin Ensembles: Advancing the Sampling of Bayesian Neural NetworksEmanuel Sommer, Jakob Robnik, Giorgi Nozadze, Uros Seljak et al.ICLR 2025
Related papers
- Efficient Online Random Sampling via Randomness RecyclingThomas L. Draper, Feras A. SaadSODA 2026
- Optimal approximate sampling from discrete probability distributionsFeras A. Saad, Cameron E. Freer, Martin C. Rinard, Vikash K. MansinghkaPOPL 2020 · 3 citations
- Accelerating Multiparty Noise Generation Using LookupsFredrik Meisingseth, Christian Rechberger, Fabian SchmidCCS 2026 · 3 citations
- Can Learned Indexes be Built Efficiently? A Deep Dive into Sampling Trade-offsMinguk Choi, Seehwan Yoo, Jongmoo ChoiSIGMOD 2024 · 5 citations
- Random Variate Generation with Formal GuaranteesFeras A. Saad, Wonyeol LeePLDI 2025
