arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.00802stat.MLcs.CLcs.LG
收藏

Transformer的诞生:一种记忆视角

Birth of a Transformer: A Memory Viewpoint

Flatiron Institute(熨斗研究所);FAIR, Meta(Meta AI 基础人工智能研究中心)

Alberto Bietti, Vivien Cabannes, Diane Bouchacourt, Herve Jegou, Leon Bottou

AI总结:

该研究从记忆视角出发,通过合成二元组设置与两层Transformer实验,分析全局知识与上下文知识的学习差异,揭示权重矩阵的联想记忆作用与梯度学习机制,深化对Transformer内部原理的理解。

摘要:

基于Transformer的大语言模型已取得巨大的实证成功。然而,随着其部署范围愈发广泛,人们日益需要更好地理解其内部机制,以提升模型的可靠性。这类模型似乎会存储训练数据中的海量知识,还能快速适配上下文或提示中提供的新信息。我们通过构建一个合成实验设置(其中词元由全局二元组分布或上下文特定二元组分布生成),研究Transformer如何平衡这两类知识。通过对简化的两层Transformer的训练过程开展细致的实证分析,我们阐明了全局二元组的快速学习过程,以及用于上下文内二元组的“归纳头”机制的较慢形成过程。我们强调了权重矩阵作为联想记忆的作用,为训练过程中梯度如何推动其学习提供了理论洞见,并研究了数据分布特性的作用。

英文摘要:

Large language models based on transformers have achieved great empirical successes. However, as they are deployed more widely, there is a growing need to better understand their internal mechanisms in order to make them more reliable. These models appear to store vast amounts of knowledge from their training data, and to adapt quickly to new information provided in their context or prompt. We study how transformers balance these two types of knowledge by considering a synthetic setup where tokens are generated from either global or context-specific bigram distributions. By a careful empirical analysis of the training process on a simplified two-layer transformer, we illustrate the fast learning of global bigrams and the slower development of an "induction head" mechanism for the in-context bigrams. We highlight the role of weight matrices as associative memories, provide theoretical insights on how gradients enable their learning during training, and study the role of data-distributional properties.

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

↑