Memory

Scaling Transformer to 1M tokens with RMT

First page
Scaling Transformer to 1M tokens with RMT
Paper summary

Recurrent Memory Transformer extends BERT's effective context to 2M tokens.

Ask this paper

Key points
01

Recurrent memory mechanism: Augments BERT with a recurrent memory that carries information across segments, enabling massive context lengths.

02

2M token context: Scales effective context to two million tokens while maintaining high memory retrieval accuracy.

03

Segment-level recurrence: Processes input in segments while passing a compressed memory token stream across them.

04

Long-context trend: Part of the 2023 explosion of long-context techniques that established ultra-long context as a viable research direction.

Abstract

A major limitation for the broader scope of problems solvable by transformers is the quadratic scaling of computational complexity with input size. In this study, we investigate the recurrent memory augmentation of pre-trained transformer models to extend input context length while linearly scaling compute. Our approach demonstrates the capability to store information in memory for sequences of up to an unprecedented two million tokens while maintaining high retrieval accuracy. Experiments with language modeling tasks show perplexity improvement as the number of processed input segments increases. These results underscore the effectiveness of our method, which has significant potential to enhance long-term dependency handling in natural language understanding and generation tasks, as well as enable large-scale context processing for memory-intensive applications.

Every Monday
Get next week’s papers.
Subscribe on Substack