ReLU, the rectified linear unit, is f(x) = max(0, x): negative inputs become 0 and positive ones pass through. It beats sigmoid in hidden layers mainly because it does not saturate for positive inputs, where its gradient is exactly 1, so gradients survive many layers. It is also cheaper, with no exponential.
Sigmoid's derivative, σ(x)(1 − σ(x)), is at most 0.25 and about 0.0066 at x = 5. Backpropagation multiplies one such factor per layer; over ten sigmoid layers they alone multiply to at most 0.25¹⁰ ≈ 9.5 × 10⁻⁷, while an active ReLU's factor is 1. In the 2012 AlexNet paper, a four-layer CNN with ReLUs reached 25% training error on CIFAR-10 six times faster than with tanh.
ReLU reduces vanishing gradients rather than solving them. A unit whose input stays negative gets zero gradient and can die, ReLU outputs are not zero-centered, and deep networks also need He initialization, normalization and residual connections. Follow-up: why did zero-centered tanh also lose? It saturates at both ends, like sigmoid.
Dying units led to variants. Leaky ReLU multiplies negative inputs by a small slope α instead of zeroing them, f(x) = x if x > 0, otherwise αx, so a unit stuck in the negative region still gets gradient α and can recover: with α = 0.01, the inputs −5 and 3 become −0.05 and 3. Andrew Maas, Awni Hannun and Andrew Ng proposed it in 2013. Defaults differ: PyTorch uses 0.01, the Keras layer 0.3, and DCGAN discriminators 0.2, while PReLU, from Kaiming He and colleagues in 2015, learns α during training. The gains are often small, and transformers mostly use GELU or SiLU.