arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.04245cs.LGcs.CLstat.ML
收藏

Transformer如何学习主题结构:迈向机制性理解

How Do Transformers Learn Topic Structure: Towards a Mechanistic Understanding

Carnegie Mellon University(卡内基梅隆大学);Microsoft Research(微软研究院)

Yuchen Li, Yuanzhi Li, Andrej Risteski

AI总结:

该研究结合数学分析与Wikipedia、LDA合成数据实验,揭示Transformer的嵌入层与自注意力层通过同主题词高内积、高注意力值编码主题结构,为其语义学习机制提供细粒度机制性理解。

摘要:

尽管Transformer在诸多领域的成功毋庸置疑,但目前仍普遍缺乏对其学习机制的准确认知。学界已在包含多种结构化与推理任务的基准上测试了其能力,但数学层面的理解仍大幅滞后。近期研究已开始探讨该问题的表征层面,即基于注意力的网络执行特定任务所需的规模、深度与复杂度,但无法保证学习动力学能收敛到所提出的构造形式。本文针对Transformer如何学习“语义结构”(即捕捉词的共现结构)提供了细粒度的机制性理解。具体而言,我们结合数学分析,以及在Wikipedia数据和由Latent Dirichlet Allocation(LDA,潜在狄利克雷分配)建模的合成数据上开展的实验,证明嵌入层与自注意力层均对主题结构进行编码:嵌入层体现为同主题词之间的嵌入平均内积更高,自注意力层则体现为同主题词之间的平均成对注意力值更高。数学结果包含若干为使分析可行而设的假设,我们已在数据上验证了这些假设,且这些假设本身也可能具备独立研究价值。

英文摘要:

While the successes of transformers across many domains are indisputable, accurate understanding of the learning mechanics is still largely lacking. Their capabilities have been probed on benchmarks which include a variety of structured and reasoning tasks -- but mathematical understanding is lagging substantially behind. Recent lines of work have begun studying representational aspects of this question: that is, the size/depth/complexity of attention-based networks to perform certain tasks. However, there is no guarantee the learning dynamics will converge to the constructions proposed. In our paper, we provide fine-grained mechanistic understanding of how transformers learn "semantic structure", understood as capturing co-occurrence structure of words. Precisely, we show, through a combination of mathematical analysis and experiments on Wikipedia data and synthetic data modeled by Latent Dirichlet Allocation (LDA), that the embedding layer and the self-attention layer encode the topical structure. In the former case, this manifests as higher average inner product of embeddings between same-topic words. In the latter, it manifests as higher average pairwise attention between same-topic words. The mathematical results involve several assumptions to make the analysis tractable, which we verify on data, and might be of independent interest as well.

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

↑