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 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 ca8bdf44-3b4d-44bf-9269-c82746821a56Cited by top-tier papers10
- Neurosymbolic Diffusion ModelsEmile van Krieken, Pasquale Minervini, Edoardo Maria Ponti, Antonio VergariNeurIPS 2025 · 12 citations
- Data-Efficient Learning with Neural ProgramsAlaia Solko-Breslin, Seewon Choi, Ziyang Li, Neelay Velingker et al.NeurIPS 2024 · 10 citations
- On the Hardness of Probabilistic Neurosymbolic LearningJaron Maene, Vincent Derkinderen, Luc De RaedtICML 2024 · 6 citations
- Generalizing Stochastic Smoothing for Differentiation and Gradient EstimationFelix Petersen, Christian Borgelt, Aashwin Mishra, Stefano ErmonICML 2026 · 4 citations
- Relational Neurosymbolic Markov ModelsLennert De Smet, Gabriele Venturato, Luc De Raedt, Giuseppe MarraAAAI 2025 · 3 citations
Builds on9
- On the Noisy Gradient Descent that Generalizes as SGDJingfeng Wu, Wenqing Hu, Haoyi Xiong, Jun Huan et al.ICML 2020 · 125 citations
- Implicit MLE: Backpropagating Through Discrete Exponential Family DistributionsMathias Niepert, Pasquale Minervini, Luca FranceschiNeurIPS 2021 · 121 citations
- Scallop: From Probabilistic Deductive Databases to Scalable Differentiable ReasoningJiani Huang, Ziyang Li, Binghong Chen, Karan Samel et al.NeurIPS 2021 · 101 citations
- 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
- Estimating Gradients for Discrete Random Variables by Sampling without ReplacementWouter Kool, Herke van Hoof, Max WellingICLR 2020 · 59 citations
Related papers
- Coupled Gradient Estimators for Discrete Latent VariablesZhe Dong, Andriy Mnih, George TuckerNeurIPS 2021 · 14 citations
- CARMS: Categorical-Antithetic-REINFORCE Multi-Sample Gradient EstimatorAlek Dimitriev, Mingyuan ZhouNeurIPS 2021 · 10 citations
- Categorical Reparameterization with Denoising Diffusion ModelsSamson Gourevitch, Alain Oliviero Durmus, Eric Moulines, Jimmy Olsson et al.ICML 2026 · 1 citation
- Beyond Softmax: A Natural Parameterization for Categorical Random VariablesAlessandro Manenti, Cesare AlippiICML 2026
- Gradient Estimation with Discrete Stein OperatorsJiaxin Shi, Yuhao Zhou, Jessica Hwang, Michalis K. Titsias et al.NeurIPS 2022 · 27 citations
