Skip to main content

Long Context

Long Context

  • Core concepts
  • Stage 4 · Under the Hood
  • refs checked 2026-11-03
What problem it solves

The technology behind reading hundreds of thousands of words at once — and why it is expensive.

What it is
Attention cost grows with the square of text length — 10x the text means 100x the compute. Vendors tame the cost with modified attention, positional encoding, and caching; windows grew from thousands of tokens to millions. A long window does not mean accurate reading: grasp of the middle of very long text drops.
Going from 4K to 1M raises attention compute, KV cache and time-to-first-token; fitting is not the same as using well.
Going from 4K to 1M raises attention compute, KV cache and time-to-first-token; fitting is not the same as using well.
Why it matters

"Can fit it in" and "can use it well" are different things. Before comparing window sizes, check how long you actually need and how the model performs on long text in practice.

Sources
  • Attention Is All You Need (complexity table) ↗
  • Google blog: Gemini 1.5 1M-token context (private preview) ↗
Use this term in a task

Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

Task handbooks → · Filter three candidates →