atlas

Research map / Architectures and efficiency / Attention and transformers

Beyond Attention: Breaking the Limits of Transformer Context Length with Recurrent Memory

AAAI 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse efficient transformers for long context · 11 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Augments pre-trained transformers (BERT, GPT-2, GPT-Neo) with token-based recurrent memory and segment-level curriculum learning to process inputs up to 2M tokens with linear compute scaling.

Problem

Quadratic scaling of self-attention limits transformer input length, and most recurrent long-context methods require architectural changes or training from scratch.

Approach

Wrap any pretrained transformer with a set of trainable memory vectors prepended to each segment and passed recurrently to the next segment, with no architectural changes, trained via BPTT under a segment-wise curriculum.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add recurrent memory and train with increasing input contextGPT-2 · ArXiv language modelingperplexityHelped
Add recurrent memoryGPT-Neo · Formal theorem provingperplexityHelped
Increase the number of training segments to 5 or more (ablation)RMT with BERT · Synthetic memorization, detection, and reasoning tasksgeneralization to longer sequencesHelped
Train with history across multiple segments instead of without history (ablation)RMT with GPT-2 · ArXiv language modelingperplexity on longer contextsHelped
Mix the number of segments at each curriculum step (ablation)RMT with GPT-2 · ArXiv language modelinggeneralization to other sequence lengthsHelped
Train on 4 or more segments (ablation)RMT with GPT-Neo · Formal theorem provingpredictions for longer sequencesNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: bAbI QuALITY The Pile (ArXiv) Lean 3 Mathlib

Benchmarks: bAbI-based memorization tasks (Memorize, Detect & Memorize, Reasoning) ArXiv language modeling perplexity Lean 3 lemma-based proof perplexity

Metrics: accuracy perplexity FLOPs

Baselines: GPT-2 without memory GPT-Neo without memory OPT Transformer-XL Memformer

Builds on: Recurrent Memory Transformer Memory Transformer Transformer-XL

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy