QTrace
Measure sensitivity to quantization.
For the same query, quantized keys can produce different attention. QTrace estimates this sensitivity from the interactions observed while keys are still in the hot cache.
Attention-weighted query energy accumulates into Hd, a compact statistic for each key and channel.
The QTrace statistic
Here a is original attention, q is the observed query, and d is the head dimension. Query heads r share KV head h; Eᵢ contains observed subsequent queries. The statistic is computed once and reused across candidates.
