Bridging KV-Cache Quantization and Linear Attention: From Theory to Pretrained Weight Migration
cs.LG, cs.CL
Submitted: 2026-10-08
Updated: 2026-10-08
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
The gist: KV-cache quantization and linear attention are two representative approaches to tackling the storage and computational costs of Transformers.
Terminology
Abstract
KV-cache quantization and linear attention are two representative approaches to tackling the storage and computational costs of Transformers. KV-cache quantization compresses individual KV entries into discrete codes but retains all entries, whereas linear attention recurrently aggregates multiple historical KV contributions into a fixed-size continuous state but can introduce interference. This contrast raises the question of whether per-KV compression and multi-KV aggregation can be bridged within a single mechanism for efficient attention. We identify RAM-Net as such a bridge through soft assignments over a discrete address space. These assignments determine recurrent updates to the continuous slot state associated with each address. Under a restricted RAM-Net construction, we prove that soft address assignments extend hard quantized matching to a separable read-write overlap that locally approximates full-attention similarity and supports recurrent aggregation. These connections further enable Transformer-to-RAM-Net weight migration through a new path based on a soft-quantized intermediate construction. Across nine pretrained Transformer models from 0.3B to 7B parameters, RAM-Net recovers an average of 87.1% of the teachers' accuracy gains over random guessing across six commonsense and knowledge tasks using only a 500M-token budget per model.
Sources
- Online Vector Quantized Attention
- Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models
- Llamba: Scaling Distilled Recurrent Models for Efficient Language Processing
- RADLADS: Rapid Attention Distillation to Linear Attention Decoders at Scale
- Mistral 7B
- The Key to Going Linear: Analysis-Driven Transformer Linearization
- Liger: Linearizing Large Language Models to Gated Recurrent Structures
- Linearizing Large Language Models
- FP8 Formats for Deep Learning
- Attention to Mamba: A Recipe for Cross-Architecture Distillation
- Qwen2.5 Technical Report
- RoFormer: Enhanced Transformer with Rotary Position Embedding
- Llama 2: Open Foundation and Fine-Tuned Chat Models
- AVQ-Attention: Adaptive Vector-Quantized Attention
- RAM-Net: Linear-Time Sequence Modeling with Sparsely Addressable State
- The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicry
- LoLCATs: On Low-Rank Linearizing of Large Language Models
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks