NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Lost Relatives of the Gumbel Trick

Matej Balog, Nilesh Tripuraneni, Zoubin Ghahramani, Adrian Weller

TL;DR

This paper introduces a new family of "perturb-and-MAP" methods that generalize the well-known Gumbel trick using Weibull and Fréchet distributions. These "lost relatives" provide more sample-efficient estimators for partition functions and tighter bounds for discrete graphical models, often requiring up to 40% fewer samples than the standard Gumbel trick to achieve the same accuracy.

What Problem Does This Paper Address?

Sampling from discrete probability distributions and calculating their normalizing constants (the partition function, $Z$) are core challenges in machine learning and statistics. For complex models like discrete graphical models, these tasks are often computationally intractable (#P-hard).

The Gumbel trick is a popular "perturb-and-MAP" approach: you add random Gumbel noise to the model's potential functions and then find the most likely configuration (the MAP solution). Repeating this allows you to estimate $Z$ or sample from the distribution. However, the Gumbel trick is just one specific choice of noise. This paper asks: Are there other distributions that work better? And can we use them without making the underlying optimization problem harder?

Methods

The authors show that the Gumbel trick is actually a special case of a race between competing exponential clocks. By applying different mathematical transformations to the results of these "races," they derive a family of new tricks:

  • The Exponential Trick: Uses the identity function.
  • The Weibull Trick: Uses a power-law transformation ($\alpha > 0$).
  • The Fréchet Trick: Uses a power-law transformation with negative exponents ($\alpha < 0$).

A key practical contribution is Proposition 2, which proves that these new tricks can be implemented using existing Gumbel MAP solvers. You simply take the output of a standard Gumbel-perturbed MAP solver and pass the resulting value through a simple non-linear function before averaging.

The authors also extend these methods to low-rank perturbations (like sum-unary perturbations), which are essential for high-dimensional graphical models where perturbing every single configuration is impossible.

Datasets

The methods were evaluated on several benchmarks:

  • Robust Bayesian Regression: A continuous sampling task used to test the efficiency of the Exponential trick in an A* sampling framework.
  • Scalable Discrete Sampling: A synthetic dataset with a large number of factors, used to test partition function estimation under factor subsampling.
  • Binary Spin Glass Models: $10 \times 10$ grids with both "attractive" (cooperative) and "mixed" potentials, used to evaluate the tightness of new upper and lower bounds on the log-partition function.

Key Insights and Ideas

  • Efficiency Gains: The Exponential trick is theoretically and empirically more efficient than the Gumbel trick for estimating the partition function. As shown in Figure 1, it significantly reduces the Mean Squared Error (MSE) for a given number of samples.
Figure 1: Analytically computed MSE and variance of Gumbel and Exponential trick estimators of Z (left) and ln Z (right). The MSEs are dominated by the variance, so the dashed and solid lines mostly overlap. See Section 2.3.2 for details.
  • The Power of $\alpha$: The family is parameterized by $\alpha$. While Gumbel corresponds to $\alpha \to 0$, choosing $\alpha = 1$ (Exponential) or $\alpha < 0$ (Fréchet) often yields better results depending on the specific model structure.
  • Tighter Bounds: In graphical models, the Fréchet trick can provide tighter upper bounds on $\ln Z$ than the standard Gumbel bound.
  • The Gumbel Advantage: Despite the efficiency of its relatives, the Gumbel trick remains unique because it is "variance stabilizing"—the variance of its log-partition estimator doesn't depend on the actual value of $Z$.

Key Results

  • Sample Efficiency: In full-rank settings, the Exponential trick requires approximately 39-40% fewer samples than the Gumbel trick to reach the same MSE. This was confirmed in both theoretical analysis and a Robust Bayesian Regression experiment (Figure 3a).
Figure 3: (a) Sample size M required to reach a given MSE using Gumbel and Exponential trick estimators of ln Z, using samples from A∗sampling (see Section 5.1) on a Robust Bayesian Re- gression task. The Exponential trick is more efficient, requiring up to 40% fewer samples to reach a given MSE. (b) MSE of ln Z estimators for different values of α, using M = 100 samples from the approximate MAP algorithm discussed in Section 5.2, with different error bounds δ. For small δ, the Exponential trick is close to optimal, matching the analysis of Section 2.3.2. For larger δ, the Weibull trick interpolation between the Gumbel and Exponential tricks can provide an estimator with lower MSE.
  • Better Bounds for Graphical Models: On spin glass models, the authors found that non-zero values of $\alpha$ consistently outperformed the Gumbel trick ($\alpha=0$). Specifically, for many coupling strengths, the Fréchet trick ($\alpha < 0$) provided more accurate estimators of the log-partition function.
  • Unified Theory: The paper provides new theoretical links between the errors in partition function estimation, sampling, and entropy estimation for low-rank Gumbel perturbations.

Limitations and Future Work

The authors note that the optimal choice of $\alpha$ depends on the specific model, the number of samples, and whether the MAP solver used is exact or approximate. Currently, there isn't a simple rule to pick the best $\alpha$ a priori, though one can assess different values during computation since the MAP solver calls are the dominant cost.

Future work includes developing automated ways to select $\alpha$ and proving stronger measure concentration results for the $\alpha \neq 0$ cases, which would provide better probabilistic guarantees for the estimators.

Summary updated

BibTeX
@inproceedings{balog2017lost,
  author = {Matej Balog and Nilesh Tripuraneni and Zoubin Ghahramani and Adrian Weller},
  title = {{Lost Relatives of the Gumbel Trick}},
  booktitle = {International Conference on Machine Learning},
  year = {2017},
  url = {https://openreview.net/forum?id=SJ-Vio-OZS},
}
Figure