Home▸AI & Machine Learning▸KV Cache in 2D: Linear vs Quadratic Inference Cost

🗝️ KV Cache in 2D: Linear vs Quadratic Inference Cost

2D companion of the KV cache simulation: a layer-by-token grid of key and value slots with recompute heat, attention weights of the newest token and a GPU memory gauge, driven by a real 4-head transformer decoder, with four numerical checks.

AI & Machine Learning2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
KV Cache in 2D: Linear vs Quadratic Inference Cost ↗ Open standalone
⚙ Under the hood

2D companion of the KV cache simulation: a layer-by-token grid of key and value slots with recompute heat, attention weights of the newest token and a GPU memory gauge, driven by a real 4-head transformer decoder, with four numerical checks.

transformerattentionkv-cacheinferenceautoregressivellm

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)