arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.09598cs.LG
收藏

Transformer-FSQ:用于极端KV缓存压缩的离散隐变量

Transformer-FSQ: Discrete Latents for Extreme KV-Cache Compression

Andras Szecsenyi, Thomas L. Lee, Vaisakh Shaj, Elliot J. Crowley, Amos Storkey

AI总结:

提出Transformer-FSQ,用有限标量量化瓶颈替换KV缓存的标准键值投影,在12×至97.5×极端压缩比下,于长上下文检索任务中较基线更准确,解码吞吐量接近原生SDPA注意力,可扩展固定设备的上下文容纳量。

摘要:

私有个性化语言模型必须在本地消费设备上运行,而大型前沿模型无法适配,且保留长上下文并非易事。顺序内存——键值(KV)缓存——随上下文长度线性增长,很快超过模型本身:对于Qwen3-1.7B-Base,200000个保留条目需要21 GiB,是模型权重的6.6倍。然而,我们测试的KV缓存压缩方法在超过中等压缩比后失效。我们提出Transformer-FSQ,通过用有限标量量化瓶颈替换标准键和值投影,解决极端KV缓存压缩问题。我们的缓存每个令牌存储一个打包的离散整数代码向量,无每个令牌的量化元数据。转换预训练Transformer仅在每个原始参数的0.25个令牌上训练这些投影。我们针对0.6B至8B参数的模型,将Transformer-FSQ与5个基线系列进行评估。在长上下文检索(RULER)任务中,从12×到97.5×的压缩比下,Transformer-FSQ是我们评估的所有规模中最准确的方法。融合的Triton内核直接从整数代码解码;在基线使用作者提供的内核(若可用)的情况下,其解码吞吐量是未压缩Qwen3-8B-Base上原生SDPA注意力的1.01倍(95%置信区间0.98–1.05),在32×压缩比下为1.54倍,在97.5×压缩比下为1.54倍。因此,极端KV缓存压缩是扩展固定设备可容纳上下文量的实用方法。

英文摘要:

Private, personalised language models must run on local consumer devices, where large, frontier models cannot fit, and retaining long contexts is non-trivial. Sequential memory---the key-value (KV) cache---grows linearly with context length, quickly dwarfing the model itself: for Qwen3-1.7B-Base, 200,000 retained entries require 21 GiB, 6.6 times more than the model weights. Yet the KV-cache compression methods we measured fail beyond moderate compression ratios. We introduce Transformer-FSQ, addressing extreme KV-cache compression by replacing standard key and value projections with a finite scalar quantisation bottleneck. Our cache stores a packed vector of discrete integer codes per token, with no per-token quantisation metadata. Converting a pretrained transformer trains only these projections on 0.25 tokens per original parameter. We evaluate Transformer-FSQ against five baseline families on models from 0.6B to 8B parameters. On long-context retrieval (RULER), from 12$\times$ to 97.5$\times$ Transformer-FSQ is the most accurate method we evaluate, across scales. A fused Triton kernel decodes directly from the integer codes; with baselines given their authors' kernels where available, it decodes at $1.01\times$ (95% interval $0.98$--$1.05$) the throughput of native SDPA attention on the uncompressed Qwen3-8B-Base at $32\times$ and $1.54\times$ at $97.5\times$. Extreme KV-cache compression is therefore a practical way to extend how much context a fixed device can hold.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑