Leaky Rectified Linear Unit

An activation function that keeps a small negative slope instead of turning every negative value into zero.

The leaky rectified linear unit (LeakyReLU) keeps a small negative slope instead of zeroing every negative value, so weak negative evidence and gradients can still pass through.

At a glance

Released

January 2013

Authors

Andrew L. Maas, Awni Y. Hannun, Andrew Y. Ng

Optimizes

  • Gradient Flow

What It Is

The leaky rectified linear unit (LeakyReLU) is a small variation on the rectified linear unit. Positive values pass through as usual, but negative values are multiplied by a small constant such as 0.01 instead of becoming zero. In feed-forward layers, that means the model can keep a weak negative signal instead of shutting it off completely.

Why It Exists

LeakyReLU optimizes for better negative-side gradient flow while staying very close to ReLU. It keeps the same cheap piecewise-linear shape, but it avoids a fully dead negative branch.

How It Works

LeakyReLU works one value at a time. Positive values keep their size. Negative values stay negative, but they are scaled down by a small factor. In a transformer feed-forward layer, the model expands into a wider hidden state, applies that rule to each hidden value, and then projects the result back down.

Math Or Compute Schema

The formula below shows the same split as ReLU, but the negative branch no longer vanishes. Instead, it keeps a small slope alpha.
Leaky rectified linear unit activation
LeakyReLU(x)=max⁡(αx,x)\mathrm{LeakyReLU}(x) = \max(\alpha x, x)
xx
One input value before the activation rule is applied.
α\alpha
Small negative-side slope, often around 0.01.

Compared To Nearby Modules

LeakyReLU sits between ReLU and SiLU. It is less abrupt than ReLU because the negative side survives, but it still keeps a piecewise-linear corner instead of moving to the fully smooth SiLU curve.
Comparison dimensionLeakyReLUReLUSiLU
Negative branchKeep a small slope alpha x for x < 0Clamp every negative hidden value to 0Shrink negative values smoothly with x sigma(x)
Transition shapeHard corner with a weak negative pathHard corner at 0Smooth curve through 0
Main tradeoffImproves negative-side gradient flow, but remains less smooth than SiLUSimplest rule, but fully drops negative signalSmoother hidden filtering, but less minimal than a piecewise-linear rule

Example Architectures

LeakyReLU appears more often in older convolutional or experimental dense networks than in current frontier language models, but it remains a common comparison point when authors discuss negative-side gradient flow.

Limitations And Tradeoffs

LeakyReLU preserves more negative information than ReLU, but the negative side is still fixed and weak. It does not provide the smoother filtering that many modern feed-forward designs get from SiLU-based activations.

Why It Still Matters

LeakyReLU helps readers separate two questions: whether a layer is dense or gated, and whether its activation fully shuts off negative features. That distinction comes up often in model and paper comparisons.

Tags

References

  1. Maas, Andrew L., Awni Y. Hannun, and Andrew Y. Ng. "Rectifier Nonlinearities Improve Neural Network Acoustic Models." ICML Workshop on Deep Learning for Audio, Speech, and Language Processing, 2013, https://ai.stanford.edu/~amaas/papers/relu_hybrid_icml2013_final.pdf.