Spin glass model of in-context learning

Yuhao Li, Ruoran Bai, Haiping Huang
{"title":"Spin glass model of in-context learning","authors":"Yuhao Li, Ruoran Bai, Haiping Huang","doi":"arxiv-2408.02288","DOIUrl":null,"url":null,"abstract":"Large language models show a surprising in-context learning ability -- being\nable to use a prompt to form a prediction for a query, yet without additional\ntraining, in stark contrast to old-fashioned supervised learning. Providing a\nmechanistic interpretation and linking the empirical phenomenon to physics are\nthus challenging and remain unsolved. We study a simple yet expressive\ntransformer with linear attention, and map this structure to a spin glass model\nwith real-valued spins, where the couplings and fields explain the intrinsic\ndisorder in data. The spin glass model explains how the weight parameters\ninteract with each other during pre-training, and most importantly why an\nunseen function can be predicted by providing only a prompt yet without\ntraining. Our theory reveals that for single instance learning, increasing the\ntask diversity leads to the emergence of the in-context learning, by allowing\nthe Boltzmann distribution to converge to a unique correct solution of weight\nparameters. Therefore the pre-trained transformer displays a prediction power\nin a novel prompt setting. The proposed spin glass model thus establishes a\nfoundation to understand the empirical success of large language models.","PeriodicalId":501520,"journal":{"name":"arXiv - PHYS - Statistical Mechanics","volume":"44 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-08-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - PHYS - Statistical Mechanics","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2408.02288","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

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 most importantly why an unseen function can be predicted by providing only a prompt yet without training. Our theory reveals that for single instance learning, increasing the task diversity leads to the emergence of the 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 spin glass model thus establishes a foundation to understand the empirical success of large language models.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
情境学习的旋转玻璃模型
大型语言模型显示出令人惊讶的上下文学习能力--能够使用提示来形成对查询的预测,但不需要额外的训练,这与老式的监督学习形成了鲜明对比。因此,提供一种机制解释并将这一经验现象与物理学联系起来具有挑战性,而且仍未得到解决。我们研究了具有线性注意力的简单而富有表现力的变换器,并将这种结构映射到具有实值自旋的自旋玻璃模型中,其中的耦合和场解释了数据中的内在无序性。自旋玻璃模型解释了在预训练过程中权重参数是如何相互影响的,最重要的是,它解释了为什么只需提供提示而无需训练就能预测未知函数。我们的理论揭示了在单实例学习中,任务多样性的增加会使波尔兹曼分布收敛到权重参数的唯一正确解,从而导致情境学习的出现。因此,预训练的变压器在新的提示设置中显示出了预测能力。因此,所提出的自旋玻璃模型为理解大型语言模型的成功经验奠定了基础。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Mirages in the Energy Landscape of Soft Sphere Packings Shock propagation in a driven hard sphere gas: molecular dynamics simulations and hydrodynamics Thermal transport in long-range interacting harmonic chains perturbed by long-range conservative noise Not-so-glass-like Caging and Fluctuations of an Active Matter Model Graph Neural Network-State Predictive Information Bottleneck (GNN-SPIB) approach for learning molecular thermodynamics and kinetics
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1