Architecture / Sparsity
verifiedConditional Computation
Most networks spend the same effort on every input, whether it is trivial or hard. Conditional computation lets the network decide, per input, which parts of itself to run. The appeal is obvious and the difficulty is specific: the decision is discrete, and you cannot take a gradient through a choice.
Any architecture where a learned gate switches parts of the graph on or off per example — early exit, skipped layers, routed experts. The blocker is that a hard gate is non-differentiable, so training needs an estimator: a straight-through pass that treats the discrete choice as identity on the backward pass, a continuous relaxation, or a policy-gradient treatment of the gate. A second failure mode is degenerate collapse, where the gate finds one branch and stops exploring.
With gate g(x) ∈ {0,1} and branch f, the forward pass computes y = g(x)·f(x) and ∂y/∂θ sub g is zero almost everywhere. The straight-through estimator substitutes the derivative of a surrogate, using ∂g̃/∂θ sub g with g̃ = σ(z) on the backward pass while the forward pass keeps the hard threshold. The bias this introduces is tolerated because the variance of an unbiased score-function estimator is worse in practice.
8 values. The left group decays steeply; the right group is 33% of the way to flat, and reads flatter than the left.
A relaxed gate's output distribution as temperature rises. Drag it up to watch the gate soften toward an even blend — hardening into a discrete choice is the same knob toward zero, which this figure bottoms out at rather than passing through.
Reviewed by opendroid · 2026-08-01
- arXiv:1511.06297 — Conditional Computation in Neural Networks for Faster Models
- arXiv:1308.3432 — Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computation