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

用于注入ICL衍生任务嵌入的软头部选择

Soft Head Selection for Injecting ICL-Derived Task Embeddings

Department of Intelligence and Information, Seoul National University(首尔大学智能与信息系);Daegu Gyeongbuk Institute of Science and Technology(大邱庆北科学技术院);Samsung Advanced Institute of Technology, Samsung Electronics Co., Ltd(三星电子三星综合技术院)

Jungwon Park, Jimyeong Kim, Changin Choi, Wonjong Rhee

AI总结:

本文提出SITE方法,通过梯度选择任务相关的注意力头部,有效注入任务嵌入,优于现有方法并在多种任务中表现优异,参数使用更少。

摘要:

大型语言模型(LLMs)通常通过参数高效微调(PEFT)或上下文学习(ICL)适应下游任务。最近,ICL驱动的嵌入式适应被提出作为新的任务适应范式,通过少量示例提示从中间激活中提取任务特定嵌入并在推理时注入。尽管其概念吸引人,但该方法在PEFT或ICL上的性能提升不一致,实际应用中经验优势有限。我们提出软头部选择用于ICL衍生任务嵌入(SITE),一种基于梯度的方法,识别任务相关的注意力头部以实现有效的任务嵌入注入。在各种开放生成、推理和自然语言理解任务中,SITE显著优于先前的嵌入式适应方法和少量示例ICL,同时使用比PEFT少得多的可训练参数。在12个从4B到70B参数的LLM上的实验展示了我们方法的通用性,任务内和任务间的激活修补分析进一步通过揭示注意力头部功能中的强任务依赖性提供了新的机理见解。

英文摘要:

Large language models (LLMs) are commonly adapted to downstream tasks using parameter-efficient fine-tuning (PEFT) or in-context learning (ICL). Recently, ICL-driven embedding-based adaptation has been proposed as a distinct task adaptation paradigm. It derives task-specific embeddings from intermediate activations using few-shot prompts and injects them during inference. Despite its conceptual appeal, this approach has not demonstrated consistent performance gains over PEFT or ICL, and its empirical advantages have been limited in practice. We propose Soft head-selection for ICL-derived Task Embeddings (SITE), a gradient-based method that identifies task-relevant attention heads to enable effective task embedding injection. Across various types of open-ended generation, reasoning, and natural language understanding tasks, SITE significantly outperforms prior embedding-based adaptation methods and few-shot ICL, while using substantially fewer trainable parameters than PEFT. Experiments on 12 LLMs ranging from 4B to 70B parameters demonstrate the generality of our approach, and intra-task and inter-task activation patching analyses further provide new mechanistic insights by revealing strong task dependence in attention head functionality.

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

↑