Equation 1 · Serving a Frontier Model: The KV Cache, Batching, and What a Token Actually Costs
What does this equation mean?
Read the formula alongside the article passage below. Each part has a deeper page with its role in the equation, the supporting passage and nearby citations.
This equation states an equality: the expressions on both sides have the same value under the article’s assumptions. Read the equation part by part below; each part has a contextual explanation and a link to its mathematical background.
Read it piece by piece
Symbol M_kv
v is part of the quantity the equation computes from the expression on the right.
Symbol n_kv
v is an input to the expression that computes the quantity on the left.
Symbol p
p is an input to the expression that computes the quantity on the left.
=
The expressions on both sides represent the same quantity under the stated assumptions.
See an illustrated explanation →subscript
The lower label selects a particular version, component, or indexed member of the quantity. For example, x₀ and xₜ can be values at different positions.
How to interpret it
Read it with the definitions, units, and assumptions supplied by the article.
What the article says around this equation
A transformer decoder generates autoregressively: each new token attends over all previous positions [ 1 ] . To avoid recomputing the whole prefix at every step, implementations retain the per-layer key and value tensors for every past position. That is the key–value cache, and its size grows linearly with sequence length: . for L layers, key–value heads, head dimension , sequence length s , batch size b , and p bytes per element. The factor of two counts keys and values.
Sources cited in the surrounding passage
These citations give research context. Read each source to check which claims it supports.
Return to Serving a Frontier Model: The KV Cache, Batching, and What a Token Actually Costs