Fast Generating A Large Number of Gumbel-Max Variables
Yiyan Qi, Pinghui Wang, Yuanming Zhang, Junzhou Zhao, Guangjian Tian, Xiaohong Guan
Abstract
The well-known Gumbel-Max Trick for sampling elements from a categorical distribution (or more generally a nonnegative vector) and its variants have been widely used in areas such as machine learning and information retrieval. To sample a random element i (or a Gumbel-Max variable i) in proportion to its positive weight v i , the Gumbel-Max Trick first computes a Gumbel random variable д i for each positive weight element i, and then samples the element i with the largest value of д i + ln v i . Recently, applications including similarity estimation and graph embedding require to generate k independent Gumbel-Max variables from high dimensional vectors. However, it is computationally expensive for a large k (e.g., hundreds or even thousands) when using the traditional Gumbel-Max Trick. To solve this problem, we propose a novel algorithm, FastGM, that reduces the time complexity from O(kn + ) to O(k ln k + n + ), where n + is the number of positive elements in the vector of interest. Instead of computing k independent Gumbel random variables directly, we find that there exists a technique to generate these variables in descending order. Using this technique, our method FastGM computes variables д i + ln v i for all positive elements i in descending order. As a result, FastGM significantly reduces the computation time because we can stop the procedure of Gumbel random variables computing for many elements especially for those with small weights. Experiments on a variety of real-world datasets show that FastGM is orders of magnitude faster than state-of-theart methods without sacrificing accuracy and incurring additional expenses.
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 88c80747-6de2-41ac-8bbd-7bbdad002e27Cited by top-tier papers1
Ask how each one uses itRelated papers
- Gradient Estimation with Stochastic Softmax TricksMax B. Paulus, Dami Choi, Daniel Tarlow, Andreas Krause et al.NeurIPS 2020 · 104 citations
- High-Dimensional Approximate Nearest Neighbor Search: with Reliable and Efficient Distance Comparison OperationsJianyang Gao, Cheng LongSIGMOD 2023 · 73 citations
- Leveraging Recursive Gumbel-Max Trick for Approximate Inference in Combinatorial SpacesKirill Struminsky, Artyom Gadetsky, Denis Rakitin, Danil Karpushkin et al.NeurIPS 2021 · 11 citations
- Learning Group Importance using the Differentiable Hypergeometric DistributionThomas M. Sutter, Laura Manduchi, Alain Ryser, Julia E. VogtICLR 2023 · 1 citation
- Efficient Marginalization of Discrete and Structured Latent Variables via SparsityGonçalo M. Correia, Vlad Niculae, Wilker Aziz, André F. T. MartinsNeurIPS 2020 · 25 citations
