LLM Context Windows: Why Your 1M-Token Model Only Uses 32K

A 1M-token context window doesn’t mean you can reliably use 1M tokens of context. Across RULER, LongBench v2, and the production-deployed agents we’ve worked with in 2026, every frontier model hits a sharp attention-dilution cliff well before its advertised limit. The engineering reality is closer to 32K–128K usable tokens — and treating the marketing number as a deliverable is the single most common mistake teams make when they ship their first long-context feature.

Long printed document roll spilling off an editorial research desk with a cyan accent - representing how LLM context windows are advertised long but used short.
Hero: editorial research desk with a long printed document roll spilling off the edge. Cyan accent matches the aimade brand.

This piece walks through the mechanism (yes, there’s a mechanism — it’s not vibes), the benchmarks that exposed the gap (Hsieh et al. at NVIDIA, the THUDM LongBench v2 team, plus a couple of Stanford papers you should read), the actual usable window per model family in mid-2026, and a concrete playbook for what to do about it. If you’ve ever watched a “1M-token” model miss a fact that’s literally in front of it, this is for you.

The context window number is a ceiling, not a deliverable

The context window is the maximum number of tokens a model can attend to in a single forward pass. That’s all it is. It tells you the distance to the cliff, not the depth of the field. The number you actually need — the “effective context length” — is the largest size at which the model still does the task you care about, and that number is consistently lower than the ceiling.

How much lower? Hsieh and colleagues at NVIDIA answered this in the RULER paper (arXiv:2404.06654) by extending the simple needle-in-a-haystack eval with 13 harder tasks — variable tracking, multi-hop tracing, frequency analysis, and aggregation. The headline finding was blunt: most models that advertised 128K or 200K context still failed on real retrieval tasks past roughly 64K. (NVIDIA’s RULER repo ships the eval; reproducibility is the point.)

Meanwhile, the marketing numbers keep climbing. Anthropic’s Claude Sonnet 4 1M-context announcement put a 5x bump into production — and explicitly named “entire codebases, hundreds of tool calls” as the targets. Meta’s Llama 4 Scout claims a 10M-token context (yes, ten million). Alibaba’s Qwen3.6-Plus matched Anthropic at 1M (post id 1386). Google DeepMind’s Gemini 2.5 Pro was advertised at 2M tokens — again, the ceiling number, with caveats that the effective window is meaningfully smaller.

So when a model card says “1M context” or “10M context,” what you should hear is: “this model will accept up to that many tokens before the request errors out.” What you should not hear is: “this model will perform reliably on a 750K-token prompt.” The benchmarks tell us why.

Lost in the Middle: the U-shaped attention curve

The mechanism that drives most of the long-context cliff is simple to describe, well-documented, and routinely ignored by people who haven’t read the papers. Nelson Liu and colleagues at Stanford published “Lost in the Middle” in 2023, and it’s the single most useful long-context paper ever written. The finding: language models perform best when relevant information is at the very beginning or end of the input context, and significantly worse when the same information is in the middle. The curve is a U-shape.

Liu et al. tested this across 7 language models including OpenAI’s GPT-3.5 and Meta’s LLaMA variants, on multi-document question answering and key-value retrieval. The result held across every model tested: performance at the 50% mark of the context was 5-15 percentage points lower than performance at the start or end. That’s not a small effect — it’s the difference between a working agent and a useless one.

The practical implication: “put important info at the top of the prompt” is not folklore. It’s a documented retrieval effect rooted in how decoder-only transformers are trained — the beginning and end of a sequence get more attention weight than the middle by default. If you’re shipping a RAG pipeline that interleaves retrieved chunks, you’re leaving accuracy on the table. Order matters. (Our piece on prompt engineering patterns digs into the broader craft, but context placement is the single trick that survives every model revision.)

And this is the conservative finding from 2023. The 2024–2026 benchmarks, with longer context windows and harder tasks, show the same U-shape but more pronounced — the “cliff” at the middle of the context gets steeper as the context grows.

What attention sinks are and why they matter

The second piece of the mechanism is attention sinks. The paper that introduced the term — “Efficient Streaming Language Models with Attention Sinks” by Xiao et al. at Stanford/Meta — observed something curious during streaming chat: the model maintains coherent behavior across very long multi-turn conversations, but the way it does so reveals which tokens it actually pays attention to.

The mechanism: in transformer attention, the softmax operation requires the model to assign probability mass across all keys. The first few tokens of any sequence accumulate disproportionate attention — even blank tokens like ‘nn’ that contain no meaningful information. The model uses these “sink” tokens as a place to park attention mass that doesn’t have anywhere more useful to go. When you naively prune the KV cache to save memory, you accidentally remove these sinks, and the model’s outputs collapse.

StreamingLLM solves this by always preserving the first few sink tokens in the cache, regardless of relevance. The result: the model can stream indefinitely without losing coherence, with only the initial sink tokens fixed. This is also why long-context chat applications can sometimes feel “stuck” on early conversation turns — the model is, mechanically, paying more attention to them.

The implication for production: if you’re building an agent that runs across many turns, the first user message and the system prompt get disproportionate weight. This is why agent drift over long task horizons is so hard to debug — the early instructions are fundamentally louder than the later ones, and the model’s attention follows. When you redesign the agent prompt, the system message matters more than the user message, and both matter more than any single tool result halfway through a 50-step task.

LongBench v2: where models that “do well on RULER” still fail

RULER measures retrieval, and retrieval is the easy case. The THUDM team (Tsinghua) built LongBench v2 to measure something harder: deep reasoning over long context. The methodology is what makes it useful — LongBench v2 requires the model to integrate information from across the entire context to answer correctly, not just retrieve one fact. (The repo has 1,210 stars and is the canonical reference.)

The headline: even frontier models score under 50% on LongBench v2’s deep-reasoning tasks, even when those models post high RULER scores. This isn’t a small gap — it’s a categorical one. A model that “remembers” information from across the context doesn’t necessarily understand how that information relates. (Our recent piece on reasoning models explains why explicit chain-of-thought helps here — but it doesn’t close the gap entirely.)

LongBench v2 has 503 questions across six task categories, mostly with input contexts under 100K words. The single most important design choice: most questions are designed so that naively retrieving a paragraph from the middle of the context yields the wrong answer. You need to integrate. Most models fail at integration.

If you’re building anything that requires reading a long document and reasoning about it — legal contract review, codebase Q&A, scientific literature synthesis — and you’re planning to rely on the 1M context tier to handle it, LongBench v2 is the eval you should run. NIAH will not save you.

The actual usable window per model family (2026 numbers)

Here’s the table that should drive your production decisions, informed by the benchmarks above and the model cards where available. The numbers in parentheses are the published “context window” — the maximum. The numbers in front are the realistic effective working window for deep reasoning tasks, drawn from publicly reported benchmark results.

Model familyPublished windowEffective working window (deep reasoning)Notes
Anthropic Claude Sonnet 4 / Opus 4.6200K (1M opt-in, announcement)~64K–128K1M is generally available but priced differently
OpenAI GPT-5 / GPT-5.2256K (400K for GPT-5.2)~64K–128KReasoning models do somewhat better with structured prompts
Google Gemini 2.5 Pro2M (advertised)~128K per independent benchmarksU-shaped attention pattern even at 2M (source: rank comparison)
Meta Llama 4 Scout10M (advertised)Experimental / undocumented on long-context reasoningMost production evaluations cap at 1M-2M effectively
Alibaba Qwen3.6-Plus1M~64K (per published evals)Same RULER pattern as the rest (source)

The ratio is roughly 2-4x — whatever the published window is, divide by 2 to 4 to get the effective working window for non-trivial tasks. This isn’t because models are bad; it’s because the architecture (decoder-only transformer with full causal attention) has fundamental limits at long sequence length, and the marketing window is the maximum *input*, not the maximum *useful* input.

The Llama 4 Scout 10M claim deserves a special note. Meta’s announcement was a frontier marketing play — 10M context tokens was a number nobody else had. The honest read: it’s an experimental capability that works on toy benchmarks and synthetic retrieval, but production evaluations cap at well below 10M. Treat 10M as a research milestone, not a deployment guideline. (Meta’s Llama 4 model card documents the 10M-context claim; independent benchmarks cap real-world evaluations well below that.)

How to actually use long context: the engineering playbook

Given all of the above — the U-curve, the attention sinks, the LongBench v2 cliff — here’s what to actually do in production. None of these are controversial; all of them get ignored.

1. Don’t stuff the whole document into the prompt. Stuffing a 500K-token document into a 1M-context model sounds like a good idea. It’s not. The model will retrieve the easy parts (top, bottom) and miss the rest. Instead, retrieve the relevant chunks via RAG and put those in a small context. The intuition breaks: long context isn’t a substitute for retrieval. (Our recent piece on fine-tuning vs RAG vs prompt engineering lays out the decision matrix; RAG wins for most retrieval-heavy workloads.)

2. If you must use long context, structure it. A structured prompt that puts task instructions at the top, the relevant context in the middle, and the output format spec at the bottom will outperform a “just paste everything” prompt at the same token count. This is the direct practical implication of the U-curve.

3. Don’t trust SWE-bench or coding-bench numbers as a proxy for long-context retrieval quality. The SWE-PRBench data we cited in our recent Claude vs GPT-5 review piece showed every frontier model doing *worst* on full-context configurations versus structured diff prompts. Coding benchmarks measure a different skill than retrieval across long context. Same model, different failure mode.

4. Use RULER or LongBench v2 on your own workload. Don’t trust the model card. Run the public benchmarks against the specific tasks you care about. The RULER scripts are open-source (GitHub) and run in a few hours on a single GPU. If your task isn’t measured by RULER or LongBench v2 directly, build a small eval set of 50-100 examples that look like your production workload and measure effective context at multiple sizes.

5. Cap your context at “small enough to be reliable,” not “max the model supports.” The 200K standard tier on Claude Sonnet 4 is fine for most workloads and meaningfully cheaper than the 1M tier. The 64K tier on most models is plenty for production RAG. When building agents that do many tool calls, the cumulative context matters more than any single call’s context — cap per-call context, log total session context, and route to fresh agents when session context gets large.

What the benchmarks still get wrong

An honest framing, because aimade’s voice requires it: the benchmarks above don’t capture everything that matters in production.

RULER’s tasks are synthetic — variable tracking and frequency analysis feel artificial, and not every production task looks like that. LongBench v2’s 503 questions are multiple-choice, which simplifies the scoring but loses nuance on subtle reasoning errors. NIAH is solved; nobody serious evaluates long-context models on it anymore.

What’s missing is benchmarks that capture the messy reality of production long-context work: multi-hop reasoning over an entire codebase, synthesis across 50-page legal contracts, conversation-level understanding across 200-message agent sessions. The RULER leaderboard (13 tasks including variable tracking and multi-hop tracing across 4K–128K+) is the closest public benchmark to multi-hop reasoning over long context, and frontier models still fail it past 64K.

The deeper problem is that “long context” itself is an underspecified goal. Different applications need different things from long context. Retrieval-heavy tasks (find the function that defines this exception) and reasoning-heavy tasks (synthesize an answer from a 100-page report) are different failure modes with different effective windows. There’s no single number that captures “how much can this model actually do” — which is why the headline answer to “what’s the effective context window in 2026?” is always “depends on the task.”

What to actually do this week

Pick your model’s published context window. Then halve it — that’s the rough effective ceiling for deep-reasoning tasks. Quarter it for retrieval-light workloads where attention dilution is the dominant failure mode.

If you’re shipping a long-context feature in 2026, build RAG first. Use long context for synthesis across a handful of large documents (legal review, codebase Q&A, multi-source research) — not as a wholesale replacement for retrieval. Test your actual workload with RULER or LongBench v2 before you ship, not NIAH. And when you see “1M context” on a marketing page, treat it as the size of the bucket, not the size of the water you can pour into it without losing coherence. The clamp at the end of the hose is what your users will feel.

The marketing number is a ceiling. The engineering number is the floor. Plan between them, measure against your own workload, and don’t be surprised when the model that’s supposed to handle 1M tokens stumbles at 80K — that’s not a bug. It’s how transformers work.