Up nextNext guide
Softmax Regression for Multiclass Classification
Technical
Technical GUIDE
Gumbel-Softmax is a trick that lets neural networks 'sample' from discrete categories while still being trainable by gradient descent.
Listen to this guideAI-narrated · ~2 min
It matters because backpropagation normally can't flow through a random, discrete choice.
Neural networks learn by sending gradients backward through every operation. But sampling a discrete category (like picking word #7 of 50,000) is a hard, non-differentiable jump, so gradients die there. The reparameterization trick rewrites random sampling so the randomness comes from a fixed external noise source, leaving a smooth, differentiable path for gradients. Gumbel-Softmax applies this to categorical variables: it adds Gumbel-distributed noise to the logits, then replaces the hard argmax with a temperature-controlled softmax. At high temperature the output is a smooth blob over categories; as temperature drops toward zero it sharpens toward a near one-hot vector, recovering true sampling while staying differentiable throughout.
Training variational autoencoders with categorical (discrete) latent codes instead of only continuous Gaussian ones.
Differentiable neural architecture search (e.g., DARTS-style methods) selecting which operation to place at each layer.
Learning discrete codebook selections in VQ-style and discrete representation models.
Differentiable routing or gating decisions in mixture-of-experts and conditional-computation networks.
Gumbel-Softmax remains a default tool for discrete latent variables, differentiable architecture search, vector-quantized models, and learned routing in mixture-of-experts systems. Research continues on lower-variance, lower-bias relaxations (such as Rao-Blackwellized and control-variate estimators) and on annealing schedules that balance the bias of warm temperatures against the high gradient variance of cold ones. As models increasingly make explicit discrete decisions, expect these continuous relaxations to stay central to making such choices learnable end-to-end.
Free newsletter
One short email each weekday with the three AI stories that actually matter. Free forever, no ads.
One email each weekday. Unsubscribe in one click. We never sell or share your address.
Test yourself
Instant feedback on every answer, and a shareable certificate with a verifiable ID once you pass a course.
Support free AI education. AI Understanding is a 501(c)(3) nonprofit — no ads, no paywall, ever. Make a donation
Gumbel-Softmax is a trick that lets neural networks 'sample' from discrete categories while still being trainable by gradient descent. It matters because backpropagation normally can't flow through a random, discrete choice.
The guide explains gradients do not pass through a hard discrete jump.
The guide describes moving randomness into a noise source and preserving a smooth path.
The guide gives the noisy softmax construction for differentiable categorical sampling.
High temperature yields a smoother distribution over categories.
The guide says low temperature sharpens toward a near one-hot vector.
Keep learning
More guides picked for this topic
Up nextNext guide
Softmax Regression for Multiclass Classification
Technical