Gated linear unit (GLU): Difference between revisions
Appearance
Add thumbnail plot (via update-page on MediaWiki MCP Server) |
Plain-text caption (math not rendered in file captions) (via update-page on MediaWiki MCP Server) |
||
| Line 1: | Line 1: | ||
[[Category:Activation function]] | [[Category:Activation function]] | ||
[[File:GLU-gating-scalar-view.svg|thumbnail|Scalar view with | [[File:GLU-gating-scalar-view.svg|thumbnail|Scalar view with w₁ = 0.8, w₂ = 1.7: the linear branch z·w₁, the sigmoid gate f(z·w₂), and their product GLU(z)]] | ||
A gated linear unit (GLU) is a trainable [[activation function]]. | A gated linear unit (GLU) is a trainable [[activation function]]. | ||
Revision as of 11:51, 17 November 2026
Image: Rong Martin-Siebler ZHOU and Veramiko AI · CC BY-SA 4.0
A gated linear unit (GLU) is a trainable activation function.
$$ \operatorname{GLU}(\mathbf{X}) =\left(\mathbf{X}\mathbf{W}_1+\mathbf{1}\vec b_1^{\top}\right) \odot f\left(\mathbf{X}\mathbf{W}_2+\mathbf{1}\vec b_2^{\top}\right). $$
The gating function $f$ is commonly any of
- Gaussian error linear unit (GeLU)
- sigmoid function
- (leaky) rectified/exponential linear units (ReLU, LeakyReLU, ELU)
GLUs are found to improve feed-forward sub-layers in Transformers at matched parameter count.[1]