In-context Learning (ICL) is an emerging few-shot learning paradigm based on modern Language Models (LMs), yet its inner mechanism remains unclear. In this paper, we investigate the mechanism through a novel perspective of information removal. Specifically, we demonstrate that in the zero-shot scenario, LMs encode queries into non-selective representations in hidden states containing information for all possible tasks, leading to arbitrary outputs without focusing on the intended task, resulting in near-zero accuracy. Meanwhile, we find that selectively removing specific information from hidden states by a low-rank filter effectively steers LMs toward the intended task. Building on these findings, by measuring the hidden states on carefully designed metrics, we observe that few-shot ICL effectively simulates such task-oriented information removal processes, selectively removing the redundant information from entangled non-selective representations, and improving the output based on the demonstrations, which constitutes a key mechanism underlying ICL. Moreover, we identify essential attention heads inducing the removal operation, termed Denoising Heads, which enables the ablation experiments blocking the information removal operation from the inference, where the ICL accuracy significantly degrades, especially when the correct label is absent from the few-shot demonstrations, confirming both the critical role of the information removal mechanism and denoising heads.


翻译:情境学习(ICL)是一种基于现代语言模型(LM)的新兴少样本学习范式,但其内部机制尚不明确。本文通过信息去除这一新颖视角探究其机制。具体而言,我们证明在零样本场景下,语言模型会将查询编码为隐藏状态中的非选择性表征,该表征包含所有可能任务的信息,导致输出任意且未聚焦于目标任务,从而产生接近零的准确率。同时,我们发现通过低秩滤波器从隐藏状态中有选择地去除特定信息,能有效引导语言模型朝向目标任务。基于这些发现,通过使用精心设计的度量指标对隐藏状态进行测量,我们观察到少样本情境学习有效模拟了此类面向任务的信息去除过程,有选择地从纠缠的非选择性表征中去除冗余信息,并基于示例改进输出,这构成了情境学习的关键底层机制。此外,我们识别出诱导去除操作的关键注意力头,称为去噪头,其支持通过阻断推理过程中的信息去除操作进行消融实验——在该实验中情境学习准确率显著下降,尤其在少样本示例中缺失正确标签的情况下,这同时证实了信息去除机制与去噪头的关键作用。

0
下载
关闭预览

相关内容

【MIT博士论文】语言模型的推理时学习算法
专知会员服务
30+阅读 · 2025年12月24日
【CMU博士论文】语境:表征学习的机制
专知会员服务
19+阅读 · 2025年4月29日
清华最新《解耦表征学习》综述
专知会员服务
71+阅读 · 2023年2月23日
基于模型的强化学习综述
专知
42+阅读 · 2022年7月13日
【论文笔记】基于强化学习的人机对话
专知
20+阅读 · 2019年9月21日
用深度学习揭示数据的因果关系
专知
28+阅读 · 2019年5月18日
Meta-Learning 元学习:学会快速学习
GAN生成式对抗网络
20+阅读 · 2018年12月8日
基于信息理论的机器学习
专知
22+阅读 · 2017年11月23日
【强化学习】强化学习+深度学习=人工智能
产业智能官
55+阅读 · 2017年8月11日
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Arxiv
0+阅读 · 1月26日
VIP会员
相关基金
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员