Lune

NeurIPS2023Top-tier venue

Differentiable Sampling of Categorical Distributions Using the CatLog-Derivative Trick

Lennert De Smet, Emanuele Sansone, Pedro Zuidberg Dos Martires

Abstract

Categorical random variables can faithfully represent the discrete and uncertain aspects of data as part of a discrete latent variable model. Learning in such models necessitates taking gradients with respect to the parameters of the categorical probability distributions, which is often intractable due to their combinatorial nature. A popular technique to estimate these otherwise intractable gradients is the Log-Derivative trick. This trick forms the basis of the well-known REINFORCE gradient estimator and its many extensions. While the Log-Derivative trick allows us to differentiate through samples drawn from categorical distributions, it does not take into account the discrete nature of the distribution itself. Our first contribution addresses this shortcoming by introducing the CatLog-Derivative trick - a variation of the Log-Derivative trick tailored towards categorical distributions. Secondly, we use the CatLog-Derivative trick to introduce IndeCateR, a novel and unbiased gradient estimator for the important case of products of independent categorical distributions with provably lower variance than REINFORCE. Thirdly, we empirically show that IndeCateR can be efficiently implemented and that its gradient estimates have significantly lower bias and variance for the same number of samples compared to the state of the art.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Data-Efficient Learning with Neural Programs cites Scallop: From Probabilistic Deductive Databases to Scalable Differentiable Reasoning
  • Relational Neurosymbolic Markov Models cites Scallop: From Probabilistic Deductive Databases to Scalable Differentiable Reasoning
  • On the Hardness of Probabilistic Neurosymbolic Learning cites Scallop: From Probabilistic Deductive Databases to Scalable Differentiable Reasoning
  • VarGrad: A Low-Variance Gradient Estimator for Variational Inference cites Estimating Gradients for Discrete Random Variables by Sampling without Replacement
  • Implicit MLE: Backpropagating Through Discrete Exponential Family Distributions cites Estimating Gradients for Discrete Random Variables by Sampling without Replacement
  • Neurosymbolic Diffusion Models cites Relational Neurosymbolic Markov Models
  • Neurosymbolic Diffusion Models cites On the Hardness of Probabilistic Neurosymbolic Learning
  • Neurosymbolic Diffusion Models cites Implicit MLE: Backpropagating Through Discrete Exponential Family Distributions
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. Neurosymbolic Diffusion ModelsEmile van Krieken, Pasquale Minervini, Edoardo Maria Ponti, Antonio VergariNeurIPS 2025 · 12 citations
  2. Data-Efficient Learning with Neural ProgramsAlaia Solko-Breslin, Seewon Choi, Ziyang Li, Neelay Velingker et al.NeurIPS 2024 · 10 citations
  3. On the Hardness of Probabilistic Neurosymbolic LearningJaron Maene, Vincent Derkinderen, Luc De RaedtICML 2024 · 6 citations
  4. Generalizing Stochastic Smoothing for Differentiation and Gradient EstimationFelix Petersen, Christian Borgelt, Aashwin Mishra, Stefano ErmonICML 2026 · 4 citations
  5. Relational Neurosymbolic Markov ModelsLennert De Smet, Gabriele Venturato, Luc De Raedt, Giuseppe MarraAAAI 2025 · 3 citations

Builds on9

  1. On the Noisy Gradient Descent that Generalizes as SGDJingfeng Wu, Wenqing Hu, Haoyi Xiong, Jun Huan et al.ICML 2020 · 125 citations
  2. Implicit MLE: Backpropagating Through Discrete Exponential Family DistributionsMathias Niepert, Pasquale Minervini, Luca FranceschiNeurIPS 2021 · 121 citations
  3. Scallop: From Probabilistic Deductive Databases to Scalable Differentiable ReasoningJiani Huang, Ziyang Li, Binghong Chen, Karan Samel et al.NeurIPS 2021 · 101 citations
  4. VarGrad: A Low-Variance Gradient Estimator for Variational InferenceLorenz Richter, Ayman Boustati, Nikolas Nüsken, Francisco J. R. Ruiz et al.NeurIPS 2020 · 90 citations
  5. Estimating Gradients for Discrete Random Variables by Sampling without ReplacementWouter Kool, Herke van Hoof, Max WellingICLR 2020 · 59 citations

Related papers

  1. Coupled Gradient Estimators for Discrete Latent VariablesZhe Dong, Andriy Mnih, George TuckerNeurIPS 2021 · 14 citations
  2. CARMS: Categorical-Antithetic-REINFORCE Multi-Sample Gradient EstimatorAlek Dimitriev, Mingyuan ZhouNeurIPS 2021 · 10 citations
  3. Categorical Reparameterization with Denoising Diffusion ModelsSamson Gourevitch, Alain Oliviero Durmus, Eric Moulines, Jimmy Olsson et al.ICML 2026 · 1 citation
  4. Beyond Softmax: A Natural Parameterization for Categorical Random VariablesAlessandro Manenti, Cesare AlippiICML 2026
  5. Gradient Estimation with Discrete Stein OperatorsJiaxin Shi, Yuhao Zhou, Jessica Hwang, Michalis K. Titsias et al.NeurIPS 2022 · 27 citations
Dusk over the sea between two cliffs drawn in fine vertical lines