
The KV-Surgeon: Compensation-Aware Offline KV-Cache Compaction
Replaces per-entry independent scoring for KV-cache eviction (e.g., attention matching) with a calibration-data-driven quadratic surrogate that jointly selects removals and compensates remaining entries, accounting for softmax renormalization. Cost is a one-time offline compaction pass with calibration data per fixed context, plus the memory of retaining a small calibration set; the compacted cache then reduces per-query memory and compute on repeated queries. It can fail when the queried context is not fixed and reused (no amortization of the offline cost), when calibration data is unrepresentative of production queries, or when compaction ratios are pushed beyond the validated operating points.







































