English

Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention

Computation and Language 2024-08-13 v2 Artificial Intelligence Machine Learning Neural and Evolutionary Computing

Abstract

This work introduces an efficient method to scale Transformer-based Large Language Models (LLMs) to infinitely long inputs with bounded memory and computation. A key component in our proposed approach is a new attention technique dubbed Infini-attention. The Infini-attention incorporates a compressive memory into the vanilla attention mechanism and builds in both masked local attention and long-term linear attention mechanisms in a single Transformer block. We demonstrate the effectiveness of our approach on long-context language modeling benchmarks, 1M sequence length passkey context block retrieval and 500K length book summarization tasks with 1B and 8B LLMs. Our approach introduces minimal bounded memory parameters and enables fast streaming inference for LLMs.

Keywords

Cite

@article{arxiv.2404.07143,
  title  = {Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention},
  author = {Tsendsuren Munkhdalai and Manaal Faruqui and Siddharth Gopal},
  journal= {arXiv preprint arXiv:2404.07143},
  year   = {2024}
}

Comments

9 pages, 4 figures, 4 tables (v2 adds: background, implementation details, recent citations and acknowledgments)

R2 v1 2026-06-28T15:50:11.190Z