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 View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 9 code samples: 8 from 4 repositories linked to this paper, 1 identical to code harvested from another paper's repository. Across all 9: 9 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 3 honoured, 4 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified. Where Syntology's instrument failed: 2 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 8 samples from 4 repositories, 8 ran (6 with no instrument failure; 2 where Syntology's instrument failed); 1 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.

No sample is linked to this paper from 19 of its repositories that Syntology harvested for other papers:

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 2 of the 9 samples that ran have no recorded date.

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

BlinkDL/RWKV-LM mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to RWKV: Reinventing RNNs for the Transformer Era (arXiv:2305.13048; that paper's own run record: 6 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 1 honoured, 0 violated, 3 with no contract checked; 2 where Syntology's instrument failed) · 5 unverified); nothing checks that they implement this paper's method. report
JunnYu/x-transformers-paddle mentioned on GitHubjaxApache-2.0Syntology: 1 sample, 1 ran (0 instrument-failed) · 0 unverified report
Rishit-dagli/GLU mentioned on GitHubtfApache-2.0Syntology: not harvested report
answerdotai/modernbert mentioned on GitHubpytorchApache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation (arXiv:2108.12409; that paper's own run record: 16 ran (of which 6 constructed an object rather than computing a result; 13 with no instrument failure: 4 honoured, 0 violated, 9 with no contract checked; 3 where Syntology's instrument failed) · 0 unverified), Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory... (arXiv:2412.13663; that paper's own run record: 0 ran · 1 unverified) and One Script Instead of Hundreds? On Pretraining Romanized Encoder Language Models (arXiv:2601.05776; that paper's own run record: 12 ran (of which 0 constructed an object rather than computing a result; 6 with no instrument failure: 1 honoured, 0 violated, 5 with no contract checked; 6 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
conceptofmind/LaMDA-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified) and LaMDA: Language Models for Dialog Applications (arXiv:2201.08239; that paper's own run record: 5 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 1 honoured, 2 violated, 1 with no contract checked; 1 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
conceptofmind/lamda-rlhf-pytorch mentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to LaMDA: Language Models for Dialog Applications (arXiv:2201.08239; that paper's own run record: 5 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 1 honoured, 2 violated, 1 with no contract checked; 1 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
junnyu/rwkv-v2-rnn-paddle mentioned on GitHubpaddleBSD-2-ClauseSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to An Attention Free Transformer (arXiv:2105.14103; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
lucidrains/audiolm-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to SoundStream: An End-to-End Neural Audio Codec (arXiv:2107.03312; that paper's own run record: 4 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 3 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
lucidrains/compressive-transformer-pytorch mentioned on GitHubpytorchSyntology: 3 samples, 3 ran (1 instrument-failed) · 0 unverified report
lucidrains/iTransformer mentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to iTransformer: Inverted Transformers Are Effective for Time Series Forecasting (arXiv:2310.06625; that paper's own run record: 8 ran (of which 0 constructed an object rather than computing a result; 6 with no instrument failure: 2 honoured, 4 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
lucidrains/linear-attention-transformer mentioned on GitHubpytorchSyntology: 2 samples, 2 ran (1 instrument-failed) · 0 unverified report
lucidrains/naturalspeech2-pytorch mentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to NaturalSpeech 2: Latent Diffusion Models are Natural and Zero-Shot Speech and Singing... (arXiv:2304.09116; that paper's own run record: 11 ran (of which 0 constructed an object rather than computing a result; 10 with no instrument failure: 0 honoured, 5 violated, 5 with no contract checked; 1 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
lucidrains/nuwa-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to NÜWA: Visual Synthesis Pre-training for Neural visUal World creAtion (arXiv:2111.12417; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 3 violated, 0 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
lucidrains/performer-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Rethinking Attention with Performers (arXiv:2009.14794; that paper's own run record: 11 ran (of which 3 constructed an object rather than computing a result; 7 with no instrument failure: 1 honoured, 0 violated, 6 with no contract checked; 4 where Syntology's instrument failed) · 5 unverified); nothing checks that they implement this paper's method. report
lucidrains/phenaki-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to MaskGIT: Masked Generative Image Transformer (arXiv:2202.04200; that paper's own run record: 14 ran (of which 9 constructed an object rather than computing a result; 10 with no instrument failure: 0 honoured, 0 violated, 10 with no contract checked; 4 where Syntology's instrument failed) · 7 unverified), Improved Masked Image Generation with Token-Critic (arXiv:2209.04439; that paper's own run record: 6 ran (of which 2 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 0 violated, 3 with no contract checked; 3 where Syntology's instrument failed) · 4 unverified) and Phenaki: Variable Length Video Generation From Open Domain Textual Description (arXiv:2210.02399; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 1 honoured, 2 violated, 0 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
lucidrains/progen mentioned on GitHubjaxSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to ProGen: Language Modeling for Protein Generation (arXiv:2004.03497; that paper's own run record: 12 ran (of which 0 constructed an object rather than computing a result; 11 with no instrument failure: 3 honoured, 1 violated, 7 with no contract checked; 1 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
lucidrains/progen-jax mentioned on GitHubjaxMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to ProGen: Language Modeling for Protein Generation (arXiv:2004.03497; that paper's own run record: 12 ran (of which 0 constructed an object rather than computing a result; 11 with no instrument failure: 3 honoured, 1 violated, 7 with no contract checked; 1 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
lucidrains/reformer-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to RoFormer: Enhanced Transformer with Rotary Position Embedding (arXiv:2104.09864; that paper's own run record: 14 ran (of which 5 constructed an object rather than computing a result; 8 with no instrument failure: 1 honoured, 0 violated, 7 with no contract checked; 6 where Syntology's instrument failed) · 2 unverified) and Decentralized Attention Fails Centralized Signals: Rethinking Transformers for Medical... (arXiv:2602.18473; that paper's own run record: 12 ran (of which 6 constructed an object rather than computing a result; 8 with no instrument failure: 1 honoured, 0 violated, 7 with no contract checked; 4 where Syntology's instrument failed) · 4 unverified); nothing checks that they implement this paper's method. report
lucidrains/routing-transformer mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Efficient Content-Based Sparse Attention with Routing Transformers (arXiv:2003.05997; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 1 honoured, 2 violated, 0 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
lucidrains/sinkhorn-transformer mentioned on GitHubpytorchSyntology: 2 samples, 2 ran (0 instrument-failed) · 0 unverified report
lucidrains/soft-moe-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to From Sparse to Soft Mixtures of Experts (arXiv:2308.00951; that paper's own run record: 29 ran (of which 5 constructed an object rather than computing a result; 18 with no instrument failure: 3 honoured, 4 violated, 11 with no contract checked; 11 where Syntology's instrument failed) · 4 unverified); nothing checks that they implement this paper's method. report
nlpodyssey/rwkv mentioned on GitHubBSD-2-ClauseSyntology: not harvested report
rwkv/rwkv-lm mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to RWKV-7 "Goose" with Expressive Dynamic State Evolution (arXiv:2503.14456; that paper's own run record: 2 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 1 unverified); nothing checks that they implement this paper's method. report
varungumma/fairseq mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to RoFormer: Enhanced Transformer with Rotary Position Embedding (arXiv:2104.09864; that paper's own run record: 14 ran (of which 5 constructed an object rather than computing a result; 8 with no instrument failure: 1 honoured, 0 violated, 7 with no contract checked; 6 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
zarak0/rwkvalgorithm mentioned on GitHubBSD-2-ClauseSyntology: not harvested report
code-implementation1/Code4 mindsporeSyntology: not harvested report
labmlai/annotated_deep_learning_paper_implementations pytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Playing Atari with Deep Reinforcement Learning (arXiv:1312.5602; that paper's own run record: 64 ran (of which 24 constructed an object rather than computing a result; 46 with no instrument failure: 5 honoured, 0 violated, 41 with no contract checked; 18 where Syntology's instrument failed) · 53 unverified), Adam: A Method for Stochastic Optimization (arXiv:1412.6980; that paper's own run record: 27 ran (of which 7 constructed an object rather than computing a result; 23 with no instrument failure: 4 honoured, 2 violated, 17 with no contract checked; 4 where Syntology's instrument failed) · 10 unverified), Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift (arXiv:1502.03167; that paper's own run record: 19 ran (of which 5 constructed an object rather than computing a result; 14 with no instrument failure: 0 honoured, 0 violated, 14 with no contract checked; 5 where Syntology's instrument failed) · 2 unverified) and 12 more (every one in this page's JSON twin); nothing checks that they implement this paper's method. 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

9 samples harvested: 9 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 3 honoured, 4 violated, 0 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is 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 4 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. 6 samples whose link to this paper records no repository are listed under one of this paper's own repositories, because identical code was harvested from it for another paper. 1 sample is listed last, in a group without a repository. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

JunnYu/x-transformers-paddle community (archive-listed) 1 sample, 1 ran (0 instrument-failed) · 0 unverified
exists in 528 papers
census: 5 implementations from 103 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 1, kind int, dtype int64
pd_x_transformers/autoregressive_wrapper.py identical code Syntology harvested from this repository for another paper; this paper's link records no repository, path or licence of its own ran · violated contract licence of this copy not recorded · aa5486a3650902d8 · report fixture: signature val:Tensor/1/int · returned bool · level recorded, date not recorded
lucidrains/compressive-transformer-pytorch community (archive-listed) 3 samples, 3 ran (1 instrument-failed) · 0 unverified
cast_tuple in 58 papers compressive_transformer_pytorch/compressive_transformer_pytorch.py identical code Syntology harvested from this repository for another paper; this paper's link records no repository, path or licence of its own ran · violated contract fingerprinted licence of this copy not recorded · 369eced62e96d690 · report fixture: signature el:int/0/int · returned tuple · level recorded 2026-09-22
default in 430 papers compressive_transformer_pytorch/compressive_transformer_pytorch.py identical code Syntology harvested from this repository for another paper; this paper's link records no repository, path or licence of its own ran · violated contract licence of this copy not recorded · a1bda7590dd9a4d2 · report fixture: signature x:NoneType/0/?, val:callable/0/? · returned str · level recorded 2026-09-22
to in 15 papers compressive_transformer_pytorch/compressive_transformer_pytorch.py identical code Syntology harvested from this repository for another paper; this paper's link records no repository, path or licence of its own ran · our draft was wrong fingerprinted licence of this copy not recorded · 7417c98099ec4e15 · report fixture: signature t:Tensor/2/float · returned dict · level recorded 2026-09-22
lucidrains/linear-attention-transformer community (archive-listed) 2 samples, 2 ran (1 instrument-failed) · 0 unverified
always in 65 papers linear_attention_transformer/linear_attention_transformer.py identical code Syntology harvested from this repository for another paper; this paper's link records no repository, path or licence of its own ran · our draft was wrong licence of this copy not recorded · dd3db53ae7ad1c85 · report fixture: signature value:int/0/int · returned function · level recorded 2026-09-22
default in 430 papers linear_attention_transformer/linear_attention_transformer.py identical code Syntology harvested from this repository for another paper; this paper's link records no repository, path or licence of its own ran · violated contract licence of this copy not recorded · b5307f70349f5c27 · report fixture: signature value:NoneType/0/?, d:str/0/str · returned str · level recorded 2026-09-22
lucidrains/sinkhorn-transformer community (archive-listed) 2 samples, 2 ran (0 instrument-failed) · 0 unverified
cast_tuple in 58 papers sinkhorn_transformer/sinkhorn_transformer.py ran · honoured contract fingerprinted MIT (permissive) · e0b73c0c3c680d31 · report fixture: signature x:int/0/int · returned tuple · level recorded 2026-09-22
default in 430 papers sinkhorn_transformer/sinkhorn_transformer.py ran · honoured contract MIT (permissive) · ebbe83e33bdee406 · report fixture: signature x:NoneType/0/?, d:int/0/int · returned int · level recorded 2026-09-22
Repository not located 1 sample, 1 ran (0 instrument-failed) · 0 unverified
1 sample is identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
identity in 174 papers
census: 11 implementations from 39 papers, 3 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 1 of 2, arg 1: rank 2, kind float, dtype float32
repository not located ran · honoured contract licence of this copy not recorded · caeb28d34b34bc2a · report fixture: signature x:Tensor/2/float, args:tuple/1/Tensor, kwargs:dict/0/? · returned Tensor · level recorded, date not recorded

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