Papers › Augmenting Self-attention with Persistent Memory

Augmenting Self-attention with Persistent Memory

2 Jul 2019arXiv:1907.01470archive 2025-07-28

Sainbayar Sukhbaatar, Edouard Grave, Guillaume Lample, Herve Jegou, Armand Joulin

Transformer networks have lead to important progress in language modeling and machine translation. These models include two consecutive modules, a feed-forward layer and a self-attention layer. The latter allows the network to capture long term dependencies and are often regarded as the key ingredient in the success of Transformers. Building upon this intuition, we propose a new model that solely consists of attention layers. More precisely, we augment the self-attention layers with persistent memory vectors that play a similar role as the feed-forward layer. Thanks to these vectors, we can remove the feed-forward layer without degrading the performance of a transformer. Our evaluation shows the benefits brought by our model on standard character and word level language modeling benchmarks.

PaperPDFConference PDFCodeCode 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="1907.01470")

Code

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

By repository: community (archive-listed): 1 sample from 1 repository, 1 ran; 4 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.

facebookresearch/adaptive-span mentioned on GitHubpytorchNOASSERTION report
lucidrains/x-transformers mentioned on GitHubpytorch 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

5 samples harvested; 5 ran; 2 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.

2ran · honoured contract
3ran · violated contract

Licence: 4 of the 5 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/x-transformers. 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.

first lucidrains/x-transformers/x_transformers/x_transformers.py community (archive-listed) ran · violated contract MIT (permissive) · 123a841a20bb0ebd · report
identity identical code first harvested elsewhere ran · honoured contract licence of this copy not recorded · 7f1040f5e3991d5e · report
compact identical code first harvested elsewhere ran · honoured contract fingerprinted licence of this copy not recorded · 4a06bf1ac86f840a · report
default identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 60fff7c3c400d7ff · report
exists identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · aa5486a3650902d8 · report

Tasks

Language ModelingLanguage ModellingTranslation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Language Modelling Text8 All-attention network - 36 layers Bit per Character (BPC) 1.08 #6 of 24 Archive leaderboard report
Language Modelling Text8 All-attention network - 36 layers Number of params 114M #6 of 24 Archive leaderboard report
Language Modelling Text8 All-attention network - 18 layers Bit per Character (BPC) 1.11 #9 of 24 Archive leaderboard report
Language Modelling Text8 All-attention network - 18 layers Number of params 38M #9 of 24 Archive leaderboard report
Language Modelling WikiText-103 All-attention network (36 layers) Number of params 133M #44 of 89 Archive leaderboard report
Language Modelling WikiText-103 All-attention network (36 layers) Test perplexity 20.6 #44 of 89 Archive leaderboard report
Language Modelling WikiText-103 All-attention network (36 layers) Validation perplexity 19.7 #44 of 89 Archive leaderboard report
Language Modelling enwik8 All-attention network (18 layers) Bit per Character (BPC) 1.01 #19 of 42 Archive leaderboard report
Language Modelling enwik8 All-attention network (18 layers) Number of params 39M #19 of 42 Archive leaderboard report
Language Modelling enwik8 All-attention network (36 layers) Number of params 114M #42 of 42 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

Introduced by this paper: All-Attention Layer

AdaGradAdamAdaptive MaskingAll-Attention LayerL1 Regularization

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