Search

Search papers and lessons

Parametric ReLU (PReLU)

Level 4 · 9 min read

Parametric ReLU is a ReLU whose negative-side slope is a learned parameter, so the network chooses how much negative signal to keep.

On this page

  • Colour = topic mix
  • Calculus
  • Neural network basics
  • Probability
  • Linear algebra
  • Losses & regularization
  • Optimizers
  • Sign in to see your progress

TL;DR

Parametric ReLU, or PReLU, is a ReLU whose slope on the negative side is not fixed at zero. That slope is a parameter the network learns by gradient descent along with its weights. Positive inputs pass through unchanged, and negative inputs are scaled by a learned number aa, so a unit that would otherwise go silent can keep a small, trainable signal.

Where you'll see it: in image classification networks from the mid-2010s onward, where it was the activation that set a new ImageNet result in the paper that introduced it, and in many later architectures as one of the standard choices for the negative side of a ReLU.

Intuition

A ReLU with a dimmer switch

Recall that a ReLU is a gate: a positive input passes through and a negative input is cut to zero. Once a unit's pre-activation sits below zero for every input, it sends nothing forward and its gradient is zero, so it cannot recover. This is the dying ReLU problem.

A leaky ReLU fixes this by letting a small fraction of the negative input through, so the gradient is never exactly zero. PReLU goes one step further. Instead of choosing that fraction by hand, it treats the fraction as a knob the network tunes. If the data says the negative side should carry more signal, the knob turns up. If the negative side is best ignored, it turns toward zero, which is an ordinary ReLU.

Why does this help? A unit with a learned negative slope is never fully switched off, so the gradient can always find a path back. The cost is one extra number per channel or per layer, which is negligible next to the weights.

−3−2−10123−10123zoutput
  • ReLU (a = 0)
  • PReLU with a = 0.25
Both share the same positive side. Only the slope on the negative side changes, and PReLU learns that slope from data.

The math

Definition

Definition: Parametric ReLU

For a pre-activation yy and a slope aa,

f(y)={yif y>0,a yif y≤0.f(y) = \begin{cases} y & \text{if } y \gt 0, \\ a\,y & \text{if } y \le 0. \end{cases}

Here aa is a learned parameter. It can be shared by all units in a layer, or there can be one aia_i per channel of a convolutional layer.

Written compactly, f(y)=max⁡(0,y)+amin⁡(0,y)f(y) = \max(0, y) + a \min(0, y). When a=0a = 0 this is ReLU, and when aa is a small fixed number such as 0.01 it is a leaky ReLU.

The gradient with respect to the input

The derivative with respect to the input is

∂f∂y={1if y>0,aif y≤0.\frac{\partial f}{\partial y} = \begin{cases} 1 & \text{if } y \gt 0, \\ a & \text{if } y \le 0. \end{cases}

Backpropagation uses this in the same way as for ReLU, but the blocked region now passes a scaled signal instead of nothing. This is the chain rule applied to a piecewise function.

The gradient with respect to the slope

The slope is trained, so we need its gradient. The output depends on aa only on the negative side:

∂f∂a={0if y>0,yif y≤0.\frac{\partial f}{\partial a} = \begin{cases} 0 & \text{if } y \gt 0, \\ y & \text{if } y \le 0. \end{cases}

For a layer where aa is shared across many positions, the loss gradient is the sum of this term over every position where it applies. Given an upstream gradient g=∂L/∂fg = \partial \mathcal{L} / \partial f, the update for aa is

∂L∂a=∑positionsg⋅∂f∂a.\frac{\partial \mathcal{L}}{\partial a} = \sum_{\text{positions}} g \cdot \frac{\partial f}{\partial a}.

The sum is over the units that are active on the negative side, and each contributes gg times its own pre-activation yy.

Training step

For each batch, the forward pass computes f(y)f(y) and the backward pass computes both ∂L/∂y\partial \mathcal{L}/\partial y and ∂L/∂a\partial \mathcal{L}/\partial a. Then the parameters move by stochastic gradient descent as usual:

a←a−η∂L∂a.a \leftarrow a - \eta \frac{\partial \mathcal{L}}{\partial a}.

The learning rate η\eta is the same one used for the weights in the simplest version. The original paper initialises aa to 0.25.

Worked examples

Example
One unit, one step

Take a single PReLU unit with a=0.25a = 0.25. Its pre-activation for one input is y=−2y = -2, so its output is f(−2)=0.25×(−2)=−0.5f(-2) = 0.25 \times (-2) = -0.5.

Suppose the loss gradient at the output is g=1.5g = 1.5. Then:

  1. The input gradient is ∂f/∂y=a=0.25\partial f / \partial y = a = 0.25, so the gradient sent back to the pre-activation is 1.5×0.25=0.3751.5 \times 0.25 = 0.375.
  2. The slope gradient is ∂f/∂a=y=−2\partial f / \partial a = y = -2, so the contribution to ∂L/∂a\partial \mathcal{L}/\partial a is 1.5×(−2)=−31.5 \times (-2) = -3.
  3. With learning rate η=0.01\eta = 0.01, the update is a←0.25−0.01×(−3)=0.25+0.03=0.28a \leftarrow 0.25 - 0.01 \times (-3) = 0.25 + 0.03 = 0.28.

Interpretation: the gradient for aa is negative, so the update increases aa. With yy negative, a larger aa makes the output more negative. The upstream gradient g=1.5g = 1.5 says that a larger output raises the loss, so pushing the output down lowers it.

Example
Shared versus per-channel slopes

Consider a convolutional layer with 64 output channels, each producing a feature map with 56 by 56 positions. A shared slope has one parameter, aa, for all 64×56×56=200,70464 \times 56 \times 56 = 200{,}704 activations. A per-channel slope has 64 parameters, one for each channel.

For a shared slope, the gradient sums contributions from all 200,704 activations, so it can be large. Per-channel slopes give each channel its own dimmer and sum over only that channel's 56×56=3,13656 \times 56 = 3{,}136 positions. The per-channel version has more freedom and costs only 64 extra numbers. In the paper's 14-layer ImageNet experiment the two variants performed comparably (32.64% versus 32.71% top-1 error, channel-wise slightly better), so the channel-shared version, with only one extra parameter per layer, is a perfectly reasonable cheap choice.

Example
A dead unit whose slope can still move

Suppose a unit has a=0a = 0 and all its pre-activations are negative. Then f(y)=0f(y) = 0 for every input and ∂f/∂a=y\partial f/\partial a = y is not zero, so the slope receives a gradient and can move away from 0. A plain ReLU has no such escape: its gradient on the negative side is zero, and nothing ever changes. This is the main reason the learned slope helps with dead units.

Tradeoffs and failure modes

SituationProblemBetter choice
Deep network with many units going silentDead units with zero gradientPReLU, or leaky ReLU with a fixed small slope
Small dataset with a large modelThe extra slope parameters can overfit, though they are fewShared slope, or a fixed leaky slope
Transformer feedforward blocksSmooth activations such as GELU work better in practiceGELU or SiLU
Slope drifts to a bad valueA large aa makes the negative side look almost linear and can hurtClip aa to a range, or regularise it toward a small value
Need a bounded or smooth outputPReLU is piecewise linear with a corner at zeroSmooth activations

Two practical notes. First, the slope is usually excluded from weight decay, because decaying it pulls the unit back toward a plain ReLU without any data telling it to. Second, the corner at zero is still there, so PReLU shares the same nonsmoothness that ReLU has at zero.

History

Rectified units were studied in neuroscience and early neural networks, but they became widely used in deep learning after about 2010, when networks trained with ReLUs were found to be easier to optimise than networks with sigmoid or tanh units.

Leaky ReLUs with a fixed small slope were proposed as a fix for dead units. In 2015 Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun introduced PReLU in the paper Delving Deep into Rectifiers. In the same paper they proposed a matching initialisation for layers with ReLU-type activations, now called He initialisation. Replacing ReLU with PReLU in a 14-layer model lowered top-1 error on ImageNet by about 1.2 points, at the cost of a handful of extra parameters. Their multi-model ensemble of PReLU networks reached 4.94% top-5 test error, below the 5.1% estimated for a trained human annotator and better than the 6.66% of the ILSVRC 2014 winner, GoogLeNet.

The learned slopes were informative. In the first convolutional layer they were large (about 0.6 to 0.7), meaning negative filter responses were largely kept, while deeper layers tended to learn smaller slopes, so activations became more strongly rectified with depth. The paper also reports that learned slopes rarely exceeded 1 in magnitude.

Later architectures mostly moved to smooth alternatives such as GELU in transformers, but ReLU and its variants remain the baseline that new activations are compared against.

Check yourself

QuestionA PReLU unit has a=0.1a = 0.1. What is its output for y=−5y = -5, and what is the gradient ∂f/∂y\partial f / \partial y at that point?Show answer

The output is 0.1×(−5)=−0.50.1 \times (-5) = -0.5. Since y≤0y \le 0, the derivative with respect to yy is a=0.1a = 0.1. A plain ReLU would output 0 and have derivative 0 at the same point.

QuestionCompute ∂f/∂a\partial f / \partial a for the input y=3y = 3 and for the input y=−3y = -3.Show answer

For y=3y = 3 the input is on the positive side, so f(y)=yf(y) = y does not depend on aa, and the derivative is 0. For y=−3y = -3 the output is a×(−3)a \times (-3), so the derivative with respect to aa is −3-3.

QuestionWhy does a learned negative slope help a unit that has been silent for every input in a batch?Show answer

A silent unit with a plain ReLU has zero gradient on the negative side, so nothing changes its weights or bias. With PReLU the output on the negative side is aya y, and its gradient with respect to aa is yy, which is nonzero whenever yy is nonzero. So the slope itself gets an update, and once aa is nonzero the input gradient aa is nonzero too, which gives the unit a route back to learning.

QuestionYou train a 40-layer convolutional network with PReLU and find that the learned slopes in the last layers drift toward values above 1. What might be happening, and what would you check?Show answer

A slope above 1 makes the negative side steeper than the positive side, so the function is no longer a simple rectifier and can amplify negative signals through depth. This can make training unstable. You would check the magnitude of the slopes over time, the activation scale in each layer, and whether initialisation or normalisation is poor. Clipping aa or switching to a fixed leaky slope are reasonable fixes.

Sources