Memory Layers at Scale

Vincent-Pierre Berges, Barlas Oğuz, Daniel Haziza, Wen-tau Yih, Luke Zettlemoyer +1 more
12/12/2024
cs.CLcs.AI

No official code found. Best implementation: facebookresearch/memory (386 stars, last commit 2024-12-12).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

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.

38633Shell, PythonNov 26, 20241 years agoNOASSERTION

Similar Papers

Cite this paper

@article{berges2024memory,
  title  = {Memory Layers at Scale},
  author = {Vincent-Pierre Berges and Barlas Oğuz and Daniel Haziza and Wen-tau Yih and Luke Zettlemoyer and Gargi Ghosh},
  year   = {2024},
  eprint = {2412.09764},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.09764v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.09764.svg)](https://codeofpaper.com/paper/2412.09764)

Discussion