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: . It's shaped like a flattened S — steep and responsive near , but nearly flat once gets much larger than about or smaller than about . In that flat region the function is said to saturate: its output barely changes as the input changes further, meaning is close to 1 for large positive and close to 0 for large negative , no matter how much larger or smaller gets.
The gradient of the sigmoid is , which is largest (0.25) at and shrinks toward zero as approaches 0 or 1. So a saturated neuron — one whose input 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 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 gives , with gradient — a value 800 times smaller than the gradient at , 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.
Practice in interviews
Further reading
- Goodfellow, Bengio & Courville, Deep Learning, ch. 6