passdrill
AI & LLM Engineering · How LLMs Work: Transformers & Training · Card 017/024 easy

GPT-2 and GPT-3's position-wise feed-forward sublayers use the Gaussian Error Linear Unit (GELU), defined by Hendrycks and Gimpel (2016), instead of the plain ReLU activation used in some earlier architectures. What distinguishes GELU from ReLU?

  1. GELU weights an input by the value of the standard Gaussian cumulative distribution function evaluated at that input, producing a smooth curve that can pass through small negative values rather than clamping every negative input to exactly zero
  2. GELU is identical to ReLU for all positive inputs and outputs a small fixed negative constant for every negative input, similar to Leaky ReLU
  3. GELU replaces the two linear transformations in the feed-forward sublayer with a single linear transformation, removing the nonlinearity between them entirely
  4. GELU is an activation function that operates only on the attention scores after the softmax, rather than within the position-wise feed-forward sublayer
Next card → Shuffle