arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.09240cs.LG
收藏

上下文学习中的任务向量:涌现、形成与作用

Task Vectors in In-Context Learning: Emergence, Formation, and Benefit

University of Wisconsin-Madison(威斯康星大学麦迪逊分校);Microsoft Research(微软研究院)

Liu Yang, Ziqian Lin, Kangwook Lee, Dimitris Papailiopoulos, Robert Nowak

AI总结:

本研究针对Transformer上下文学习中任务向量的涌现与功能不明确的问题,通过受控合成数据集实验探究其形成机制,提出基于TVP-loss的辅助训练方法,提升了模型鲁棒性与泛化能力。

摘要:

上下文学习是Transformer模型的一项卓越能力,指其能够依据简短的历史信息或上下文适配特定任务。已有研究发现,任务特定信息会在模型内部进行局部编码,但由于预训练过程不透明,这类信息的涌现机制与功能仍不明确。本研究在受控环境下,使用在合成数据集上从头训练的模型,探究任务向量的形成过程。研究结果证实,任务向量会在特定条件下自然涌现,但任务在模型中的编码强度可能相对较弱,且/或并非以局部方式编码。为了推动强任务向量在模型内指定位置完成编码,我们提出了一种基于任务向量提示损失(TVP-loss)的辅助训练机制。该方法无需在已训练模型中搜索与任务相关的编码,且经证实能提升鲁棒性与泛化能力。

英文摘要:

In-context learning is a remarkable capability of transformers, referring to their ability to adapt to specific tasks based on a short history or context. Previous research has found that task-specific information is locally encoded within models, though their emergence and functionality remain unclear due to opaque pre-training processes. In this work, we investigate the formation of task vectors in a controlled setting, using models trained from scratch on synthetic datasets. Our findings confirm that task vectors naturally emerge under certain conditions, but the tasks may be relatively weakly and/or non-locally encoded within the model. To promote strong task vectors encoded at a prescribed location within the model, we propose an auxiliary training mechanism based on a task vector prompting loss (TVP-loss). This method eliminates the need to search for task-correlated encodings within the trained model and demonstrably improves robustness and generalization.

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

↑