Work

Separating KV Reuse from Baseline Work in Tiny Attention Benchmarks

Year: 2026
Type: preprint
Abstract: In a single-layer attention benchmark, the dense baseline computes an output at every position in a growing sequence and then discards all but the last. How much of the timing difference comes from caching keys and values, and how much comes from skipping those unused outputs? Four implementations share the same weights, inputs and requested output positions. Across 48 CPU configurations and 2,112 interleaved timings, the median per-configuration ratio of dense to cached runtime was 4.505. Restricting recomputation to the last query reduced that ratio to 1.271. Cache concatenation was faster than last-query recomputation in 44 configurations. Preallocation was faster than concatenation in 20. The largest absolute output difference on the CPU grid was 8.94 × 10⁻⁸. A separate archived Tesla T4 experiment measured two implementations. Across seven trials, the ratio of median dense to median cached runtime was 1.233. These measurements describe a single attention layer. Assistance disclosure: OpenAI Codex assisted with literature retrieval, audit design, implementation, execution, analysis and manuscript preparation. Clever AI Humanizer supplied wording suggestions for the introduction, background and discussion sections. The original attention implementation and archived Tesla T4 measurements predate the manuscript. Public implementation and archived measurements: https://github.com/VEDANT1602/inference-systems-lab/tree/9123c1bc0285130de3e920b61ae18dad58107b88
Language: English
Open Access status: green
OpenAlex ID: W7236573542
Cites:
Cited by:
Related to: 10