What are the GELU and SiLU (Swish) activation functions, what is the exact derivative of SiLU⁡(z)=z σ(z), and why do modern deep architectures often prefer them over ReLU?

Deep learning, Neurons and activations
Level L3 Intermediate. Length Short. Nature Th+Mat Both.

What's being asked

Whether you know how modern smooth self-gated activations work and can compute their gradient.

Key idea

GELU⁡(z)=z Φ(z) (where Φ is the standard normal cumulative distribution function) and SiLU⁡(z)=z σ(z) are smooth, non-monotonic gates that shrink negative inputs softly towards 0 instead of zeroing them sharply. Using the product rule, SiLU⁡′(z)=σ(z)+z σ(z)(1−σ(z))=SiLU⁡(z)+σ(z)(1−SiLU⁡(z)).

Steps

  1. Define both: GELU⁡(z)=z Φ(z) weights an input by the probability a standard normal variable falls below z; SiLU⁡(z)=z σ(z) replaces Φ with the logistic sigmoid σ.
  2. Differentiate SiLU by the product rule: SiLU⁡′(z)=σ(z)+z σ′(z)=σ(z)(1+z(1−σ(z)))=SiLU⁡(z)+σ(z)(1−SiLU⁡(z)).
  3. Compare behaviour with ReLU: both are C∞ smooth everywhere (no kink at z=0), approach z as z→+∞, and dip slightly negative around z≈−1 before decaying to 0 as z→−∞.
  4. Why they help: the non-zero gradient for moderately negative z prevents dead neurons, and smooth curvature makes loss landscapes easier to optimise in Transformers and deep vision backbones.

Common mistakes

How long your answer should be

4–6 lines with definitions, derivative and two advantages.

Last checked on 4 December 2026.

Read this

Previous in Deep learning: For p=softmax⁡(z)∈RK, how do you derive the full Jacobian matrix J=∂p∂z for both diagonal (i=j) and off-diagonal (i≠j) entries, and why does shifting every logit by a constant c leave p unchanged?
Next in Deep learning: Using the update convention vt=βvt−1+∇f(⋅) and θt=θt−1−ηvt, how does Nesterov accelerated gradient (NAG) differ from classical momentum, and for f(θ)=12θ2 with θ0=1, v0=4, β=0.5 and η=0.5, what is θ1 under each method?