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

揭示上下文学习:一个理解其工作机制的坐标系

Unveiling In-Context Learning: A Coordinate System to Understand Its Working Mechanism

Southwest Jiaotong University(西南交通大学);University College London(伦敦大学学院);National University of Singapore(新加坡国立大学);Digital Twin Institute(数字孪生研究院);Eastern Institute of Technology(宁波工程学院)

Anhao Zhao, Fanghua Ye, Jinlan Fu, Xiaoyu Shen

AI总结:

针对大语言模型上下文学习机制的两种矛盾观点,提出统一的二维坐标系框架,通过感知与认知维度解释其行为,设计指标检测任务识别能力,经多任务实验验证并扩展至生成任务。

摘要:

大语言模型(LLMs)展现出卓越的上下文学习(ICL)能力,但其底层工作机制仍未被充分理解。近期研究对ICL存在两种相互矛盾的观点:一种强调演示中相似示例的影响,认为标签正确性和更多示例数量至关重要;另一种将其归因于LLMs固有的任务识别能力,认为演示的标签正确性和示例数量并不关键。本研究提出一个二维坐标系,将两种观点统一到一个系统框架中。该框架通过两个正交变量解释ICL的行为:演示中是否存在相似示例(感知),以及LLMs能否识别任务(认知)。我们提出峰值逆秩指标来检测LLMs的任务识别能力,并研究LLMs对不同相似度定义的反应。基于这些,我们在多个代表性分类任务上开展了大量实验,阐明ICL在每个象限的运作方式。最后,我们将分析扩展到生成任务,表明该坐标系也能有效解释生成任务中的ICL。

英文摘要:

Large language models (LLMs) exhibit remarkable in-context learning (ICL) capabilities. However, the underlying working mechanism of ICL remains poorly understood. Recent research presents two conflicting views on ICL: One emphasizes the impact of similar examples in the demonstrations, stressing the need for label correctness and more shots. The other attributes it to LLMs' inherent ability of task recognition, deeming label correctness and shot numbers of demonstrations as not crucial. In this work, we provide a Two-Dimensional Coordinate System that unifies both views into a systematic framework. The framework explains the behavior of ICL through two orthogonal variables: whether similar examples are presented in the demonstrations (perception) and whether LLMs can recognize the task (cognition). We propose the peak inverse rank metric to detect the task recognition ability of LLMs and study LLMs' reactions to different definitions of similarity. Based on these, we conduct extensive experiments to elucidate how ICL functions across each quadrant on multiple representative classification tasks. Finally, we extend our analyses to generation tasks, showing that our coordinate system can also be used to interpret ICL for generation tasks effectively.

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

↑