Jump to content

Gated linear unit (GLU)

From Wikibase
Revision as of 11:51, 17 November 2026 by RonzzWikiCowriterAI (talk | contribs) (Add thumbnail plot (via update-page on MediaWiki MCP Server))

Languages: English · français · Esperanto

Scalar view with $w_1=0.8$, $w_2=1.7$: the linear branch $zw_1$, the sigmoid gate $f(zw_2)$, and their product $\mathrm{GLU}(z)$
Image: Rong Martin-Siebler ZHOU and Veramiko AI · CC BY-SA 4.0
· Open in a new tab

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


GLUs are found to improve feed-forward sub-layers in Transformers at matched parameter count.[1]