A Million-Token Window Is Not Memory

Key Takeaways
- •A million-token context window defines maximum sequence length, not permanent or structured long-term memory.
- •Attention dilution ('needle in a haystack') increases retrieval error rates as context approaches sequence boundaries.
- •Combining compact structured memory (graphs/vectors) with focused context windows outperforms raw context dumping in latency and cost.
Kimi K3.1 Pro and ERNIE 5.5 Flash Preview both advertise context windows around one million tokens. That number appears in the marketing of nearly every frontier model released this year, and it is routinely read as a claim about memory.
It is a claim about capacity, which is a different thing. A window of one million tokens means the model will accept a sequence that long. It does not mean the model will use every part of it well, and the evidence that it does not has been public since a 2023 study gave the failure a name.
What the window actually bounds
A transformer processes a sequence by letting each token attend to other tokens. Attention compares every position against every other, which is what lets a model relate a pronoun to its antecedent across a paragraph.
That comparison is quadratic in sequence length. Doubling the context quadruples the attention computation, which is why long context is expensive and why architectures use sliding windows, sparse attention and compression to keep the cost manageable.
The advertised maximum is the length the model will accept under a stated configuration. It is a hard limit set by positional encoding, memory and training, and exceeding it produces an error or truncation rather than degraded output.
Within the limit, behaviour is a matter of degree. A model can process a million tokens and still fail to retrieve a fact at position 400,000, and those two statements are consistent with each other.
Why the middle gets lost
The 2023 finding was that models retrieve information best when it appears near the beginning or the end of the context, and worst when it sits in the middle. Accuracy across positions forms a U-shape, and the trough is deep enough to be operationally significant.
Several explanations are plausible and they are not mutually exclusive. Training data rarely contains tasks that require retrieving a specific fact from the middle of a very long document, so the behaviour is not directly reinforced. Attention weights are distributed across many positions as context grows, so each individual position receives a smaller share. And positional encodings must generalise far beyond the lengths the model saw during most of training.
The practical consequence is that placing a critical instruction at the start of a long prompt and the question at the end works better than placing both in the middle, and that difference has nothing to do with the model's advertised window.
The cost of using the window
Prefill and decode have different cost profiles, and long context makes the difference stark.
Prefill processes the whole input in parallel to build the key-value cache, the stored attention state for every position. It is compute-heavy and fast in wall-clock terms because it parallelises.
Decode generates output one token at a time, and each step reads the entire cache. The cache grows linearly with context length and with layer count, so a million-token conversation holds a very large amount of state in memory per concurrent request.
That has two effects on economics. The memory requirement limits how many requests a device can serve at once, and the per-token cost of a long conversation is not uniform, because every generated token pays to attend over everything before it.
Caching helps and does not eliminate the problem. Prompt caching makes repeated prefixes cheap, which is why agent loops with a stable system prompt are affordable, but a conversation that grows by a thousand tokens per turn still pays for the growth.
Why retrieval still exists
If a model could genuinely use a million tokens of context, the case for retrieval augmentation would weaken. It has not weakened, for three reasons.
Retrieval keeps the prompt short, which keeps cost and latency down. A system that retrieves eight relevant passages spends a fraction of what a system that includes an entire corpus spends, and the difference is often an order of magnitude.
Retrieval improves precision on facts that appear rarely. A specific clause in a specific contract is easier to find by searching for it than by asking a model to notice it among 900,000 other tokens.
And retrieval is auditable. A system that shows which passages it retrieved can be checked, and a system that put everything in the window cannot be interrogated about what it attended to.
The realistic architecture uses both. Retrieval selects a working set, and a long window holds that set plus the conversation. The window is not a replacement for search.
The test that would settle it
A vendor claim about long context should be verifiable by a specific experiment, and the experiment is not difficult to design.
Place a single distinctive fact at a known position in a document of interest, ask a question that requires it, and repeat across positions from the first percentile to the last. Report accuracy per position, not an average, because the average hides the U-shape.
Then repeat with distractors: documents containing similar but incorrect facts, so the model must select rather than match. Then repeat with an updated fact appearing after the original, which tests whether the model prefers the later statement.
A model that passes all three at a million tokens has a usable window. A model that passes the first and fails the third has a window it can accept input through, which is the claim its card actually makes.
What nominal and effective context mean
The distinction worth keeping is between the maximum the model accepts and the amount it uses reliably.
Nominal context is the number on the card. Effective context is the length at which performance on your task stays acceptable, and it is always smaller, often much smaller, and specific to the task rather than to the model.
A model can have a million-token nominal window and an effective window of a few hundred thousand tokens for retrieval, less for multi-hop reasoning across distant passages, and considerably less when the content is dense and the facts are similar to each other.
The only way to know the effective number for your workload is to measure it on your workload. Nothing about the architecture or the benchmark tells you, because both are measuring something else.
Why the number keeps growing
Window size is easy to advertise, easy to compare and difficult to falsify without a specific test that most buyers will not run. That combination makes it a natural marketing metric.
It is a real capability and it is worth having. A larger window means fewer truncation errors, more room for retrieved material and the ability to include a whole contract rather than a summary of it. Those are genuine improvements.
The mistake is treating the window as memory in the human sense, which implies recall of what was in it. A model has no index over its context and no mechanism for deciding what to keep. It has attention weights computed fresh for each request, and what those weights do at extreme lengths is an empirical question that the advertised maximum does not answer.
That distinction is why LongMemEval exists as a separate benchmark. It tests whether a system remembers across sessions, which is a different problem from attending within one, and no window size answers it.



