Weighting each neuron input by its percentile under a standard normal distribution, x * Phi(x), consistently beat both ReLU and ELU across vision, speech, and language benchmarks in Dan Hendrycks and Kevin Gimpel’s experiments. Rather than snapping negative values to zero at x = 0 like ReLU, the Gaussian Error Linear Unit (GELU) forms a smooth, non-monotonic curve that went on to become the default activation in Transformers such as BERT and GPT.
At x = 0, GELU scales the input by 0.5; at x = 1, it passes 0.84; at x = -1, it returns -0.16 instead of dropping the signal completely.
- 20.74% CIFAR-100 error: On a 40-4 WideResNet over 50 epochs (median of 3 runs), GELU beat ReLU (21.77% with matching BatchNorm placement, 22.89% original) and ELU (22.98%).
- 7.89% CIFAR-10 error without augmentation: On a 9-layer CNN trained for 200 epochs (median of 3 runs), GELU beat ReLU (8.16%) and ELU (8.41%).
- Consistent NLP and speech edges: Across 5 seeds, GELU lowered test error on Twitter part-of-speech tagging (12.57% vs. 12.67% ReLU and 12.91% ELU) and TIMIT phone recognition (29.3% vs. 29.5% ReLU and 29.6% ELU).
- Zero new hyperparameters: Fixing the Gaussian gate at
mu = 0, sigma = 1avoids learnable per-channel parameters while remaining compatible with standard dropout and Adam.
How GELU gates inputs probabilistically
Hendrycks and Gimpel derive GELU by merging deterministic nonlinearities with stochastic regularizers. Dropout drops activations randomly regardless of value, while ReLU drops them deterministically whenever x is negative. Instead, imagine multiplying an input x by a random mask m drawn from Bernoulli(Phi(x)), where Phi(x) is the standard normal cumulative distribution function 0.5 * (1 + erf(x / sqrt(2))). Because normalized pre-activations tend to follow a roughly Gaussian distribution, smaller negative inputs are dropped with high probability while large positive inputs are kept.
Taking the deterministic expectation of that stochastic mask produces GELU(x) = x * Phi(x). Unlike ReLU and ELU, which are convex, monotonic, and strictly linear across the positive domain, GELU is non-convex, non-monotonic (dipping slightly negative near zero before flattening), and curved everywhere. As the variance parameter sigma shrinks toward zero with mu = 0, GELU smoothly recovers ReLU; swapping Phi(x) for the logistic sigmoid sigma(x) gives the paper’s companion Sigmoid Linear Unit (SiLU), x * sigma(x), which later appeared in literature under the name Swish.
Because erf can be costly on older hardware, the authors supply two fast approximations: 0.5 * x * (1 + tanh(sqrt(2 / pi) * (x + 0.044715 * x^3))), which they used for every experiment in the paper, and the simpler x * sigma(1.702 * x).
Key experimental findings
Beyond CIFAR-10, CIFAR-100, TIMIT, and Twitter POS tagging, the authors evaluated an 8-layer 128-wide MNIST classifier and a 7-layer MNIST autoencoder (1000-500-250-30-250-500-1000). On MNIST classification, GELU reached the lowest median training log loss both with dropout disabled and with a 0.5 dropout keep rate, showing that its probabilistic interpretation composes cleanly with explicit dropout. When adding uniform noise Unif[-a, a] up to strength a = 3 to MNIST test inputs, GELU classifiers held accuracy at or above ReLU and ELU.
In the self-supervised MNIST autoencoder, GELU beat ReLU and ELU by a wide margin at learning rates 1e-3 and 1e-4 (while at 0.01, ELU diverged and both GELU and ReLU converged poorly). In CIFAR-100 WideResNet runs, the authors placed BatchNorm after each activation pair to avoid ELU’s exploding gradient instability; even in that ELU-favorable layout, GELU improved error by more than a full point over ReLU.
Caveats and builder takeaway
The original 2016 experiments predated Transformers, testing MLPs, autoencoders, and convolutional networks rather than attention blocks; GELU’s dominance in language models came later via BERT and GPT. On small NLP and speech datasets, absolute accuracy gaps were modest (0.1 to 0.2 percentage points), and the authors note two practical constraints: train with momentum-based optimizers, and avoid substituting plain x * sigma(x) (SiLU), which underperformed GELU in their tests, though it beat ReLU and ELU.
In modern serving and training stacks, elementwise erf or tanh evaluations cost more memory bandwidth than max(0, x) unless fused into the linear projection kernel. For large Transformer feed-forward blocks today, benchmark standard GELU against gated variants such as SwiGLU and RMSNorm on end-to-end tokens per second before locking in an activation function.


