Lune

EMNLP2022Top-tier venue

Training Language Models with Memory Augmentation

Zexuan Zhong, Tao Lei, Danqi Chen

Abstract

Recent work has improved language models (LMs) remarkably by equipping them with a non-parametric memory component. However, most existing approaches only introduce memories at testing time or represent them using a separately trained encoder, resulting in suboptimal training of the language model. In this work, we present TRIME, a novel yet simple training approach designed for training LMs with memory augmentation. Our approach uses a training objective that directly takes inbatch examples as accessible memory. We also present new methods for memory construction and data batching, which are used for adapting to different sets of memories-local, longterm, and external memory-at testing time. We evaluate TRIME on multiple language modeling and machine translation benchmarks and show that it is able to achieve significant improvements across all the settings. Concretely, TRIME reduces the perplexity from 18.70 to 15.37 on WIKITEXT-103, by effectively leveraging a large memory set from the training corpus. Compared to standard LM training, TRIME adds negligible computational overhead and is compatible with different neural architectures, making it a versatile solution for training memory-augmented LMs. 1 * TL currently works at Google Research. The collaboration was initialized before TL joined Google. 1 Our code and pre-trained models are publicly available at https://github.com/princeton-nlp/TRIME .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

39 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflicts cites Improving Language Models by Retrieving from Trillions of Tokens
  • Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflicts cites Enabling Large Language Models to Generate Text with Citations
  • Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflicts cites Language Models are Few-Shot Learners
  • Big Bird: Transformers for Longer Sequences cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Improving Language Models by Retrieving from Trillions of Tokens cites Language Models are Few-Shot Learners
  • Improving Language Models by Retrieving from Trillions of Tokens cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Enabling Large Language Models to Generate Text with Citations cites Improving Language Models by Retrieving from Trillions of Tokens
  • Enabling Large Language Models to Generate Text with Citations cites Language Models are Few-Shot Learners
  • Language Models are Few-Shot Learners cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Lift Yourself Up: Retrieval-augmented Text Generation with Self-Memory cites Big Bird: Transformers for Longer Sequences
  • Lift Yourself Up: Retrieval-augmented Text Generation with Self-Memory cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Unlimiformer: Long-Range Transformers with Unlimited Length Input cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Unlimiformer: Long-Range Transformers with Unlimited Length Input cites Big Bird: Transformers for Longer Sequences
  • Unlimiformer: Long-Range Transformers with Unlimited Length Input cites Improving Language Models by Retrieving from Trillions of Tokens
  • Focused Transformer: Contrastive Training for Context Scaling cites Big Bird: Transformers for Longer Sequences
  • Focused Transformer: Contrastive Training for Context Scaling cites Improving Language Models by Retrieving from Trillions of Tokens
  • Focused Transformer: Contrastive Training for Context Scaling cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers39

  1. Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge ConflictsJian Xie, Kai Zhang, Jiangjie Chen, Renze Lou et al.ICLR 2024 · 294 citations
  2. Focused Transformer: Contrastive Training for Context ScalingSzymon Tworkowski, Konrad Staniszewski, Mikolaj Pacek, Yuhuai Wu et al.NeurIPS 2023 · 190 citations
  3. Lift Yourself Up: Retrieval-augmented Text Generation with Self-MemoryXin Cheng, Di Luo, Xiuying Chen, Lemao Liu et al.NeurIPS 2023 · 177 citations
  4. Unlimiformer: Long-Range Transformers with Unlimited Length InputAmanda Bertsch, Uri Alon, Graham Neubig, Matthew GormleyNeurIPS 2023 · 176 citations
  5. Enabling Large Language Models to Generate Text with CitationsTianyu Gao, Howard Yen, Jiatong Yu, Danqi ChenEMNLP 2023 · 152 citations

Builds on19

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
  3. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
  4. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  5. Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai et al.ICML 2022 · 1,629 citations

Related papers

  1. Prompting Neural Machine Translation with Translation MemoriesAbudurexiti Reheman, Tao Zhou, Yingfeng Luo, Di Yang et al.AAAI 2023 · 11 citations
  2. Fast and Accurate Neural Machine Translation with Translation MemoryQiuxiang He, Guoping Huang, Qu Cui, Li Li et al.ACL 2021
  3. Pretraining with hierarchical memories: separating long-tail and common knowledgeHadi Pouransari, David Grangier, C Thomas, Michael Kirchhof et al.ICLR 2026 · 11 citations
  4. Neural Machine Translation with Contrastive Translation MemoriesXin Cheng, Shen Gao, Lemao Liu, Dongyan Zhao et al.EMNLP 2022 · 10 citations
  5. Pre-training Limited Memory Language Models with Internal and External KnowledgeLinxi Zhao, Sofian Zalouk, Christian K. Belardi, Justin Lovelace et al.ICLR 2026 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines