the.ai

Optimization / Training

verified

Straight-Through Estimator

A discrete step — rounding, picking an index, thresholding — has a derivative of zero almost everywhere, so gradients die at it and nothing upstream learns. The straight-through trick is to use the discrete value going forward and pretend, on the way back, that the step was the identity. It is knowingly the wrong gradient, and it works.

Viz primitive · budget-splitestimator-bias = 8

estimator-bias holds 17% of the budget; rest holds the remaining 83%.

Error contributed by the straight-through approximation's bias, against the error an unbiased sampling estimator's variance would contribute instead, in equal units. Drag the bias up to watch it overtake — the trade only pays while it stays the smaller of the two, which is why stacking discrete steps is where it stops.

8

Reviewed by opendroid · 2026-08-19

  • arXiv:1308.3432 — Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computation
  • arXiv:1711.00937 — Neural Discrete Representation Learning