Pick a concrete input and say what the equation should give before you read the math.
Foundation reference
Infinite-Context Architectures
Infinite-context architectures handle inputs too long for ordinary attention in one of two ways: they keep a fixed-size compressed memory of earlier segments, or they split exact attention across many devices. Infini-attention let a 1-billion-parameter model, fine-tuned on 5,000-token inputs, retrieve a passkey hidden in 1 million tokens, and an 8-billion-parameter model summarize books of 500,000 tokens (Munkhdalai et al., 2024).
Study guide
Where to start
A fixed-size memory cannot store everything about an unbounded input; what does the linear-attention update keep, and what does it blur together?
How to study this pagePredict · Check · Generalize · Continue
Work through the math, then read the cited papers for the original argument.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
Use the prerequisites and related concepts at the end of the page to fill the next gap.
Why It Matters for Modern Models
- Infinite-context architectures handle inputs too long for ordinary attention in one of two ways: they keep a fixed-size compressed memory of earlier segments, or they split exact attention across many devices. Infini-attention let a 1-billion-parameter model, fine-tuned on 5,000-token inputs, retrieve a passkey hidden in 1 million tokens, and an 8-billion-parameter model summarize books of 500,000 tokens (Munkhdalai et al., 2024).
- Ring Attention trains and runs exact attention on sequences up to the number of devices times longer than earlier memory-efficient transformers could handle (Liu, Zaharia & Abbeel, 2024).
- A long window is not the same as using it well: models often do worst when the relevant information sits in the middle of a long input (Liu et al., 2024), and on the RULER benchmark only about half of the models that claim contexts of 32,000 tokens or more performed satisfactorily at 32,000 (Hsieh et al., 2024).
Questions to Think About
- Ring Attention keeps attention exact by spreading it over devices; why does that bound the memory on each device but not the total computation?
- Why might a model that can retrieve a single hidden passkey from a million tokens still fail at tasks that require combining many facts spread across the input (Hsieh et al., 2024)?
Core Math
Standard attention over tokens,
costs computation, and during generation the cache of keys and values grows linearly with . "Infinite-context" methods attack these costs in two different ways.
Compressive memory. Infini-attention processes the input in segments. Within a segment it uses ordinary local attention; across segments it keeps a fixed-size memory matrix , updated with each segment's keys and values as in linear attention (Munkhdalai et al., 2024):
where is ELU + 1 and accumulates for normalization. A learned gate mixes with the local attention output. Memory and compute per segment stay bounded however long the input is, but the memory is a lossy summary of the past.
Distributed exact attention. Ring Attention splits a long sequence into blocks held on different devices, and passes key-value blocks around a ring of devices while each device computes blockwise attention, overlapping communication with computation (Liu, Zaharia & Abbeel, 2024). Attention stays exact and the maximum length grows with the number of devices, but the total computation is still quadratic in .