Papers › GLU Variants Improve Transformer

GLU Variants Improve Transformer

12 Feb 2020arXiv:2002.05202archive 2025-07-28

Noam Shazeer

Gated Linear Units (arXiv:1612.08083) consist of the component-wise product of two linear projections, one of which is first passed through a sigmoid function. Variations on GLU are possible, using different nonlinear (or even linear) functions in place of sigmoid. We test these variants in the feed-forward sublayers of the Transformer (arXiv:1706.03762) sequence-to-sequence model, and find that some of them yield quality improvements over the typically-used ReLU or GELU activations.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2002.05202")

Code

Syntology Ran 9 of 9 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 3 ran · honoured contract; 4 ran · violated contract; 2 ran · our draft was wrong.

By repository: community (archive-listed): 2 samples from 1 repository, 2 ran; 7 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

27 repositories listed; official and paper-mentioned ones first.

BlinkDL/RWKV-LM mentioned on GitHubpytorch report
JunnYu/x-transformers-paddle mentioned on GitHubjaxApache-2.0 report
Rishit-dagli/GLU mentioned on GitHubtfApache-2.0 report
answerdotai/modernbert mentioned on GitHubpytorchApache-2.0 report
conceptofmind/LaMDA-pytorch mentioned on GitHubpytorch report
conceptofmind/lamda-rlhf-pytorch mentioned on GitHubpytorchMIT report
junnyu/rwkv-v2-rnn-paddle mentioned on GitHubpaddleBSD-2-Clause report
lucidrains/audiolm-pytorch mentioned on GitHubpytorch report
lucidrains/iTransformer mentioned on GitHubpytorchMIT report
lucidrains/linear-attention-transformer mentioned on GitHubpytorch report
lucidrains/naturalspeech2-pytorch mentioned on GitHubpytorchMIT report
lucidrains/nuwa-pytorch mentioned on GitHubpytorch report
lucidrains/performer-pytorch mentioned on GitHubpytorch report
lucidrains/phenaki-pytorch mentioned on GitHubpytorch report
lucidrains/progen mentioned on GitHubjax report
lucidrains/progen-jax mentioned on GitHubjaxMIT report
lucidrains/reformer-pytorch mentioned on GitHubpytorch report
lucidrains/routing-transformer mentioned on GitHubpytorch report
lucidrains/sinkhorn-transformer mentioned on GitHubpytorch report
lucidrains/soft-moe-pytorch mentioned on GitHubpytorch report
nlpodyssey/rwkv mentioned on GitHubBSD-2-Clause report
rwkv/rwkv-lm mentioned on GitHubpytorch report
varungumma/fairseq mentioned on GitHubpytorch report
zarak0/rwkvalgorithm mentioned on GitHubBSD-2-Clause report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 9 ran; 3 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
4ran · violated contract
2ran · our draft was wrong

Licence: 7 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from lucidrains/sinkhorn-transformer. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

cast_tuple lucidrains/sinkhorn-transformer/sinkhorn_transformer/sinkhorn_transformer.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · e0b73c0c3c680d31 · report
default lucidrains/sinkhorn-transformer/sinkhorn_transformer/sinkhorn_transformer.py community (archive-listed) ran · honoured contract MIT (permissive) · ebbe83e33bdee406 · report
always identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · dd3db53ae7ad1c85 · report
cast_tuple identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 369eced62e96d690 · report
default identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · a1bda7590dd9a4d2 · report
default identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · b5307f70349f5c27 · report
exists identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · aa5486a3650902d8 · report
identity identical code first harvested elsewhere ran · honoured contract licence of this copy not recorded · caeb28d34b34bc2a · report
to identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · 7417c98099ec4e15 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Introduced by this paper: ReGLU, SwiGLU

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutGated Linear UnitGeGLULabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerReGLUReLUResidual ConnectionSoftmaxSwiGLUTestTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections