Command Palette
Search for a command to run...
Gaussian Error Linear Unit
Gaussian Error Linear Units (GELU) is an activation function that weights the input by "the probability that a value from the standard normal distribution is less than or equal to the input itself". After the input is weighted by this probability, it is output; the larger the positive value, the closer the probability is to one, and the larger the negative value, the closer it is to zero, so the curve is smooth and continuous. Its design motivation comes from stochastic regularization—if the input is randomly retained or dropped with a Bernoulli mask, the expectation of this random transformation is exactly equal to this weighted result, so GELU can be seen as a smoothed and probabilistic rewrite of ReLU: differentiable everywhere, and still retaining a small response in the negative region.
This function was proposed by Dan Hendrycks (UC Berkeley) and Kevin Gimpel (Toyota Technological Institute at Chicago, TTIC) in 2016. The paper Gaussian Error Linear Units (GELUs) was released as an arXiv preprint. Because the exact form requires computing the error function and is relatively expensive, some large models use a polynomial approximation based on hyperbolic tangent, with computational cost close to commonly used activation functions; however, the default implementation in mainstream frameworks is still the exact erf form. GELU has been widely adopted by BERT, the GPT series, and Vision Transformers, and is a commonly used default activation function in modern Transformer variants.
Build AI with AI
From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.