Shared Lexical Task Representations Explain Behavioral Variability In LLMs

Zhuonan Yang, Jacob Xiaochen Li, Francisco Piedrahita Velez, Eric Todd, David Bau +3 more
4/23/2026
cs.CLcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yang2026shared,
  title  = {Shared Lexical Task Representations Explain Behavioral Variability In LLMs},
  author = {Zhuonan Yang and Jacob Xiaochen Li and Francisco Piedrahita Velez and Eric Todd and David Bau and Michael L. Littman and Stephen H. Bach and Ellie Pavlick},
  year   = {2026},
  eprint = {2604.22027},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.22027v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.22027.svg)](https://codeofpaper.com/paper/2604.22027)

Discussion