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.
Lay summary (by Claude 3 Sonnet): Researchers have developed a new method that allows large language models (LLMs), which are powerful artificial intelligence systems that can understand and generate human-like text, to process extremely long texts without requiring excessive memory or computation resources. This is achieved through a technique called “Infini-attention,” which combines different types of attention mechanisms (ways for the model to focus on relevant parts of the input) into a single component. The researchers tested their approach on tasks like language modeling (predicting the next word in a sequence), retrieving information from very long texts, and summarizing books. Their method performed well on these tasks while using a limited amount of memory, enabling fast processing of long texts by LLMs.