Memorizing Transformers

By Yuhuai Wu, Markus Norman Rabe, DeLesley S. Hutchins, Christian Szegedy. 2022

249 citations recorded by the source corpus.

Language models typically need to be trained or finetuned in order to acquire new knowledge, which involves updating their weights. We instead envision language models that can simply read and memorize new data at inference time, thus acquiring new knowledge immediately. In this work, we extend language models with the ability to memorize the internal representations of past inputs. We demonstrate that an approximate kNN lookup into a non-differentiable memory of recent (key, value) pairs improves language modeling across various benchmarks and tasks, including generic webtext (C4), math papers (arXiv), books (PG-19), code (Github), as well as formal theorems (Isabelle). We show that the performance steadily improves when we increase the size of memory up to 262K tokens. On benchmarks including code and mathematics, we find that the model is capable of making use of newly defined functions and theorems during test time.

Subfields: Artificial Intelligence, Model Architectures

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Mohit Bansal
  2. Luke S. Zettlemoyer
  3. Percy Liang
  4. Graham Neubig
  5. Jianfeng Gao
  6. Hannaneh Hajishirzi
  7. Yejin Choi
  8. Quoc V. Le

In Model Architectures

  1. Yi Tay
  2. Mostafa Dehghani
  3. Donald Metzler
  4. Dara Bahri
  5. J. Ainslie
  6. Graham Neubig
  7. Jai Gupta
  8. Yuandong Tian

Citations in the corpus