Shared Lexical Task Representations Explain Behavioral Variability In LLMs

📄 arXiv: 2604.22027v1 📥 PDF

作者: Zhuonan Yang, Jacob Xiaochen Li, Francisco Piedrahita Velez, Eric Todd, David Bau, Michael L. Littman, Stephen H. Bach, Ellie Pavlick

分类: cs.CL, cs.AI, cs.LG

发布日期: 2026-04-23


💡 一句话要点

词汇任务表征解释LLM行为变异性

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 提示工程 注意力机制 任务表征 行为变异

📋 核心要点

  1. LLM的提示敏感性导致其性能不稳定,即使是同一任务的不同提问方式也会导致结果差异。
  2. 论文核心思想是,尽管LLM表现出提示敏感性,但不同提示方式激活了共享的词汇任务表征。
  3. 研究表明,LLM的行为变异可由词汇任务头激活程度解释,失败源于竞争性任务表征。

📝 摘要(中文)

大型语言模型(LLM)最常被诟病的问题之一是其提示敏感性,即模型执行任务或提供正确答案的能力会因问题提出的方式而产生不可预测的差异。本文通过比较两种截然不同但常用的提示方式来研究这种变异:一种是基于指令的提示,用自然语言描述任务;另一种是基于示例的提示,提供上下文的少量示例对来演示任务。研究发现,尽管性能随提示的变化很大,但模型在不同任务提示中采用了一些共同的底层机制。具体来说,我们识别出任务特定的注意力头,其输出字面上描述了任务——我们称之为词汇任务头——并表明这些头在不同的提示风格中是共享的,并触发后续的答案生成。我们进一步发现,提示之间的行为变异可以用这些头被激活的程度来解释,并且失败至少有时是由于竞争性任务表征稀释了目标任务的信号。我们的结果共同呈现了一个越来越清晰的图景,即LLM的内部表征如何解释对用户和开发者来说看似特殊的行为。

🔬 方法详解

问题定义:LLM的提示敏感性问题,即模型对同一任务的不同prompt表现出显著的性能差异。现有方法难以解释这种prompt的变异性,使得用户难以预测和控制LLM的行为。

核心思路:论文的核心思路是,尽管LLM对不同的prompt很敏感,但对于同一任务,不同的prompt会激活LLM内部共享的词汇任务表征。通过分析这些共享的表征,可以解释LLM的行为变异性。

技术框架:该研究主要通过以下步骤进行:1) 设计不同类型的prompt(instruction-based和example-based)来执行同一任务。2) 分析LLM内部的注意力机制,识别出与任务相关的注意力头(词汇任务头)。3) 评估这些词汇任务头在不同prompt下的激活程度。4) 分析词汇任务头的激活程度与LLM性能之间的关系。5) 研究竞争性任务表征对LLM性能的影响。

关键创新:论文的关键创新在于发现了LLM内部存在共享的词汇任务表征,这些表征与任务的语义信息直接相关,并且可以解释LLM的prompt敏感性。这为理解LLM的内部工作机制提供了一个新的视角。

关键设计:论文的关键设计包括:1) 精心设计的prompt,涵盖instruction-based和example-based两种类型,以激发LLM的不同行为。2) 使用注意力机制分析方法,识别出与任务相关的注意力头。3) 通过实验验证词汇任务头的激活程度与LLM性能之间的相关性。4) 研究竞争性任务表征对目标任务的影响,揭示了LLM失败的原因。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

研究发现,LLM内部存在共享的词汇任务头,这些头在不同prompt下被激活,并且其激活程度与LLM的性能密切相关。实验表明,通过分析这些词汇任务头,可以解释LLM的prompt敏感性,并预测LLM在不同prompt下的行为。

🎯 应用场景

该研究成果可应用于提升LLM的稳定性和可控性,例如通过调整prompt来激活目标任务的词汇任务表征,从而提高LLM的性能。此外,该研究还可以用于开发新的prompt工程技术,以及更好地理解和解释LLM的行为。

📄 摘要(原文)

One of the most common complaints about large language models (LLMs) is their prompt sensitivity -- that is, the fact that their ability to perform a task or provide a correct answer to a question can depend unpredictably on the way the question is posed. We investigate this variation by comparing two very different but commonly-used styles of prompting: instruction-based prompts, which describe the task in natural language, and example-based prompts, which provide in-context few-shot demonstration pairs to illustrate the task. We find that, despite large variation in performance as a function of the prompt, the model engages some common underlying mechanisms across different prompts of a task. Specifically, we identify task-specific attention heads whose outputs literally describe the task -- which we dub lexical task heads -- and show that these heads are shared across prompting styles and trigger subsequent answer production. We further find that behavioral variation between prompts can be explained by the degree to which these heads are activated, and that failures are at least sometimes due to competing task representations that dilute the signal of the target task. Our results together present an increasingly clear picture of how LLMs' internal representations can explain behavior that otherwise seems idiosyncratic to users and developers.