3.1.5 · D5Neural Network Fundamentals
Question bank — ReLU and variants (Leaky ReLU, ELU, GELU)
Before you start, a few words we lean on constantly:
- Pre-activation — the raw number that goes into the activation function (the weighted sum before it is bent).
- Gradient of the activation — the slope of the activation curve at that ; this slope gets multiplied into the signal flowing backward during Backpropagation.
- Saturate — the curve flattens out to a constant, so its slope goes to and it stops responding to bigger inputs.
- (alpha) — a small positive constant, . For Leaky ReLU it is the slope of the negative region (typically ); for ELU it is the scale of the negative branch (typically ). It is a fixed hyperparameter, not something the network normally learns (except in PReLU).
- (Phi) — the standard normal cumulative distribution function: where is a standard Gaussian (mean , variance ). It slides smoothly from (at ) through (at ) to (at ).
Below, the shapes drawn so the traps are visual, not memorised. The top row is the activation ; the bottom row is its slope (gradient) .

Notice already: on the right half all four gradient curves ride at ; all the drama is on the left. Let that guide every answer.
True or false — justify
TRUE/FALSE: A network built only from ReLU layers (no linear layers between) can never be non-linear.
False — ReLU itself is non-linear (the kink at ), but you still need the linear layers around it; the point is the combination carves curves, not ReLU alone.
TRUE/FALSE: ReLU is a linear function.
False — it is piecewise linear. Each of its two pieces is a straight line, but the corner at makes the whole map non-linear, which is exactly what gives the network its power.
TRUE/FALSE: Because ReLU's positive-side gradient is exactly , ReLU completely eliminates the vanishing gradient problem.
False — it only reduces it. The gradient of helps in active regions, but the flat -gradient region reintroduces a different failure (dying ReLU), and exploding gradients from large weights are untouched.
TRUE/FALSE: Leaky ReLU can suffer from dead neurons just like ReLU.
False — its negative-side gradient is , so some signal always flows back and a stuck neuron can recover; the "death" trap needs a genuinely gradient.
TRUE/FALSE: ELU can output negative numbers, so it can push the mean activation toward zero.
True — for it gives , letting outputs sit on both sides of zero, which self-centres the mean and speeds training.
TRUE/FALSE: ELU's negative branch grows without bound as , so very negative inputs are dangerous.
False — saturates to as because ; it is bounded below, which is one of its noise-robustness selling points.
TRUE/FALSE: GELU is a hard gate that keeps or drops the input with a crisp threshold.
False — it is a smooth stochastic gate; the input is kept with probability , a value that slides smoothly from to , so the expected output has no crisp corner.
TRUE/FALSE: The formula for GELU is a genuinely different activation from .
False — the form is a numerical approximation of ; the curves agree to about , chosen because has no elementary closed form.
TRUE/FALSE: Making Leaky ReLU's slope larger always gives a better activation.
False — as the two pieces merge into , a pure line, and you lose all non-linearity; is kept small () on purpose.
TRUE/FALSE: All four functions (ReLU, Leaky, ELU, GELU) agree exactly for large positive .
True — for large each returns (ReLU and Leaky exactly, ELU exactly, GELU because ), so they only differ meaningfully near and below zero.
Spot the error
SPOT THE ERROR: "ReLU's derivative at is , so gradients flow fine there."
The derivative at exactly is undefined (a corner, not a slope); frameworks pick a convention like . More importantly, the danger is the whole region where the slope is genuinely .
SPOT THE ERROR: "A dead ReLU neuron will fix itself as soon as the input distribution shifts."
It cannot self-fix — with pre-activation stuck negative, its gradient is , so no weight update ever happens; nothing pushes it back into the active region. Only a change from elsewhere (or a different activation) rescues it.
SPOT THE ERROR: "ELU with has a sharp corner at just like ReLU."
No — at the negative branch's slope is , matching the positive branch's slope of , so the curve joins smoothly with no corner (this is a key ELU advantage).
SPOT THE ERROR: "GELU always outputs a non-negative number, since it's a smoothed ReLU."
False — for small negative , is small but positive and , so ; GELU dips slightly negative near the origin, unlike ReLU which floors at .
SPOT THE ERROR: "Leaky ReLU is smooth everywhere because it lets negatives through."
It still has a corner at where the slope jumps from to . "Leaky" fixes the dead-gradient problem, not the smoothness problem — that's what ELU and GELU address.
SPOT THE ERROR: "Because sigmoid saturates and ELU saturates, ELU has the same vanishing-gradient weakness."
The difference is where: sigmoid saturates on both ends (killing gradients for all large ), while ELU stays slope- for all , so its positive region never vanishes — see Sigmoid and Tanh Activations.
Why questions
WHY does replacing sigmoid with ReLU help deep networks train?
Sigmoid's derivative peaks at and shrinks, so many multiplied through depth shrink toward ; ReLU's active-region derivative is exactly , so the signal is not attenuated layer by layer.
WHY does the exponential specifically appear in ELU, rather than any other decaying function?
makes the negative branch saturate smoothly to and have slope that equals at when — giving both boundedness and a seamless join, which a plain linear leak cannot.
WHY is He initialization the natural partner for ReLU rather than Xavier?
ReLU zeroes half its inputs on average, halving the variance passed forward; He init scales weights to compensate for that lost variance, whereas Xavier assumes a symmetric activation — see Weight Initialization (He vs Xavier).
WHY is GELU the default in Transformers instead of plain ReLU?
Its smooth probabilistic gate gives a gentler, differentiable response near zero and a slight negative dip, which empirically trains large language models more stably than ReLU's hard corner.
WHY does a kink (non-differentiable point) not break gradient descent for ReLU?
Gradient descent only needs a subgradient — pick any slope between the two sides at the corner (frameworks use ); the corner is a single point of measure zero, so it rarely lands there exactly and training proceeds.
WHY does making a network deeper and using ReLU still rely on the Universal Approximation Theorem?
The theorem guarantees that enough ReLU kinks, combined by linear layers, can approximate any continuous function; ReLU's role is to supply those non-linear kinks so the guarantee applies.
Edge cases
EDGE CASE: What does each activation output at exactly ?
All four give : ReLU , Leaky , ELU , GELU . They all pass through the origin.
EDGE CASE: What is the gradient of each at (approaching zero from the negative side)?
ReLU , Leaky , ELU , GELU a smooth value near ; only ReLU has a vanishing slope right at the boundary.
EDGE CASE: As , what does each gradient approach?
All four : ReLU and Leaky are exactly on the positive branch, ELU is exactly for , and GELU's slope because and its extra term fades. This is why they all behave identically for large positive inputs.
EDGE CASE: As , what value does each activation approach?
ReLU , Leaky (slope forever), ELU (bounded), GELU . Leaky is the only one that grows unboundedly negative.
EDGE CASE: As , what does each gradient approach?
ReLU (dead), Leaky (constant, alive), ELU (via , alive but fading), GELU . Only Leaky keeps a fixed non-zero gradient at the far negative end.
EDGE CASE: If you set Leaky ReLU's , what have you built?
Exactly plain ReLU — the negative branch becomes , so Leaky ReLU is a strict generalization of ReLU with as the special case.
EDGE CASE: If you set ELU's , what happens to the negative branch?
It collapses to for all , recovering ReLU's behaviour but without the smooth slope match — so throws away exactly the property (boundedness, negative outputs) that ELU was introduced for.
Recall One-line summary of the traps
The recurring theme ::: the difference between the four activations lives entirely in the negative region and at the corner — positive is identical, so every trap is about what happens when the pre-activation is .
Connections
- Parent topic — ReLU and variants
- Vanishing and Exploding Gradients — the disease behind most of these traps.
- Backpropagation — why the gradient of each activation is what actually matters.
- Weight Initialization (He vs Xavier) — pairs with ReLU's half-zeroing behaviour.
- Sigmoid and Tanh Activations — the two-sided saturation contrast.
- Transformers and Attention — where GELU became standard.
- Universal Approximation Theorem — why piecewise-linear kinks suffice.