KV·Cache Debugger

Models KV-cache memory and attention-score multiplications only — not full transformer runtime.
MHA cache ON

Prefill & decode timeline

8/s
Segment widths are schematic (compressed for readability); the labelled token counts are exact.

KV-cache shape

Memory

KV caching reduces repeated compute but consumes additional memory — it never reduces KV-cache memory. The cache grows linearly with sequence length.

Attention-score multiplications

Counts attention-score multiplications (Q·Kᵀ dot-product multiplies) only — no projections, MLP, softmax, memory traffic, or measured latency/FLOPs.

Cache memory vs sequence length

linear scale

Work per generation step

cached vs uncached · log-10 y-scale

Cumulative work

cached (incl. prefill) vs uncached · log-10 y-scale

MHA vs GQA vs MQA — same model, different KV-head count

What you are looking at