arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.25858cs.LGcs.AI
收藏

对Transformer在上下文学习能力的调查

Investigation into In-Context Learning Capabilities of Transformers

Rushil Chandrupatla, Leo Bangayan, Sebastian Leng

AI总结:

本文通过系统实验研究了Gaussian-mixture二分类任务中的上下文学习,分析了输入维度、上下文示例数量和预训练任务数量对上下文测试准确率的影响,并探讨了良性过拟合现象。

摘要:

Transformer在上下文学习(ICL)中展现出强大的能力,使模型能够仅通过推理时提供的输入输出对解决之前未见过的任务。尽管先前的理论工作已经确立了在上下文内进行线性分类的条件,但指导这一机制何时成功的经验性扩展行为仍不够明确。本文对Gaussian-mixture二分类任务的上下文学习进行了系统性的实证研究。基于Frei和Vardi(2024)的理论框架,我们分析了上下文测试准确率如何依赖于三个基本因素:输入维度、上下文示例数量以及预训练任务数量。通过受控的合成设置和线性上下文分类器公式,我们隔离了模型在仅凭上下文自身推断任务结构时成功的几何条件。我们还研究了良性过拟合现象的出现,其中模型记忆了嘈杂的上下文标签,同时在干净的测试数据上仍能保持良好的泛化性能。通过在维度性、序列长度、任务多样性以及信噪比范围内进行广泛的扫描,我们识别了这种现象出现的参数区域,并描述了其如何依赖于数据几何和训练暴露。我们的结果为上下文分类的扩展行为提供了全面的经验图谱,突显了维度性、信号强度和上下文信息在决定上下文学习何时成功、何时失败中的关键作用。

英文摘要:

Transformers have demonstrated a strong ability for in-context learning (ICL), enabling models to solve previously unseen tasks using only example input output pairs provided at inference time. While prior theoretical work has established conditions under which transformers can perform linear classification in-context, the empirical scaling behavior governing when this mechanism succeeds remains insufficiently characterized. In this paper, we conduct a systematic empirical study of in-context learning for Gaussian-mixture binary classification tasks. Building on the theoretical framework of Frei and Vardi (2024), we analyze how in-context test accuracy depends on three fundamental factors: the input dimension, the number of in-context examples, and the number of pre-training tasks. Using a controlled synthetic setup and a linear in-context classifier formulation, we isolate the geometric conditions under which models successfully infer task structure from context alone. We additionally investigate the emergence of benign overfitting, where models memorize noisy in-context labels while still achieving strong generalization performance on clean test data. Through extensive sweeps across dimensionality, sequence length, task diversity, and signal-to-noise regimes, we identify the parameter regions in which this phenomenon arises and characterize how it depends on data geometry and training exposure. Our results provide a comprehensive empirical map of scaling behavior in in-context classification, highlighting the critical role of dimensionality, signal strength, and contextual information in determining when in-context learning succeeds and when it fails.

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

↑