HyperAIHyperAI

Command Palette

Search for a command to run...

LLM
Transformer

GAUGEROPE : ATTENTION LATENTE EXÉCUTABLE COMPATIBLE AVEC ROPE

Yuanhang Gao Xiangrui Yang Lingyuan Meng Yuanfeng Chen Dongsheng Li

Résumé

La compression du cache KV latent réduit l'empreinte mémoire en projetant les clés et valeurs historiques vers des représentations compactes. Cependant, les états de clés compressés génériques nécessitent une reconstruction à la dimension native avant l'application de RoPE et le calcul des scores d'attention, ce qui ajoute un surcoût proportionnel à la longueur de séquence sur le chemin de décodage. Nous caractérisons les conditions sous lesquelles une représentation KV latente peut servir directement d'état d'exécution d'un RoPE pré-entraîné. Pour les transformeurs fondés sur RoPE, l'exécution linéaire statique exacte du chemin de clé rotatif exige que l'application latente-vers-native préserve l'action du RoPE pré-entraîné via une relation d'entrelacement, ce qui restreint le mélange exact aux coordonnées partageant la même fréquence de RoPE. Guidés par cette caractérisation, nous construisons GAUGEROPE, une représentation KV latente exécutable sans entraînement. Elle combine un support compatible RoPE qui préserve l'action rotative avec une correction résiduelle clé–valeur (RKV) approximative indépendante de la position pour les informations complémentaires de clé et de valeur, toutes deux évaluées sans reconstruction dense historique K/V par jeton. Sur Mistral-7B, GaugeRoPE atteint une compression KV de 5,85× tout en maintenant une qualité proche de la référence à cache complet. Des résultats supplémentaires en MHA valident la construction au-delà du GQA. GaugeRoPE atteint jusqu'à 2,48× le débit de décodage de la référence non compressée grâce à l'exécution latente directe.

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×5.85\times5.85× KV compression while maintaining quality close to the full-cache baseline and up to 2.48×2.48\times2.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\mathbf{r}^K = \mathbf{k} - \hat{\mathbf{k}}^GrK=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.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp