Papers › Mega: Moving Average Equipped Gated Attention
Mega: Moving Average Equipped Gated Attention
Xuezhe Ma, Chunting Zhou, Xiang Kong, Junxian He, Liangke Gui, Graham Neubig, Jonathan May, Luke Zettlemoyer
The design choices in the Transformer attention mechanism, including weak inductive bias and quadratic computational complexity, have limited its application for modeling long sequences. In this paper, we introduce Mega, a simple, theoretically grounded, single-head gated attention mechanism equipped with (exponential) moving average to incorporate inductive bias of position-aware local dependencies into the position-agnostic attention mechanism. We further propose a variant of Mega that offers linear time and space complexity yet yields only minimal quality loss, by efficiently splitting the whole sequence into multiple chunks with fixed length. Extensive experiments on a wide range of sequence modeling benchmarks, including the Long Range Arena, neural machine translation, auto-regressive language modeling, and image and speech classification, show that Mega achieves significant improvements over other sequence models, including variants of Transformers and recent state space models.
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="2209.10655")
Code
Syntology Ran 12 of 13 code samples harvested from 3 repositories linked to this paper; 1 has no recorded run. Of those that ran: 2 ran · our draft was wrong; 2 ran · fixture could not drive it; 8 ran with no contract checked.
By repository: official repository: 3 samples from 1 repository, 3 ran; community (archive-listed): 10 samples from 2 repositories, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.
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
13 samples harvested; 12 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.
Licence: 8 of the 13 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 3 repositories linked to this paper, official or community; each sample names its own and says which. “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.
96cbb5e9ca5b6be0 · report
8cd8cb0d1e9e63e4 · report
82bdf940665aeeb4 · report
7cf1fc5a8fb4711f · report
e0fb8682bea0936e · report
28048afa2b58e989 · report
d65478e4afde1394 · report
fd172a441158b8cf · report
bf0381787b2cfd85 · report
75a6e13f59e67f7e · report
af830e39fdd08afa · report
c3e96d57908b9ca9 · report
cfbd8ca4d8912d27 · report
Tasks
1 archive task tag without a task page not shown.
Results from the paper archive 2025-07-28
| Task | Dataset | Model | Metric | Value | Rank at snapshot | Leaderboard | Report |
|---|---|---|---|---|---|---|---|
| Image Classification | ImageNet | Mega | Number of params | 90M | #543 of 1060 | Archive leaderboard | report |
| Image Classification | ImageNet | Mega | Top 1 Accuracy | 82.4% | #543 of 1060 | Archive leaderboard | report |
| Language Modelling | WikiText-103 | Mega | Number of params | 252M | #30 of 89 | Archive leaderboard | report |
| Language Modelling | WikiText-103 | Mega | Test perplexity | 18.07 | #30 of 89 | Archive leaderboard | report |
| Machine Translation | WMT2014 English-German | Mega | BLEU score | 29.01 | #33 of 91 | Archive leaderboard | report |
| Machine Translation | WMT2014 English-German | Mega | Number of Params | 67M | #33 of 91 | Archive leaderboard | report |
| Machine Translation | WMT2014 English-German | Mega | SacreBLEU | 27.96 | #33 of 91 | Archive leaderboard | report |
| Machine Translation | WMT2014 German-English | Mega | BLEU score | 33.12 | #4 of 16 | Archive leaderboard | report |
Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.
Methods
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