Bridging KV-Cache Quantization and Linear Attention: From Theory to Pretrained Weight Migration
作者: Kaicheng Xiao, Liran Dong, Haotian Li, Guoliang Xing
分类: cs.LG, cs.CL
发布日期: 2026-10-08
💡 一句话要点
提出RAM-Net以桥接KV缓存量化与线性注意力问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: KV缓存量化 线性注意力 RAM-Net Transformer 深度学习 高效计算 模型压缩
📋 核心要点
- 现有的KV缓存量化和线性注意力方法在存储和计算效率上存在挑战,难以兼顾性能与资源消耗。
- 论文提出RAM-Net,通过软分配机制在离散地址空间中实现KV条目的压缩与聚合,提供了一种新的高效注意力机制。
- 在九个不同参数规模的预训练Transformer模型上,RAM-Net在六个常识和知识任务中,平均恢复了87.1%的准确性提升。
📝 摘要(中文)
KV缓存量化和线性注意力是解决Transformer存储和计算成本的两种代表性方法。KV缓存量化将单个KV条目压缩为离散代码,但保留所有条目;而线性注意力则通过重复聚合多个历史KV贡献到固定大小的连续状态,但可能引入干扰。本文提出RAM-Net作为两者之间的桥梁,通过对离散地址空间的软分配来实现。我们证明了在限制的RAM-Net构造下,软地址分配能够扩展硬量化匹配,支持局部近似全注意力相似性并实现递归聚合。实验表明,RAM-Net在九个预训练的Transformer模型上,平均恢复87.1%的准确性提升。
🔬 方法详解
问题定义:本文旨在解决KV缓存量化与线性注意力之间的矛盾,现有方法在性能与资源消耗上难以达到平衡,尤其是在处理历史KV信息时存在干扰问题。
核心思路:论文提出RAM-Net,通过对离散地址空间的软分配,实现KV条目的压缩与聚合,旨在在保持性能的同时降低计算复杂度。
技术框架:RAM-Net的整体架构包括软地址分配模块和连续状态更新模块,前者负责确定每个地址的更新方式,后者则维护与地址相关的连续状态。
关键创新:最重要的创新在于通过软地址分配将硬量化匹配扩展到可分离的读写重叠,支持局部近似全注意力相似性,进而实现高效的递归聚合。
关键设计:在模型设计中,采用了特定的损失函数和参数设置,以确保软量化中间构造的有效性,并优化了网络结构以适应不同规模的Transformer模型。
🖼️ 关键图片
📊 实验亮点
在九个预训练的Transformer模型中,RAM-Net在六个常识和知识任务上,平均恢复了87.1%的准确性提升,相较于随机猜测表现出显著的优势,展示了其在实际应用中的有效性。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、计算机视觉以及其他需要高效注意力机制的深度学习任务。通过降低计算和存储成本,RAM-Net能够在资源受限的环境中实现更高效的模型推理,具有重要的实际价值和未来影响。
📄 摘要(原文)
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.