# Goal Encoding in LLMs

DevFeed: [Goal Encoding in LLMs](<https://devfeed.tech/articles/goal-encoding-in-llms-132329.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.17297>)

Author: Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau

Published: 2026-11-13T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Transformer](<https://devfeed.tech/topics/transformer.md>), [Neural Network](<https://devfeed.tech/topics/neural-network.md>)

Tags: [attention](<https://devfeed.tech/tags/attention.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [coding](<https://devfeed.tech/tags/coding.md>), [context](<https://devfeed.tech/tags/context.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [decode](<https://devfeed.tech/tags/decode.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [environment](<https://devfeed.tech/tags/environment.md>), [execution](<https://devfeed.tech/tags/execution.md>), [flexible](<https://devfeed.tech/tags/flexible.md>), [future](<https://devfeed.tech/tags/future.md>), [goals](<https://devfeed.tech/tags/goals.md>), [guide](<https://devfeed.tech/tags/guide.md>), [language](<https://devfeed.tech/tags/language.md>), [layers](<https://devfeed.tech/tags/layers.md>), [llms](<https://devfeed.tech/tags/llms.md>), [multiple](<https://devfeed.tech/tags/multiple.md>), [natural-language](<https://devfeed.tech/tags/natural-language.md>), [next](<https://devfeed.tech/tags/next.md>), [predictions](<https://devfeed.tech/tags/predictions.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

In a coding setting with multiple subtasks, the study finds that a sparse set of attention heads encodes the model's next subgoal. Those heads also reveal future actions in natural language, and interventions indicate the encoding causally guides the next action. Transferring it to another programming-language environment can trigger the same operation through a different token sequence. The encoding persists during action execution. The authors propose that models sustain it by rereading the task specification and comparing the goal with progress in the growing context, and test this non-recurrent goal-seeking account with targeted causal interventions.

## Source excerpt

arXiv:2611.17297v1 Announce Type: cross 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.