Quant Memo
Core

Sigmoid Saturation and Logit Scaling

Why the sigmoid activation function's gradient vanishes for large positive or negative inputs, and why scaling the pre-activation logits keeps the network in the responsive middle of the curve instead of the flat, uninformative tails.

Prerequisites: Activation Functions

The sigmoid function squashes any input into a value between 0 and 1: σ(z)=11+ez\sigma(z) = \frac{1}{1 + e^{-z}}. It's shaped like a flattened S — steep and responsive near z=0z=0, but nearly flat once zz gets much larger than about +5+5 or smaller than about 5-5. In that flat region the function is said to saturate: its output barely changes as the input changes further, meaning σ(z)\sigma(z) is close to 1 for large positive zz and close to 0 for large negative zz, no matter how much larger or smaller zz gets.

The gradient of the sigmoid is σ(z)(1σ(z))\sigma(z)(1-\sigma(z)), which is largest (0.25) at z=0z=0 and shrinks toward zero as σ(z)\sigma(z) approaches 0 or 1. So a saturated neuron — one whose input zz is far from zero — has a near-zero gradient, meaning backpropagation passes almost no learning signal through it: the weights feeding into that neuron barely update, even if the neuron's output is completely wrong for the task.

This is why practitioners scale the pre-activation logits (the raw zz values before the sigmoid) to stay in a moderate range, typically by careful weight initialization and input normalization, rather than letting them grow large during training. A logit of z=8z=8 gives σ(8)0.9997\sigma(8) \approx 0.9997, with gradient σ(z)(1σ(z))0.0003\sigma(z)(1-\sigma(z)) \approx 0.0003 — a value 800 times smaller than the gradient at z=0z=0, effectively freezing that neuron's learning.

Sigmoid saturates for large-magnitude inputs, driving its gradient toward zero and stalling learning in that neuron; keeping pre-activation logits in a moderate range through proper initialization and normalization is what keeps a sigmoid-based network trainable rather than stuck in the flat tails.

Related concepts

Practice in interviews

Further reading

  • Goodfellow, Bengio & Courville, Deep Learning, ch. 6
ShareTwitterLinkedIn