← All parts of this equation

Equation 2 · Part 4 · What Actually Happens Inside a Very Long Claude Context Window

Symbol n^2

Cattn(n)=O(n2⋅d),C_{\mathrm{attn}}(n) = O(n^2 \cdot d),
n2n^2

What this part means

the square of n; the number of tokens.

Its job in the formula

n2n^2 is one factor in the product that computes the quantity on the left.

Where the article explains it

For a context of n tokens, the compute spent by self-attention within a single layer scales as Cattn(n)=O(n2⋅d)C_{\mathrm{attn}}(n) = O(n^2 \cdot d).

The passage around this formula

Anthropic’s own engineering guidance, published in September 2025 as advice for developers building long-running agents, gives the clearest available first-party account of why context rot happens architecturally rather than treating it as an unexplained empirical curiosity [ 4 ] . The explanation rests on the transformer’s core mechanism: every token attends to every other token in the context through self-attention, so the number of pairwise relationships the model must represent grows with the square of the sequence length. For a context of n tokens, the compute spent by self-attention within a single layer scales as Cattn(n)=O(n2⋅d)C_{\mathrm{attn}}(n) = O(n^2 \cdot d). where d is the model’s hidden dimension. Doubling…

Read this part in the article →

Learn the underlying idea

An exponent tells how a base is used in multiplication. In x³, x is the base and 3 is the exponent: x³ = x × x × x.

Open the illustrated exponents: repeated multiplication and powers guide →

See this notation across published equations →

Sources cited in the surrounding passage

These citations provide research context; check each source for the exact claim it supports.