← Back to article

Equation 12 · How AI Memory Systems and the Bandwidth Wall Actually Work

What does this equation mean?

MKV  =  2 n h d e b l,M_{\mathrm{KV}} \;=\; 2 \, n \, h \, d \, e \, b \, l ,

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.

Inputs and operations2 n h d e b l
Result or conditionM_KV
How to read the two sides of this formula. Follow the article passage for the meaning of each quantity.

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

MKVM_{\mathrm{KV}}

Symbol M_KV

MKM_KV is part of the quantity the equation computes from the expression on the right.

Understand this part →

nn

Symbol n

the number of layers.

Understand this part →

hh

Symbol h

h is an input to the expression that computes the quantity on the left.

Understand this part →

dd

Symbol d

d is an input to the expression that computes the quantity on the left.

Understand this part →

ee

Symbol e

the bytes stored per element.

Understand this part →

bb

Symbol b

b is an input to the expression that computes the quantity on the left.

Understand this part →

ll

Symbol l

l is an input to the expression that computes the quantity on the left.

Understand this part →

=

=

The expressions on both sides represent the same quantity under the stated assumptions.

Understand this part →

See an illustrated explanation →
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 →

How to interpret it

Read it with the definitions, units, and assumptions supplied by the article.

What the article says around this equation

Hooper and colleagues, working on KV cache compression for very long contexts, state the resulting footprint precisely: for a model with n layers and h attention heads of dimension d , stored using e bytes per element, the KV cache size for batch size b and sequence length l is MKV  =  2 n h d e b lM_{\mathrm{KV}} \;=\; 2 \, n \, h \, d \, e \, b \, l . which grows linearly in both batch size and sequence length, with the leading factor of two accounting for storing both keys and values [ 9 ] . That single equation is the whole mechanism: nothing about it is a design choice an inference engineer can simply decline. Extend the conversation, and l grows; serve more requests at once, and b grows; either way MKVM_{\mathrm{KV}} grows with it, and Hooper…
Read the full surrounding passage
Hooper and colleagues, working on KV cache compression for very long contexts, state the resulting footprint precisely: for a model with n layers and h attention heads of dimension d , stored using e bytes per element, the KV cache size for batch size b and sequence length l is MKV  =  2 n h d e b lM_{\mathrm{KV}} \;=\; 2 \, n \, h \, d \, e \, b \, l . which grows linearly in both batch size and sequence length, with the leading factor of two accounting for storing both keys and values [ 9 ] . That single equation is the whole mechanism: nothing about it is a design choice an inference engineer can simply decline. Extend the conversation, and l grows; serve more requests at once, and b grows; either way MKVM_{\mathrm{KV}} grows with it, and Hooper and colleagues note that at sufficiently long context lengths the KV cache — not the model’s weights — becomes the dominant consumer of memory during inference [ 9 ] .

Read the equation in its article →

Sources cited in the surrounding passage

These citations give research context. Read each source to check which claims it supports.

Return to How AI Memory Systems and the Bandwidth Wall Actually Work

See this formula across 1 published context →

Browse the mathematical compendium →