Gated linear unit (GLU): Difference between revisions
Appearance
Plain-text caption (math not rendered in file captions) (via update-page on MediaWiki MCP Server) |
Restore TeX in caption (client-side math) (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_1=0.8$, $w_2=1.7$: the linear branch $z\,w_1$, the sigmoid gate $f(z\,w_2)$, and their product $\mathrm{GLU}(z)$]] | ||
A gated linear unit (GLU) is a trainable [[activation function]]. | A gated linear unit (GLU) is a trainable [[activation function]]. | ||
Latest revision as of 11:52, 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]