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

上下文学习期间的推理与言语化函数

Inference and Verbalization Functions During In-Context Learning

Stanford University(斯坦福大学);Mila, University of Montreal(蒙特利尔大学米拉实验室)

Junyi Tao, Xiaoyin Chen, Nelson F. Liu

AI总结:

本研究针对大语言模型上下文学习中无关标签对性能影响小的现象,提出推理与言语化双函数假设,通过逐层干预实验验证了推理函数的标签空间不变性,并定位了两个函数在多种开源模型中的对应层。

摘要:

大语言模型(LM)能够在推理阶段从少量示例(样例-标签对)中进行上下文学习(ICL)以解决新任务。尽管高质量示例具有直观的重要性,但已有研究观察到,在某些设置下,ICL性能受无关标签的影响极小(Min等人,2022)。我们假设,大语言模型通过两个连续过程利用无关标签执行ICL:首先是求解任务的推理函数,随后是将推理得到的答案映射到标签空间的言语化函数。关键在于,我们假设推理函数对标签空间的重映射(例如将“true”/“false”映射为“cat”/“dog”)具有不变性,这使得大语言模型能够在使用不同标签词的设置间共享同一推理函数。我们通过受控的逐层交换干预实验对该假设进行了实证验证。我们的发现在多个数据集和任务(自然语言推理、情感分析和主题分类)上证实了上述假设,还进一步表明这两个函数可以定位于多种开源模型的特定层中,这些模型包括GEMMA-7B、MISTRAL-7B-V0.3、GEMMA-2-27B和LLAMA-3.1-70B。

英文摘要:

Large language models (LMs) are capable of in-context learning from a few demonstrations (example-label pairs) to solve new tasks during inference. Despite the intuitive importance of high-quality demonstrations, previous work has observed that, in some settings, ICL performance is minimally affected by irrelevant labels (Min et al., 2022). We hypothesize that LMs perform ICL with irrelevant labels via two sequential processes: an inference function that solves the task, followed by a verbalization function that maps the inferred answer to the label space. Importantly, we hypothesize that the inference function is invariant to remappings of the label space (e.g., "true"/"false" to "cat"/"dog"), enabling LMs to share the same inference function across settings with different label words. We empirically validate this hypothesis with controlled layer-wise interchange intervention experiments. Our findings confirm the hypotheses on multiple datasets and tasks (natural language inference, sentiment analysis, and topic classification) and further suggest that the two functions can be localized in specific layers across various open-sourced models, including GEMMA-7B, MISTRAL-7B-V0.3, GEMMA-2-27B, and LLAMA-3.1-70B.

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

↑