arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.03922cs.LG
收藏

在线向量量化注意

Online Vector Quantized Attention

Zyphra

Nick Alonso, Tomas Figliolia, Beren Millidge

AI总结:

本文提出OVQ注意机制,通过稀疏内存更新提升长上下文处理能力,在保持线性计算和常数内存的同时,显著优于线性注意和SSM。

摘要:

标准序列混合层在语言模型中难以平衡效率与性能。自注意在长上下文任务中表现良好但计算和内存成本高,而线性注意和SSM虽具线性计算和常数内存但处理长上下文能力差。本文开发了一种序列混合层,称为在线向量量化(OVQ)注意,旨在找到内存-计算成本与长上下文处理之间的更好平衡。OVQ-attention具有线性计算和常数内存,但不同于线性注意和SSM,它使用稀疏内存更新,允许其内存状态大幅增加,从而提升内存容量。基于高斯混合回归理论,我们为OVQ-attention建立了理论基础,并在多种合成长上下文任务和长上下文语言建模上进行了测试。OVQ-attention在显著优于线性注意基线和原始VQ-attention上表现优异,尽管使用的是全自注意的少量内存,其性能与强自注意基线在64k序列长度上具有竞争力,有时甚至相同。

英文摘要:

Standard sequence mixing layers used in language models struggle to balance efficiency and performance. Self-attention performs well on long context tasks but has expensive quadratic compute and linear memory costs, while linear attention and SSMs use only linear compute and constant memory but struggle with long context processing. In this paper, we develop a sequence mixing layer that aims to find a better compromise between memory-compute costs and long-context processing, which we call online vector-quantized (OVQ) attention. OVQ-attention requires linear compute costs and constant memory, but, unlike linear attention and SSMs, it uses a sparse memory update that allows it to greatly increase the size of its memory state and, consequently, memory capacity. We develop a theoretical basis for OVQ-attention based on Gaussian mixture regression, and we test it on a variety of synthetic long context tasks and on long context language modeling. OVQ-attention shows significant improvements over linear attention baselines and the original VQ-attention, on which OVQ-attention was inspired. It demonstrates competitive, and sometimes identical, performance to strong self-attention baselines up 64k sequence length, despite using a small fraction of the memory of full self-attention.

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

↑