← Back to article

Equation 13 · Serving a Frontier Model: The KV Cache, Batching, and What a Token Actually Costs

What does this equation mean?

bmax⁡≈Mdevice−MweightsMkv(s),b_{\max} \approx \frac{M_{\mathrm{device}} - M_{\mathrm{weights}}}{M_{\mathrm{kv}}(s)} ,

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 gives an approximation: it relates the quantities while allowing an approximation. 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

bmax⁡b_{\max}

Symbol b_max

bmb_max is a part of this expression. Its role is fixed by the surrounding article and by the operations shown in the formula.

Understand this part →

MdeviceM_{\mathrm{device}}

Symbol M_device

MdM_device occurs above the fraction bar. The numerator is divided by the entire denominator below it.

Understand this part →

MweightsM_{\mathrm{weights}}

Symbol M_weights

MwM_weights occurs above the fraction bar. The numerator is divided by the entire denominator below it.

Understand this part →

MkvM_{\mathrm{kv}}

Symbol M_kv

MkM_kv occurs below the fraction bar. The quantity above the bar is divided by this expression; zero is excluded as a denominator.

Understand this part →

ss

Symbol s

s is a part of this expression. Its role is fixed by the surrounding article and by the operations shown in the formula.

Understand this part →

fraction

fraction

Divide the expression above the line by the one below it.

Understand this part →

See an illustrated explanation →
≈

≈

Approximately equal to; the equality is not exact.

Understand this part →

subtraction

subtraction

Subtract the following term or group from the preceding one. A leading minus marks a negative quantity.

Understand this part →

subscript

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.

Understand this part →

Mdevice−MweightsM_{\mathrm{device}} - M_{\mathrm{weights}}

Numerator: M_device - M_weights

The complete quantity above the fraction bar.

Understand this part →

Mkv(s)M_{\mathrm{kv}}(s)

Denominator: M_kv(s)

The complete quantity below the fraction bar; it must be nonzero for this division.

Understand this part →

How to interpret it

With a fixed numerator, increasing a nonzero denominator reduces the fraction. Its accuracy depends on the assumptions and range of use described in the article.

What the article says around this equation

What binds is memory, and specifically the cache. Weights are shared across the batch; the key–value cache is not. Each concurrent request carries its own, and each grows with every token it generates. Achievable batch size is therefore bmax⁡≈Mdevice−MweightsMkv(s)b_{\max} \approx \frac{M_{\mathrm{device}} - M_{\mathrm{weights}}}{M_{\mathrm{kv}}(s)} . which falls as contexts lengthen. This is the mechanism behind an effect users notice without explanation: long-context workloads cost disproportionately more, because they crowd out the concurrency that made short-context serving cheap.

Read the equation in its article →

Sources cited in the article section

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

See this formula across 2 published contexts →

Browse the mathematical compendium →