In-context learning (ICL) has become an effective solution for few-shot learning in natural language processing. However, our understanding of ICL's working mechanisms is limited, specifically regarding how models learn to perform tasks from ICL demonstrations. For example, unexpectedly large changes in performance can arise from small changes in the prompt, leaving prompt design a largely empirical endeavour. In this paper, we investigate this problem by identifying and analyzing task-encoding tokens on whose representations the task performance depends. Using experiments that ablate the representations of different token types, we find that template and stopword tokens are the most prone to be task-encoding. In addition, we demonstrate experimentally that lexical meaning, repetition, and text formatting are the main distinguishing characteristics of these tokens. Our work sheds light on how large language models (LLMs) learn to perform a task from demonstrations, deepens our understanding of the varied roles different types of tokens play in LLMs, and provides insights for avoiding instability from improperly utilizing task-encoding tokens.
翻译:上下文学习(ICL)已成为自然语言处理中少样本学习的有效解决方案。然而,我们对ICL工作机制的理解仍有限,尤其不清楚模型如何从ICL示范中学习执行任务。例如,提示中的微小变化可能导致性能出现意外的大幅波动,这使得提示设计在很大程度上仍依赖经验性探索。本文通过识别并分析任务性能依赖其表征的任务编码标记来研究该问题。通过消融不同标记类型表征的实验,我们发现模板标记和停用词最易成为任务编码标记。此外,我们通过实验证明词汇意义、重复和文本格式是这些标记的主要区分特征。本研究揭示了大型语言模型(LLM)如何从示范中学习执行任务,加深了我们对不同类型标记在LLM中扮演多重角色的理解,并为避免因不当使用任务编码标记而导致的不稳定性提供了启示。