Report
Sep. 8, 2026

Long-context latency scales quadratically for GPT-5.6 but nearly linearly for Claude 5

Latency measurements on up to one million tokens suggest the two model families have taken very different architectural approaches to long-context inference.

Introduction

OpenAI and Anthropic price long prompts very differently. Both have similar context windows: GPT-5.6 models have a maximum of 1.05 million tokens, while Claude models have a maximum of 1 million tokens. However, requests to OpenAI models with more than 272,000 input tokens are charged at double the normal input and cached-input price and 1.5 times the normal output price. Claude models, on the other hand, keep a fixed price regardless of input length. While pricing does not necessarily reflect the underlying inference cost, these pricing differences motivated us to test whether the two model families also show different latency scaling with context length.

We measured how the time to first token (TTFT) scales with context length for OpenAI’s GPT-5.6 Terra and Sol and Anthropic’s Claude Sonnet 5 and Opus 5. We found that the two model families behaved very differently. Terra and Sol showed clear upward curvature as prompts got longer, consistent with a significant quadratic component. Sonnet 5 stayed close to linear scaling with no observable curvature, while Opus was noisier but still consistent with linear scaling. To test for the effect of noise in measurements, we fitted three estimators with different assumptions about the latency noise, and found that all three recovered similar curvatures for GPT-5.6 while keeping the Claude fits much closer to linear.

This result suggests that OpenAI and Anthropic have made very different architectural choices in how their respective models process long-context prompts. Claude’s near-linear scaling suggests that full attention, where each token attends across the entire context length and compute scales quadratically with context length, contributes much less to long-context processing than it does for GPT.

GPT and Claude show different long-context latency scaling

We measured TTFT with reasoning disabled across context lengths for four models: GPT-5.6 Terra, GPT-5.6 Sol, Claude Sonnet 5, and Claude Opus 5. Details of the measurement setup are provided in the appendix.

We fit a quadratic curve to each model using the Student-t estimator. Analysis of all four datasets uses the same quadratic specification:

\[\mu(x) = \alpha + \beta x + \gamma x^{2}\]

Terra and Sol show a noticeable curvature. Sonnet is visually linear. Opus has noisier data than Sonnet but is similarly close to linear. In other words, for GPT-5.6, adding the same number of tokens leads to progressively larger increases in TTFT as the context grows, whereas for Claude, the added latency remains much closer to constant.

Four-panel chart of request-level time-to-first-token measurements against input context length for GPT-5.6 Terra, GPT-5.6 Sol, Claude Sonnet 5, and Claude Opus 5, each with a quadratic Student-t fit. The GPT-5.6 fits curve upward while the Claude fits are close to straight lines.
Figure 1. Request-level TTFT measurements and quadratic-capable Student-t fits. The same functional form is fit to all four models. GPT-5.6 Terra and Sol show significant curvature, while the fitted lines for Claude Sonnet 5 and Opus 5 are close to linear.

The difference is robust to different treatments of API latency noise

TTFT benchmarks can be noisy. We designed our experiments to minimize this, but there is clearly still significant noise in our results, especially for Opus. Some TTFT variation likely stems from the model execution itself, but our working hypothesis is that much of it arises from higher-level serving delays, such as queueing and routing. This motivates our use of estimators that treat a substantial part of the latency noise as positive additive delay rather than symmetric measurement error.

To test robustness to this noise, we repeat the analysis using two new estimators that treat latency noise differently: stochastic-frontier regression and a spike-plus-contention model. Both explicitly model additional positive latency from contention, while Student-t regression reduces the influence of extreme observations. Because the estimators target somewhat different notions of underlying latency, their fitted levels need not agree; the relevant test here is whether they agree on the shape of the relationship with context length. Full model specifications are given in the appendix.

Two-panel chart of time-to-first-token against input context length for GPT-5.6 Terra and GPT-5.6 Sol, each showing fits from three estimators: Student-t, stochastic frontier, and spike-plus-contention. All three fitted curves bend upward for both models.
Figure 2. Three estimators make different assumptions about API latency noise but recover similar upward curvature for both GPT-5.6 Terra and GPT-5.6 Sol. Note that some of the estimator lines overlap.

As expected, the estimators fit slightly different curves, but all three still agree on the curvature. Therefore, we can say that the quadratic scaling behavior is unlikely to be due to outliers pulling the curve upward.

Two-panel chart of time-to-first-token against input context length for Claude Sonnet 5 and Claude Opus 5, each showing fits from three estimators: Student-t, stochastic frontier, and spike-plus-contention. The Sonnet fits are nearly straight lines; the Opus data are noisier but the fits show little curvature.
Figure 3. Claude Sonnet remains nearly linear under all three estimators. Opus is noisier and shows greater estimator disagreement, but all three still show minimal curvature. Note that some of the estimator lines overlap.

Sonnet has the cleanest results. The data show that the fit is very close to linear across all three estimators. Opus is much noisier, but the three estimators still produce fits with minimal curvature. Figures 1–3 together show that the tested GPT and Claude models have clearly different scaling curves.

Long-context efficiency has become a design choice

Traditionally, transformer-based LLMs have used full-attention layers, where each token attends to all preceding tokens. Therefore, the total attention compute to process a prompt scales quadratically with prompt length. Many open model families have moved toward more efficient long-context scaling. Hybrid models such as Kimi K3 and Qwen3.5 mix linear attention layers with a much smaller number of full-attention layers, specifically a 3:1 ratio. This decreases the number of full-attention layers by a factor of four, and therefore the quadratic term by the same factor. Qwen3.8-Flash-Next and GLM-5.3-Flash have moved further in this direction by replacing the full-attention layers with sparse attention. Sparse attention layers have a smaller quadratic component compared to full attention while still being able to attend to the entire context length. Sliding-window attention is another well-known technique; it was present in OpenAI’s open-source gpt-oss models. With a fixed window size, sliding-window attention has roughly constant attention cost per token and a linear total cost with sequence length. The common direction across all of these models is to reduce the amount of quadratic computation required at long contexts.

Our results suggest that Anthropic has also approached latency scaling in this way, at least for the models we evaluated. Sonnet and Opus both appear to have much smaller quadratic curvature than the GPT models. This is also in line with the fact that all Claude 5 generation models in Claude Code support a 1-million-token context window by default. In contrast, OpenAI appears to be making a different tradeoff. Although the GPT-5.6 family of models supports a 1.05-million-token context window, Codex defaults to autocompacting before 272,000 tokens. OpenAI has described avoiding context bloat as a key design goal for Codex. High-ranking OpenAI employees have publicly stated that they do not recommend increasing Codex’s default 272,000-token context window, despite official support for up to 1.05 million.

Cost implications of different architectures

Here is an illustrative example using Anthropic’s API pricing for Opus 5 for a 100,000-token request:

ComponentCalculationCost
Cached Input100k tokens × $0.50 / Mtok$0.05
Input (5-min cache write)1k tokens × $6.25 / Mtok$0.00625
Output1k tokens × $25.00 / Mtok$0.025
Total$0.08125

Table 1. Hypothetical API cost for an Opus 5 request with 100,000 tokens of cached context, 1,000 new input tokens, and 1,000 output tokens.

If instead the context were 900,000, the cached input alone would cost $0.45. If cached-input pricing doubled, as with the GPT-5.6 models, the cached-input cost would rise 18× rather than 9× when increasing from 100,000 to 900,000 tokens of context.

So while Claude pricing stays constant, the increase in context results in a significant increase in cost. In contrast, Codex defaults to autocompacting before the 272,000-token threshold, which keeps contexts bounded in size and costs lower. It is possible that OpenAI is betting that 1-million-token contexts are often unnecessary, or that the cost savings offset any performance loss from shorter contexts.

Extrapolating to multi-million-token contexts

Within the supported context window of up to approximately 1 million tokens, the difference is not large enough to make GPT uneconomical. A doubling in price may still be acceptable for many long-context use cases. However, we can also consider how this might change if both model families hypothetically had longer context windows.

To illustrate this, we extrapolate the fitted scaling relationships to contexts of up to 10 million tokens. We used the existing quadratic fits for the GPT models and linear fits for the Claude models. To be clear, we do not claim that the Claude models are completely linear in scaling, but rather that the quadratic coefficient is small enough to approximate with a linear fit. We treat this as a stress test rather than a latency forecast. The measurements themselves extend only to roughly one million tokens, and models or serving systems could behave differently outside that range.

Line chart extrapolating fitted time-to-first-token curves out to 10 million input tokens for GPT-5.6 Terra, GPT-5.6 Sol, Claude Sonnet 5, and Claude Opus 5. The GPT curves rise steeply beyond the measured range while the Claude lines continue linearly.
Figure 4. Illustrative extrapolation of measured TTFT scaling to 10 million tokens using the quadratic Student-t fits for the GPT models and linear Student-t fits for the Claude models. Extrapolation starts at 1M input context, which is near the end of the supported context for all four models.

Another way to see the divergence is to look at the marginal TTFT cost of adding another 10,000 tokens at different context lengths.

ModelAt 0.1M contextAt 1M contextAt 10M context
GPT-5.6 Terra0.071 s0.216 s1.66 s
GPT-5.6 Sol0.136 s0.324 s2.20 s
Claude Sonnet 50.129 s0.129 s0.129 s
Claude Opus 50.218 s0.218 s0.218 s

Table 2. Marginal TTFT added by an additional 10,000 input tokens at different context lengths. The 10M values are extrapolated beyond the measured range. Claude models use a linear extrapolation, so the marginal time is constant.

Extrapolating to these higher contexts makes the significance of the scaling difference clearer. At 10 million tokens, the quadratic curves for the GPT models imply roughly a 7–8× increase in marginal TTFT per additional token relative to 1 million tokens. This would greatly decrease the feasibility of serving these models.

This creates a different tradeoff for long-horizon agentic systems. If serving costs continue to scale linearly with context at these higher token limits, it could become economical to keep more history in the agent’s context as memory. This would allow the memory to be handled at the model level. If serving costs instead scale quadratically with context, then it may be better to use external memory systems and aggressive compaction.

Appendices