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

基于多项式注意力机制的表达能力研究

The Expressibility of Polynomial based Attention Scheme

Adobe Research(Adobe研究院);University of Michigan(密歇根大学);Boston University(波士顿大学)

Zhao Song, Guangyi Xu, Junze Yin

AI总结:

本文从理论上分析了多项式注意力的表达能力,通过构造两个数据集证明高次多项式注意力能区分低次多项式无法分离的数据,为在注意力机制中采用更高次多项式以捕捉复杂语言相关性提供了理论依据。

摘要:

大型语言模型(LLMs)已显著改善我们日常生活的诸多方面。这些模型影响了从医疗保健到教育等众多领域,提升了生产力、决策过程与可及性。因此,它们已经影响并在一定程度上重塑了人们的生活方式。然而,Transformer架构中注意力的二次复杂度在扩展这些模型以处理长文本上下文时构成了挑战。这一问题使得在长文本上训练超大规模模型或在推理过程中高效使用它们变得不切实际。尽管[KMZ23]最近的一项研究引入了一种技术,用多项式函数和多项式草图(polynomial sketching)替代softmax以加速注意力机制,但这一新方法的理论理解尚不充分。本文对多项式注意力的表达能力进行了理论分析。我们的研究揭示了高次多项式注意力与低次多项式注意力在能力上的差异。具体而言,我们构建了两个精心设计的数据集,即$\mathcal{D}_0$和$\mathcal{D}_1$,其中$\mathcal{D}_1$包含一个与$\mathcal{D}_0$相比数值显著更大的特征。我们证明,在足够高的次数$β$下,单层多项式注意力网络能够区分$\mathcal{D}_0$和$\mathcal{D}_1$。然而,在低次数$β$下,该网络无法有效分离这两个数据集。该分析强调了高次多项式在放大较大数值和区分数据集方面的更高有效性。我们的分析为多项式注意力的表示能力提供了洞见,并为在注意力机制中引入更高次多项式以捕捉复杂的语言相关性提供了理论依据。

英文摘要:

Large language models (LLMs) have significantly improved various aspects of our daily lives. These models have impacted numerous domains, from healthcare to education, enhancing productivity, decision-making processes, and accessibility. As a result, they have influenced and, to some extent, reshaped people's lifestyles. However, the quadratic complexity of attention in transformer architectures poses a challenge when scaling up these models for processing long textual contexts. This issue makes it impractical to train very large models on lengthy texts or use them efficiently during inference. While a recent study by [KMZ23] introduced a technique that replaces the softmax with a polynomial function and polynomial sketching to speed up attention mechanisms, the theoretical understandings of this new approach are not yet well understood. In this paper, we offer a theoretical analysis of the expressive capabilities of polynomial attention. Our study reveals a disparity in the ability of high-degree and low-degree polynomial attention. Specifically, we construct two carefully designed datasets, namely $\mathcal{D}_0$ and $\mathcal{D}_1$, where $\mathcal{D}_1$ includes a feature with a significantly larger value compared to $\mathcal{D}_0$. We demonstrate that with a sufficiently high degree $β$, a single-layer polynomial attention network can distinguish between $\mathcal{D}_0$ and $\mathcal{D}_1$. However, with a low degree $β$, the network cannot effectively separate the two datasets. This analysis underscores the greater effectiveness of high-degree polynomials in amplifying large values and distinguishing between datasets. Our analysis offers insight into the representational capacity of polynomial attention and provides a rationale for incorporating higher-degree polynomials in attention mechanisms to capture intricate linguistic correlations.

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

↑