Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Memorizing Transformers

About

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.

Yuhuai Wu, Markus N. Rabe, DeLesley Hutchins, Christian Szegedy• 2022

Related benchmarks

TaskDatasetResultRank
Language ModelingarXiv (test)
PPL8.6
137
Language ModelingGitHub (test)
Perplexity7.26
113
Language ModelingPG-19 (test)
Perplexity23.24
106
Language ModelingPG-19
Perplexity11.05
96
Document SummarizationGovReport (test)
ROUGE-157
50
Long document summarizationBookSum (test)
ROUGE 135.6
37
SummarizationSummScreen (test)
ROUGE-133
17
Language ModelingPG19 bytes (test)
Bits Per Token0.95
14
Language ModelingarXiv tokens (test)
Bits Per Token1.22
14
Language ModelingPG19 tokens (test)
Bits per Token3.53
14
Showing 10 of 13 rows

Other info

Follow for update