研究发现ICL在分布外任务上泛化能力有限,主要依赖预训练函数。
Can In-context Learning Really Generalize to Out-of-distribution Tasks?
- 通过合成数学任务验证ICL机制,发现其本质是优化预训练假设空间
- 在无分布偏移时可学新标签,但分布外任务性能显著下降
- 揭示了ICL的低测试误差偏好现象,解释其泛化局限性
本文研究了上下文学习(ICL)在训练中未遇到的分布外(OOD)任务上的泛化机制。通过使用GPT-2模型在合成数学函数上进行实验,发现Transformer在通过ICL学习分布外任务函数时存在困难。ICL表现类似于在预训练假设空间中执行函数,并基于上下文示例进行梯度下降优化。此外,我们验证了ICL在无分布偏移场景下学习新抽象标签的能力,但该能力在存在分布变化时失效,因此不能作为新任务学习的证据。进一步分析表明,当模型在多任务上预训练时,ICL表现出‘低测试误差偏好’——倾向于实现预训练中测试误差较低的函数。这一理论与实证结果共同揭示了ICL在处理分布外任务时的内在机制。
原文摘要 · Abstract (English)
In this work, we explore the mechanism of in-context learning (ICL) on out-of-distribution (OOD) tasks that were not encountered during training. To achieve this, we conduct synthetic experiments where the objective is to learn OOD mathematical functions through ICL using a GPT-2 model. We reveal that Transformers may struggle to learn OOD task functions through ICL. Specifically, ICL performance resembles implementing a function within the pretraining hypothesis space and optimizing it with gradient descent based on the in-context examples. Additionally, we investigate ICL's well-documented ability to learn unseen abstract labels in context. We demonstrate that such ability only manifests in the scenarios without distributional shifts and, therefore, may not serve as evidence of new-task-learning ability. Furthermore, we assess ICL's performance on OOD tasks when the model is pretrained on multiple tasks. Both empirical and theoretical analyses demonstrate the existence of the \textbf{low-test-error preference} of ICL, where it tends to implement the pretraining function that yields low test error in the testing context. We validate this through numerical experiments. This new theoretical result, combined with our empirical findings, elucidates the mechanism of ICL in addressing OOD tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。