Activation Functions › Leaky ReLU and PReLU
Language AI HandbookAll chapters Activation Functions › Leaky ReLU and PReLUOne section · Sections in this chapter4 / 16 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Both Leaky ReLU and Parametric ReLU (PReLU) address the dying neuron problem by ensuring that negative pre-activations still produce a nonzero gradient during backpropagation. They differ in whether the negative-side slope is fixed or learned.
Leaky ReLU
Leaky ReLU introduces a small slope on the negative side, so the gradient never completely vanishes:
where:
- : the pre-activation value
- : a small positive constant controlling the negative slope, typically
The derivative is:
With , the negative slope sends a gradient of 0.01 back through a dead neuron on every backward pass. The neuron can now gradually revive as its weights receive small but nonzero updates. In practice, Leaky ReLU often trains slightly faster than ReLU and effectively eliminates permanently dead neurons. The tradeoff is a small loss of the sparsity property: neurons no longer output exactly zero for negative inputs, so the regularizing effect of sparsity is reduced.
The choice of is a heuristic. Values between 0.01 and 0.1 are commonly used. Larger values improve gradient flow more aggressively but at the cost of less sparsity and a less clean identity-like behavior on the positive side. Values above 0.3 start to resemble a linear function more than a rectifier.
PReLU
Parametric ReLU (PReLU) takes this further by making a learnable parameter:
where is now a learned parameter updated by gradient descent alongside the other network weights. Each neuron can have its own , or a single can be shared across all neurons in a layer.
The gradient with respect to for a neuron with negative input is:
where:
- : the loss function
- : the neuron's output
- : the pre-activation value (the input to the activation)
PReLU lets the network learn the optimal negative slope for each context. If the data does not benefit from negative activations, the learned will approach zero, recovering ReLU behavior. If negative activations help, the network will use them. PReLU was introduced in the context of deep residual networks and showed small but consistent improvements over fixed Leaky ReLU in image recognition tasks. The extra parameters introduced by per-neuron values are typically negligible compared to the weight matrices, so the parameter overhead is minimal.
Randomized Leaky ReLU
A related variant, Randomized Leaky ReLU (RReLU), samples uniformly from a fixed interval during training, then uses a fixed value (the interval's mean) at test time. The stochastic negative slope acts as a regularizer. This provides some of the same benefit as dropout without zeroing entire neurons. RReLU has shown small gains in image recognition benchmarks and is a useful technique to know, though it is less commonly used than Leaky ReLU or PReLU in production architectures.
The following plots show how ReLU, Leaky ReLU, and ELU compare in both their function values and gradients:

