Papers › Memory Layers at Scale

Memory Layers at Scale

12 Dec 2024arXiv:2412.09764archive 2025-07-28

Vincent-Pierre Berges, Barlas Oğuz, Daniel Haziza, Wen-tau Yih, Luke Zettlemoyer, Gargi Ghosh

Memory layers use a trainable key-value lookup mechanism to add extra parameters to a model without increasing FLOPs. Conceptually, sparsely activated memory layers complement compute-heavy dense feed-forward layers, providing dedicated capacity to store and retrieve information cheaply. This work takes memory layers beyond proof-of-concept, proving their utility at contemporary scale. On downstream tasks, language models augmented with our improved memory layer outperform dense models with more than twice the computation budget, as well as mixture-of-expert models when matched for both compute and parameters. We find gains are especially pronounced for factual tasks. We provide a fully parallelizable memory layer implementation, demonstrating scaling laws with up to 128B memory parameters, pretrained to 1 trillion tokens, comparing to base models with up to 8B parameters.

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="2412.09764")

Code

Syntology Ran 4 of 19 code samples harvested from 1 repository linked to this paper; 15 have no recorded run. Of those that ran: 4 ran with no contract checked.

By repository: official repository: 19 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

facebookresearch/memory officialmentioned in paperpytorchNOASSERTION 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

19 samples harvested; 4 ran; 0 honoured the contract we drafted; 15 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.

4ran
15unverified

Licence: 19 of the 19 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 facebookresearch/memory. “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.

dataclass_from_dict facebookresearch/memory/lingua/args.py official repository ran no licence file found · pointer only · e0ebc4027f1bd03b · report
dataclass_to_dict facebookresearch/memory/lingua/args.py official repository ran no licence file found · pointer only · 116b2f19f9a6148c · report
flatten_dict facebookresearch/memory/lingua/args.py official repository ran no licence file found · pointer only · 15be2e56e073a228 · report
get_empty_buffer_state facebookresearch/memory/lingua/data.py official repository ran no licence file found · pointer only · bfdcca22e67a0a67 · report
allclose facebookresearch/memory/validate_distributed_embeddingbag.py official repository unverified licence not identified · pointer only · 3eb31c04dd0c9897 · report
consolidate_checkpoints facebookresearch/memory/lingua/checkpoint.py official repository unverified licence not identified · pointer only · be7ab0634167f84c · report
dist_max facebookresearch/memory/lingua/distributed.py official repository unverified no licence file found · pointer only · 9caf44ff8e00b1dc · report
dist_mean facebookresearch/memory/lingua/distributed.py official repository unverified no licence file found · pointer only · d09c7072d82024f4 · report
distribute_data_to_rank facebookresearch/memory/lingua/data.py official repository unverified licence not identified · pointer only · faca6fc3f7126a93 · report
find_and_sanitize_chunks facebookresearch/memory/lingua/data.py official repository unverified licence not identified · pointer only · 3c8fff70712ff33a · report
get_device_mesh facebookresearch/memory/lingua/distributed.py official repository unverified licence not identified · pointer only · eae71867f83f5695 · report
get_num_params facebookresearch/memory/lingua/metrics.py official repository unverified no licence file found · pointer only · 81d8582d1fab7bda · report
log_stats facebookresearch/memory/lingua/probe.py official repository unverified no licence file found · pointer only · 22fbaa2caf605450 · report
lr_cosine facebookresearch/memory/lingua/optim.py official repository unverified licence not identified · pointer only · 758fe7262f8fa41e · report
lr_inv_sqrt facebookresearch/memory/lingua/optim.py official repository unverified no licence file found · pointer only · 90403d20388a5636 · report
lr_linear facebookresearch/memory/lingua/optim.py official repository unverified no licence file found · pointer only · 4e2454a79a8338d0 · report
matmul facebookresearch/memory/lingua/float8.py official repository unverified no licence file found · pointer only · 30e68c9cadfddd32 · report
named_replace facebookresearch/memory/lingua/float8.py official repository unverified no licence file found · pointer only · aaa4b37e564944fe · report
scale facebookresearch/memory/lingua/float8.py official repository unverified no licence file found · pointer only · 2848341791f9a450 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

BASE

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