Modern large language models (LLMs) excel at tasks that require storing and retrieving knowledge, such as factual recall and question answering. Transformers are central to this capability because they can encode information during training and retrieve it at inference. Existing theoretical analyses typically study transformers under idealized assumptions such as infinite data or orthogonal embeddings. In realistic settings, however, models are trained on finite datasets with non-orthogonal (random) embeddings. We address this gap by analyzing a single-layer transformer with random embeddings trained with (empirical) gradient descent on a simple token-retrieval task, where the model must identify an informative token within a length-$L$ sequence and learn a one-to-one mapping from tokens to labels. Our analysis tracks the ``early phase'' of gradient descent and yields explicit formulas for the model's storage capacity -- revealing a multiplicative dependence between sample size $N$, embedding dimension $d$, and sequence length $L$. We validate these scalings numerically and further complement them with a lower bound for the underlying statistical problem, demonstrating that this multiplicative scaling is intrinsic under non-orthogonal embeddings.


翻译:现代大型语言模型(LLM)在需要存储与检索知识的任务中表现出色,例如事实回忆与问答任务。Transformer架构是实现此能力的核心,因其能够在训练阶段编码信息并在推理阶段进行检索。现有理论分析通常在理想化假设下研究Transformer,例如无限数据或正交嵌入。然而在实际场景中,模型是在有限数据集上通过非正交(随机)嵌入进行训练的。为填补这一研究空白,我们分析了采用随机嵌入的单层Transformer模型在简单令牌检索任务上的(经验)梯度下降训练过程。该任务要求模型从长度为$L$的序列中识别信息性令牌,并学习从令牌到标签的一对一映射关系。我们的分析追踪梯度下降的“早期阶段”,推导出模型存储容量的显式表达式——揭示了样本量$N$、嵌入维度$d$与序列长度$L$之间的乘积依赖关系。我们通过数值实验验证了这些缩放规律,并进一步结合底层统计问题的下界分析,证明这种乘积缩放关系在非正交嵌入条件下具有内在必然性。

0
下载
关闭预览

相关内容

【斯坦福博士论文】为大型语言模型构建交互学习管道
专知会员服务
19+阅读 · 2025年7月12日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
深入理解BERT Transformer ,不仅仅是注意力机制
大数据文摘
22+阅读 · 2019年3月19日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
23+阅读 · 2016年12月31日
国家自然科学基金
40+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2015年12月31日
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月24日
VIP会员
最新内容
DeepSeek 版Claude Code,免费小白安装教程来了!
专知会员服务
0+阅读 · 今天16:16
《美空军条令出版物 2-0:情报(2026版)》
专知会员服务
6+阅读 · 今天13:54
帕兰提尔 Gotham:一个游戏规则改变器
专知会员服务
5+阅读 · 今天13:34
【综述】 机器人学习中的世界模型:全面综述
伊朗的导弹-无人机行动及其对美国威慑的影响
相关基金
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
23+阅读 · 2016年12月31日
国家自然科学基金
40+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2015年12月31日
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员