Skip to main content

Models · English edition

Long context: window size, effective use and cost

Practitioner methodology · key facts carry official sources

“Supports 128K” is an upper bound, not a guarantee that information in the middle will be found. Long-context selection must consider position robustness, attention cost, KV-cache memory and task-level acceptance.

A window is not effective use

Needle-in-a-haystack tests show retrieval at one position; real tasks require reasoning across many passages. Test multi-fact questions, conflicting sources and middle-position evidence. Report accuracy by position bucket, not one aggregate score.

Position encoding decides extrapolation

Models trained at 8K may advertise 128K through rope scaling or YaRN. Extrapolation can preserve fluency while losing precision. Check the model card for the training length, the extension method and whether the extension was fine-tuned or applied at inference only.

Attention cost and prefill

Long prompts increase prefill time and KV-cache memory. Estimate memory as a function of layers, KV heads, head dimension, sequence length and batch size. For agent workloads, repeated calls with the same prefix can be cached; without caching, the same long context is paid again and again.

The KV cache is the hidden bill

Serving many long-context users multiplies KV-cache memory. Quantised KV caches and paged attention reduce the footprint but can change quality. Measure concurrent sessions at your target context length; a model that serves one 128K request may not serve ten.

English edition. Figures and vendor claims are snapshots; verify the linked primary sources before making a decision.