Codec-Gauge: Learning Compression-Friendly Gauges for Transformer KV Caches

Yitao Jiang, Yaoqing Yang, Luyang Zhao, Muhao Chen, Devin Balkcom
7/10/2026
cs.LGcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

Long-context Transformer inference increasingly relies on KV-cache compression or quantization. Prior rotation and transform-coding results suggest that the channel basis of each key/value vector affects how faithfully a fixed backend preserves model behavior.

Show full abstract

We introduce Codec-Gauge, a post-training cache-coordinate layer that learns small orthogonal channel transforms around existing compression and quantization backends. Its frequency-distribution objective combines a token-channel DCT spectral-centroid loss with a smooth rate proxy to concentrate KV energy in low-frequency codec-facing layouts. We evaluate actual compression and decompression using measured bytes and rolling compressed-history scoring. Across six models at $3$, $4$, and $6$ bits/value, learned gauges reduce zfp KL divergence by $44.0\%$ on average relative to raw coordinates and outperform random, Hadamard, DCT, and PCA/KLT controls. The same gauges improve quality preservation for block-uniform and KIVI-style quantization. Experiments on a 27B model and long-context task prompts reproduce the quality trend, while serial storage and timing measurements validate the implemented compressed-cache paths. These results establish cache-coordinate geometry as a practical post-training variable for improving compression fidelity without changing model weights, attention semantics, or backend coding rules.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{jiang2026codecgauge,
  title  = {Codec-Gauge: Learning Compression-Friendly Gauges for Transformer KV Caches},
  author = {Yitao Jiang and Yaoqing Yang and Luyang Zhao and Muhao Chen and Devin Balkcom},
  year   = {2026},
  eprint = {2607.20538},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.20538v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.20538.svg)](https://codeofpaper.com/paper/2607.20538)

Discussion