← Back to article

Equation 15 · How AI Inference Serving Actually Works

What does this equation mean?

bb

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.

the number of concurrently served sequences. 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

bb

Symbol b

the number of concurrently served sequences.

Understand this part →

How to interpret it

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

What the article says around this equation

with the factor of two accounting for storing both keys and values. Two things follow immediately from this equation, and both matter more than the equation’s arithmetic itself. It scales linearly with context length, so a conversation twice as long holds twice the cache. And it scales linearly with the batch b — the exact quantity the previous section identified as the only lever available to make a memory-bound decode step efficient. The key-value cache therefore competes directly, in the same pool of device memory, with the batch size continuous batching is trying to grow. It is not a side cost of serving; it is the resource that sets the ceiling on the technique the previous section…
Read the full surrounding passage
with the factor of two accounting for storing both keys and values. Two things follow immediately from this equation, and both matter more than the equation’s arithmetic itself. It scales linearly with context length, so a conversation twice as long holds twice the cache. And it scales linearly with the batch b — the exact quantity the previous section identified as the only lever available to make a memory-bound decode step efficient. The key-value cache therefore competes directly, in the same pool of device memory, with the batch size continuous batching is trying to grow. It is not a side cost of serving; it is the resource that sets the ceiling on the technique the previous section depends on.

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 How AI Inference Serving Actually Works

Browse the mathematical compendium →