2025-04-02 · 专家 · 机器学习 · 自然语言处理

Multi-Token Attention

该论文提出了一种名为Multi-Token Attention (MTA)的新注意力机制,通过同时考虑多个查询和键向量,增强了大型语言模型在长文本中定位相关信息的能力。

更新于 2025-05-19。作者:Olga Golovneva、Tianlu Wang、Jason Weston、Sainbayar Sukhbaatar。

中文摘要

软注意力是LLMs(大型语言模型)定位给定上下文中相关部分的关键机制。然而,单个注意力权重仅由单个查询和键标记向量的相似性决定。这种“单标记注意力”限制了用于区分相关部分与上下文其余部分的信息量。为了解决这个问题,我们提出了一种新的注意力方法,即多标记注意力(MTA),它允许LLMs同时根据多个查询和键向量来调整其注意力权重。这是通过在查询、键和头之间应用卷积操作来实现的,使得附近的查询和键可以相互影响彼此的注意力权重,从而实现更精确的注意力。因此,我们的方法可以使用更丰富、更细腻的信息来定位相关上下文,这些信息可以超过单个向量的容量。通过广泛的评估,我们证明了MTA在各种流行的基准测试中实现了增强的性能。值得注意的是,它在标准语言建模任务上优于Transformer基线模型,并且在需要搜索长上下文中信息的任务上,我们的方法利用丰富信息的优势尤为明显。

英文摘要

Soft attention is a critical mechanism powering LLMs to locate relevant parts within a given context. However, individual attention weights are determined by the similarity of only a single query and key token vector. This "single token attention" bottlenecks the amount of information used in distinguishing a relevant part from the rest of the context. To address this issue, we propose a new attention method, Multi-Token Attention (MTA), which allows LLMs to condition their attention weights on multiple query and key vectors simultaneously. This is achieved by applying convolution operations over queries, keys and heads, allowing nearby queries and keys to affect each other's attention weights for more precise attention. As a result, our method can locate relevant context using richer, more nuanced information that can exceed a single vector's capacity. Through extensive evaluations, we demonstrate that MTA achieves enhanced performance on a range of popular benchmarks. Notably, it outperforms Transformer baseline models on standard language modeling tasks, and on tasks that require searching for information within long contexts, where our method's ability to leverage richer information proves particularly beneficial.

解读

一句话总结

该论文提出了一种名为Multi-Token Attention (MTA)的新注意力机制,通过同时考虑多个查询和键向量,增强了大型语言模型在长文本中定位相关信息的能力。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源