Memorizing Transformers

03/16/2022
by   Yuhuai Wu, et al.
17

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/25/2022

Training Language Models with Memory Augmentation

Recent work has improved language models remarkably by equipping them wi...
research
12/08/2021

Improving language models by retrieving from trillions of tokens

We enhance auto-regressive language models by conditioning on document c...
research
02/15/2017

Frustratingly Short Attention Spans in Neural Language Modeling

Neural language models predict the next token using a latent representat...
research
12/05/2022

Meta-Learning Fast Weight Language Models

Dynamic evaluation of language models (LMs) adapts model parameters at t...
research
02/23/2023

On the Generalization Ability of Retrieval-Enhanced Transformers

Recent work on the Retrieval-Enhanced Transformer (RETRO) model has show...
research
02/15/2023

Augmented Language Models: a Survey

This survey reviews works in which language models (LMs) are augmented w...
research
10/13/2022

Mass-Editing Memory in a Transformer

Recent work has shown exciting promise in updating large language models...

Please sign up or login with your details

Forgot password? Click here to reset