Up nextNext guide
Using AI to Work Through Physics Problems
Applications
Technical GUIDE
The Straight-Through Estimator (STE) is a simple trick for training networks that contain hard, non-differentiable steps like rounding or thresholding.
Listen to this guideAI-narrated · ~2 min
It uses the discrete value on the forward pass but pretends the operation was the identity when computing gradients.
Some operations, such as rounding to an integer, binarizing weights to +1/-1, or picking the top category with argmax, have a derivative that is zero almost everywhere and undefined at the jumps. That zero gradient stops learning cold. The Straight-Through Estimator sidesteps this by decoupling the forward and backward passes: forward, it applies the true hard operation; backward, it simply copies the incoming gradient straight through as if the operation had been the identity (or a smooth proxy). The estimate is biased, because the true gradient really is zero, yet in practice this 'pretend it was smooth' approximation trains binarized and quantized networks remarkably well, which is why STE is a workhorse of efficient deep learning.
Training binary and low-bit quantized neural networks for efficient inference on phones and edge devices.
Backpropagating through the discrete codebook lookup in VQ-VAE and neural audio/image tokenizers.
Quantization-aware training where weights or activations are rounded to fixed-point during the forward pass.
Learning hard attention or discrete gating where an argmax or threshold sits in the computation path.
STE underpins the surge in low-bit and binary neural networks pursued for on-device and energy-constrained AI, and it is central to training vector-quantized models like those used in modern image and audio tokenizers. Ongoing work seeks tighter, less-biased gradient estimators and better theoretical understanding of why such a crude approximation works. As demand for tiny, fast, quantized models grows on phones and edge hardware, expect STE-style tricks to remain foundational despite their known bias.
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
The Straight-Through Estimator (STE) is a simple trick for training networks that contain hard, non-differentiable steps like rounding or thresholding. It uses the discrete value on the forward pass but pretends the operation was the identity when computing gradients.
The guide describes a hard forward pass and a surrogate backward pass.
The guide says hard rounding has a zero or undefined derivative that can stop learning.
The guide explicitly notes that the approximation is biased.
The guide names quantization and rounding as common applications.
The guide gives this pattern to preserve the hard value while passing the identity gradient.
Keep learning
More guides picked for this topic
Up nextNext guide
Using AI to Work Through Physics Problems
Applications