arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.04057cs.CLcs.LGstat.ML
收藏

双向注意力作为连续词专家的混合体

Bidirectional Attention as a Mixture of Continuous Word Experts

University of Michigan(密歇根大学)

Kevin Christian Wibisono, Yixin Wang

AI总结:

本文从统计角度证明双向注意力等价于连续词袋上的MoE结构,并据此提出表格数据扩展,提升OOD泛化且刻画线性词类比条件。

摘要:

双向注意力——由带位置编码的自注意力和掩码语言模型(MLM)目标组成——已成为现代大语言模型(LLM)的关键组成部分。尽管其在实证上取得了成功,但很少有研究考察其统计基础:双向注意力隐含拟合的是什么统计模型?是什么使其区别于非注意力的前代模型?本文探讨这些问题。关键观察是,在重新参数化后,拟合单层单头双向注意力等价于拟合带有混合专家(MoE)权重的连续词袋(CBOW)模型。此外,具有多头和多层的双向注意力分别等价于堆叠的MoE和MoE的混合。这一统计视角揭示了MoE在双向注意力中的独特用法,这与其在处理异构数据时的实际有效性相符。它还表明,如果将句子中的每个词位置视为一个表格特征,便可直接扩展到类别型表格数据。在多项实证研究中,我们发现该扩展在分布外(OOD)泛化方面优于现有transformer的表格扩展。最后,这种双向注意力的统计视角使我们能够在理论上刻画其词嵌入何时存在线性词类比。这些分析表明,与非注意力前代模型相比,双向注意力展现线性词类比可能需要强得多的假设。

英文摘要:

Bidirectional attention $\unicode{x2013}$ composed of self-attention with positional encodings and the masked language model (MLM) objective $\unicode{x2013}$ has emerged as a key component of modern large language models (LLMs). Despite its empirical success, few studies have examined its statistical underpinnings: What statistical model is bidirectional attention implicitly fitting? What sets it apart from its non-attention predecessors? We explore these questions in this paper. The key observation is that fitting a single-layer single-head bidirectional attention, upon reparameterization, is equivalent to fitting a continuous bag of words (CBOW) model with mixture-of-experts (MoE) weights. Further, bidirectional attention with multiple heads and multiple layers is equivalent to stacked MoEs and a mixture of MoEs, respectively. This statistical viewpoint reveals the distinct use of MoE in bidirectional attention, which aligns with its practical effectiveness in handling heterogeneous data. It also suggests an immediate extension to categorical tabular data, if we view each word location in a sentence as a tabular feature. Across empirical studies, we find that this extension outperforms existing tabular extensions of transformers in out-of-distribution (OOD) generalization. Finally, this statistical perspective of bidirectional attention enables us to theoretically characterize when linear word analogies are present in its word embeddings. These analyses show that bidirectional attention can require much stronger assumptions to exhibit linear word analogies than its non-attention predecessors.

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

↑