arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.02288cond-mat.dis-nncond-mat.stat-mechcs.AIcs.CL
收藏

上下文内学习的自旋玻璃模型

Spin glass model of in-context learning

PMI Lab, School of Physics, Sun Yat-sen University(物理系实验室、中山大学);Guangdong Provincial Key Laboratory of Magnetoelectric Physics and Devices(磁电物理与器件广东省重点实验室);Sun Yat-sen University(中山大学)

Yuhao Li, Ruoran Bai, Haiping Huang

AI总结:

该研究将线性注意力 transformer 映射为实值自旋玻璃模型,解释预训练权重交互及提示驱动的上下文内学习机制,并指出任务多样性促使 Boltzmann 分布收敛到唯一正确解。

摘要:

大型语言模型展现出令人惊讶的上下文内学习能力——能够利用提示为查询形成预测,而无需额外训练,这与传统的监督学习形成鲜明对比。因此,提供一种机制性解释并将这一经验现象与物理学联系起来颇具挑战,且尚未解决。我们研究了一个简单但表达能力强的线性注意力 transformer,并将这一结构映射为具有实值自旋的自旋玻璃模型,其中耦合和场解释了数据中的内在无序。该自旋玻璃模型解释了预训练期间权重参数如何相互作用,并进一步阐明了为什么仅提供提示而无需进一步训练就能预测一个未见过的函数。我们的理论揭示,对于单实例学习,增加任务多样性会促使上下文内学习涌现,因为这使 Boltzmann 分布能够收敛到权重参数的唯一正确解。因此,预训练 transformer 在新颖提示设置中表现出预测能力。所提出的解析可处理模型因而为思考如何解释大型语言模型许多有趣但令人困惑的性质提供了一条有前景的途径。

英文摘要:

Large language models show a surprising in-context learning ability -- being able to use a prompt to form a prediction for a query, yet without additional training, in stark contrast to old-fashioned supervised learning. Providing a mechanistic interpretation and linking the empirical phenomenon to physics are thus challenging and remain unsolved. We study a simple yet expressive transformer with linear attention and map this structure to a spin glass model with real-valued spins, where the couplings and fields explain the intrinsic disorder in data. The spin glass model explains how the weight parameters interact with each other during pre-training, and further clarifies why an unseen function can be predicted by providing only a prompt yet without further training. Our theory reveals that for single-instance learning, increasing the task diversity leads to the emergence of in-context learning, by allowing the Boltzmann distribution to converge to a unique correct solution of weight parameters. Therefore the pre-trained transformer displays a prediction power in a novel prompt setting. The proposed analytically tractable model thus offers a promising avenue for thinking about how to interpret many intriguing but puzzling properties of large language models.

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

↑