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

WildCat: 理论与实践中近乎线性的注意力机制

WildCat: Near-Linear Attention in Theory and Practice

University of Cambridge(剑桥大学)

Tobias Schröder, Lester Mackey

AI总结:

提出WildCat方法,通过随机枢轴Cholesky算法选择加权核心集,在近线性时间内以超多项式误差衰减近似精确注意力,并应用于图像生成、分类和语言模型KV缓存压缩。

摘要:

我们介绍了WildCat,一种高精度、低成本的神经网络注意力机制压缩方法。虽然注意力是现代网络架构的标配,但由于其资源需求随输入序列长度$n$呈二次方增长,部署成本极高。WildCat通过仅关注一个小的加权核心集来避免这些二次成本。关键的是,我们使用一种快速但谱精确的子采样算法——随机枢轴Cholesky——来选择核心集,并最优地加权元素以最小化重构误差。值得注意的是,在输入有界的情况下,WildCat以超多项式$O(n^{-\sqrt{\log(\log(n))}})$的误差衰减逼近精确注意力,同时运行在近线性$O(n^{1+o(1)})$时间内。相比之下,先前的实用近似要么缺乏误差保证,要么需要二次运行时间才能保证如此高的保真度。我们将这一进展与GPU优化的PyTorch实现以及一套基准实验相结合,展示了WildCat在图像生成、图像分类和语言模型KV缓存压缩方面的优势。

英文摘要:

We introduce WildCat, a high-accuracy, low-cost approach to compressing the attention mechanism in neural networks. While attention is a staple of modern network architectures, it is also notoriously expensive to deploy due to resource requirements that scale quadratically with the input sequence length $n$. WildCat avoids these quadratic costs by only attending over a small weighted coreset. Crucially, we select the coreset using a fast but spectrally-accurate subsampling algorithm -- randomly pivoted Cholesky -- and weight the elements optimally to minimise reconstruction error. Remarkably, given bounded inputs, WildCat approximates exact attention with super-polynomial $O(n^{-\sqrt{\log(\log(n))}})$ error decay while running in near-linear $O(n^{1+o(1)})$ time. In contrast, prior practical approximations either lack error guarantees or require quadratic runtime to guarantee such high fidelity. We couple this advance with a GPU-optimized PyTorch implementation and a suite of benchmark experiments demonstrating the benefits of WildCat for image generation, image classification, and language model KV cache compression.

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

↑