Command Palette
Search for a command to run...
GAUGEROPE: RoPE 호환 실행형 잠재 어텐션
GAUGEROPE: RoPE 호환 실행형 잠재 어텐션
Yuanhang Gao Xiangrui Yang Lingyuan Meng Yuanfeng Chen Dongsheng Li
초록
잠재 KV 캐시 압축은 과거 키와 값을 압축된 표현으로 매핑하여 메모리 사용량을 줄인다. 그러나 일반적인 압축 키 상태는 RoPE를 적용하고 어텐션 점수를 계산하기 전에 원래 차원으로 재구성해야 하므로 디코딩 경로에 시퀀스 길이에 비례하는 오버헤드가 추가된다. 본 연구에서는 잠재 KV 표현이 사전학습된 RoPE의 실행 상태로 직접 사용될 수 있는 조건을 규명한다. RoPE 기반 트랜스포머에서 회전 키 경로의 정확한 정적 선형 실행을 위해서는 잠재-원본 사상이 얽힘 관계를 통해 사전학습된 RoPE 작용을 보존해야 하며, 이에 따라 정확한 혼합은 동일한 RoPE 주파수를 공유하는 좌표로 제한된다. 이러한 특성 분석에 기반하여, 본 연구는 학습이 필요 없는 실행형 잠재 KV 표현인 GAUGEROPE를 구축한다. GAUGEROPE는 회전 작용을 보존하는 RoPE 호환 캐리어와 보완적인 키-값 정보를 위한 근사적 위치 독립 잔차 키-값(RKV) 보정을 결합하며, 두 구성 요소 모두 토큰별 고밀도 과거 K/V 재구성 없이 평가된다. Mistral-7B에서 GaugeRoPE는 5.85배의 KV 압축을 달성하면서도 전체 캐시 기준선에 근접한 품질을 유지한다. 추가적인 MHA 실험을 통해 GQA를 넘어서는 구성에서도 그 유효성이 검증되었다. GaugeRoPE는 직접적인 잠재 실행을 통해 비압축 기준선 대비 최대 2.48배의 디코딩 처리량을 달성한다.
One-sentence Summary
Researchers at the National University of Defense Technology propose GaugeRoPE, a training-free executable latent KV representation that combines a RoPE-compatible carrier with an approximate position-independent residual key-value correction, allowing it to avoid per-token dense historical K/V reconstruction and, on Mistral-7B, achieve 5.85× KV compression while maintaining quality close to the full-cache baseline and up to 2.48× the decode throughput of the vanilla uncompressed baseline through direct latent execution.
Key Contributions
- The paper characterizes the static original-frequency linear maps that carry pretrained RoPE exactly, showing that distinct RoPE frequencies cannot mix while same-frequency copies admit arbitrary complex-linear mixing. This identifies when a latent key state can serve directly as the execution state of a RoPE-based transformer.
- The paper introduces GaugeRoPE, a training-free latent KV representation that combines a RoPE-compatible carrier with an approximate position-independent residual key-value correction. Historical attention is evaluated directly from compressed latent states without per-token dense reconstruction of native keys or values.
- Experiments on Mistral-7B show that GaugeRoPE maintains quality close to the full-cache baseline at 5.85× KV compression and achieves up to 2.48× the decode throughput of the vanilla uncompressed baseline, with additional MHA results validating the construction beyond GQA.
Introduction
Autoregressive LLM decoding maintains a growing KV cache, which creates substantial GPU memory and memory-traffic costs at long context lengths and large batch sizes. Post-training low-rank KV compression reduces storage, but prior methods such as Palu reconstruct generic compressed keys into native space before rotary position encoding, so reconstruction overhead scales with sequence length and erodes much of the compression benefit. Architectural alternatives like MLA and TransMLA avoid full reconstruction by decoupling RoPE during pretraining or conversion, but for pretrained GQA and MHA models the structural challenge remains: direct latent scoring is possible only when the latent key space is closed under the pretrained rotary action. The authors characterize the static linear maps that remain exactly compatible with pretrained RoPE, showing that distinct frequencies cannot mix while same-frequency copies admit arbitrary complex-linear mixing. They introduce GaugeRoPE, which combines a RoPE-compatible carrier with a position-independent residual key-value correction to execute historical attention directly from compressed latent states without per-token native-key reconstruction.
Method
The authors leverage the structural properties of Rotary Position Embeddings (RoPE) to design GaugeRoPE, a method that compresses the key-value cache without breaking positional invariance. Standard low-rank key representations fail to absorb the decoder into the query side because RoPE introduces position-dependent rotations. To overcome this, GaugeRoPE constructs a RoPE-compatible latent space that preserves the exact rotary action while drastically reducing the cache footprint.
The core of the architecture relies on a RoPE-compatible carrier. The authors demonstrate that an exact RoPE-compatible map must be block diagonal in frequency. For each frequency, they stack the pre-RoPE key coordinates across all heads sharing that frequency and compute a Gram matrix. The leading eigenvectors of this matrix form the low-rank carrier basis. When utilizing a rank-one basis, the complex phases are folded offline into the pretrained query and key projections. This phase alignment enables purely real-valued inference while preserving the pretrained attention function.
Because a finite-rank carrier cannot span the entire key space, the authors introduce a joint residual key-value (RKV) code to store complementary information. The residual key is defined as the difference between the original key and the key reconstructed from the compatible carrier, expressed as rK=k−k^G. A joint principal component analysis encoder then compresses the flattened residual key and value vectors into a position-independent RKV code.
As shown in the figure below:
The execution pipeline splits the attention computation into two parallel paths that avoid per-token historical native key and value reconstruction. In the first path, the query is projected into the carrier latent space, and the score is computed using latent RoPE. In the second path, the residual key decoder is absorbed into the query side, allowing the residual score to be computed directly from the position-independent RKV code. These two scores are summed to form the final attention logits before the softmax operation. Finally, the values are aggregated in the latent space and decoded once through a shared output projection, completing the efficient attention mechanism.
Experiment
The evaluation compares GaugeRoPE against full models and post-training low-rank and quantization baselines on RULER and LongBench using Mistral-7B, Qwen2.5-7B, and CodeLlama-7B. Results show that GaugeRoPE maintains long-context retrieval and generation quality close to the uncompressed model while reducing KV storage, with stronger passage retrieval and length scaling than low-rank baselines, and it generalizes across GQA and standard MHA backbones. Ablations indicate that the complex compatible carrier plus residual correction improves attention fidelity and generation stability, and the direct decoding design removes historical KV reconstruction, yielding lower latency and higher throughput than compressed baselines at long contexts.
GaugeRoPE at 50% compression achieves the highest RULER average among the low-rank cache methods, with stronger CWE-FWE and QA scores than Palu and ReCalKV, while variable tracking is slightly lower. Its mixed-precision 8/4-bit version reaches about 5.85x compression and closely tracks the unquantized GaugeRoPE on RULER and LongBench, using less per-token KV storage than 6-bit Palu and ReCalKV while outperforming them on RULER. KIVI remains stronger on LongBench but weaker on needle-in-a-haystack, and retaining a small native recent-token cache further improves GaugeRoPE on both RULER and LongBench. At equal 50% compression, GaugeRoPE outperforms Palu and ReCalKV on the RULER average, with gains concentrated in CWE-FWE and QA. The 8/4-bit GaugeRoPE configuration reaches higher compression than 6-bit Palu and ReCalKV, uses less per-token KV storage, and still improves RULER.
The LongBench comparison shows the Full model with the highest average, while KIVI 2-bit is the closest compressed method overall. Among low-rank approaches, GaugeRoPE is stronger in summarization, synthetic, and code tasks but weaker in single-doc QA and few-shot, whereas Palu and ReCalKV show the opposite pattern. Quantized GaugeRoPE reduces per-token KV storage substantially with only a small LongBench average decrease. Full model leads the LongBench average, with KIVI 2-bit compression as the closest overall competitor among the compared methods. GaugeRoPE achieves the best summarization, synthetic, and code scores among low-rank methods, but its single-doc QA and few-shot scores are the lowest across all compared methods. Palu and ReCalKV retain stronger single-doc QA and few-shot performance, while their synthetic and code scores are generally lower than GaugeRoPE's. Quantized GaugeRoPE reduces per-token KV storage by 65.8% while decreasing the LongBench average by only 0.20 points relative to its unquantized counterpart.
GaugeRoPE is tested on Qwen2.5-7B with GQA and CodeLlama-7B with standard MHA at nominal 2x compression with BF16 caches. It retains 88.1% of the full RULER score on Qwen2.5-7B and a similar relative share on CodeLlama-7B, with comparable absolute gaps. This supports transfer across grouped-query and multi-head attention backbones. On Qwen2.5-7B, GaugeRoPE retains 88.1% of the full baseline RULER score. On CodeLlama-7B, GaugeRoPE preserves a similar relative share of full quality under standard MHA. The larger head multiplicity in CodeLlama is noted as supporting a wider compatible carrier under the same construction.
The experiments evaluate GaugeRoPE against low-rank and quantized KV cache baselines on RULER and LongBench, as well as across Qwen2.5-7B with GQA and CodeLlama-7B with MHA. At equal 50% compression, GaugeRoPE leads low-rank methods on RULER, especially in CWE-FWE and QA, while its 8/4-bit mixed-precision version closely tracks unquantized quality with much lower per-token KV storage. On LongBench, GaugeRoPE excels at summarization, synthetic, and code tasks but lags Palu and ReCalKV on single-doc QA and few-shot, while KIVI remains the closest compressed competitor overall. The method also transfers across GQA and MHA backbones, preserving a similar share of full RULER quality on both models.