Activation functions

Transformer components · component · 2010 · any domain

What it is

The nonlinearity between linear layers: ReLU, LeakyReLU, ELU, GELU, SiLU/Swish, Mish, and the gated GLU family.

When to use it

GELU in vision transformers, SwiGLU in modern LLMs (the feed-forward block's gating is where much capacity lives).

Caveats

No activation is best everywhere; the right choice depends on the architecture and its normalization. ReLU units can die (output zero permanently), sigmoid and tanh saturate and shrink gradients, and smoother functions cost a little more compute.

Key ideas

  • Supply the nonlinearity; without them stacked layers collapse into one linear map
  • ReLU is the cheap default; GELU and SiLU are smooth variants used in transformers
  • Gated forms such as SwiGLU are now standard in LLM feed-forward blocks

Related architectures

Original paper

Gaussian Error Linear Units (GELUs) (2016, arXiv)

Lessons that cover it

Browse all 198 architectures

The architecture landscape, in one place.

Two things get called “ML architecture”: the classical statistical model families, and the neural network wirings. Both are here, tagged by what they are and what data they eat.

Start from your problem

Architectures

0 shortlisted