What are the GELU and SiLU (Swish) activation functions, what is the exact derivative of , 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
(where is the standard normal cumulative distribution function) and are smooth, non-monotonic gates that shrink negative inputs softly towards instead of zeroing them sharply. Using the product rule, .
Steps
- Define both: weights an input by the probability a standard normal variable falls below ; replaces with the logistic sigmoid .
- Differentiate SiLU by the product rule: .
- Compare behaviour with ReLU: both are smooth everywhere (no kink at ), approach as , and dip slightly negative around before decaying to as .
- Why they help: the non-zero gradient for moderately negative prevents dead neurons, and smooth curvature makes loss landscapes easier to optimise in Transformers and deep vision backbones.
Common mistakes
- Forgetting the product rule and writing .
- Assuming GELU and SiLU are monotonically increasing; both have a shallow minimum near (GELU) and (SiLU).
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 , how do you derive the full Jacobian matrix for both diagonal () and off-diagonal () entries, and why does shifting every logit by a constant leave unchanged?
Next in Deep learning: Using the update convention and , how does Nesterov accelerated gradient (NAG) differ from classical momentum, and for with , , and , what is under each method?