Key vector (cached) Value vector (cached) Newest token / query Recompute flash (cache off)
drag to pan · dbl-click to recenter

KV Cache in 2D: Linear vs Quadratic Inference Cost

Every large language model generates text one token at a time, and each new token's attention step needs the key and value vectors of everything written so far. This layered 2D dashboard steps through that sequence: a pannable timeline of cached key/value bars on top, a live softmax attention-weight bar chart for the newest query in the middle, and a growth-curve panel underneath plotting cumulative K/V projection cost — flat and linear with the cache on, a visible parabola with it off. Toggle the KV cache off and every earlier token's bars flash as they're recomputed from scratch; toggle model depth, model width, or numeric precision and the memory/compute readouts respond immediately, the same way a real inference server's GPU memory budget responds to those same knobs.