← All papers  /  Nov 12, 2026
Efficiency

Goal Encoding in LLMs

First page
Goal Encoding in LLMs
The curator’s take

Arnab Sen Sharma, Eric Todd, David Bau and colleagues at Northeastern University find that LLMs encode the next sub-goal in a sparse set of attention heads during coding, and that this encoding is causal and transfers across environments.

Ask this paper

Key points
01

Localization. In a multi-subtask coding setting, the next sub-goal is readable from a small set of goal heads, mostly in layers 40 to 50, with 85.3% faithfulness and 87.3% causality.

02

Decoding. The same heads can be decoded into natural-language descriptions of the next action, such as checking whether a word is a palindrome.

03

Plasticity. Transplanting the encoding into another environment, such as a different programming language, triggers the same operation written with different tokens.

04

NRGS account. The model holds the goal across long actions without recurrence by re-reading the task spec, comparing it with progress in context and pursuing what remains. Causal interventions support this account.

Abstract

We investigate whether and how LLMs encode goals: internal neural representations that precede and guide action, and that are flexible enough to be realized through many different execution paths. We construct a coding setting with multiple sub-tasks that allows us to evaluate goal-seeking behavior and the selection of sub-goals. In this setting, we localize an encoding of the next sub-goal in the outputs of a sparse set of attention heads. The same heads can be used to decode the LM's future actions in natural language (e.g., "I'm checking if a word is a palindrome"). We verify that this encoding is causal for next action and is plastic: transplanting it into a different environment, e.g., another programming language, triggers the same operation realized with a different sequence of tokens. The LM also sustains the encoding throughout the action's execution, which is puzzling because a transformer LM without recurrence cannot carry a state forward for more tokens than it has layers left. We propose that it does not need to. Under a non-recurrent goal-seeking (NRGS) account, the LM frequently re-reads the goal from the task specification, compares it with the progress visible in the growing context, and pursues what remains. We test the predictions of this account with targeted causal interventions.

Every Monday
Get next week’s papers.
Subscribe on Substack