
Read the paper
Goal Encoding in LLMs
on Project Page
You know that person who cooks a complex recipe not by memorizing all the steps but by glancing back at the cookbook every thirty seconds? They check what's done, look at what's next, and execute one step at a time. That's what this paper says large language models are doing when they write code — and the researchers found the exact neural circuitry responsible. The core claim: LLMs encode sub-goals — discrete, human-readable intentions like 'I'm checking if a word is a palindrome' — in the outputs of a sparse set of attention heads, and these encodings causally drive the model's next actions. This isn't a behavioral observation from prompting tricks. The authors localize specific attention heads, decode their activations into natural language descriptions of upcoming sub-goals, and verify causality through interventions. When you transplant a goal encoding from one programming language context into another, the model executes the same operation using the target language's syntax. That's a strong plasticity result — the goal representation is abstract enough to survive environment changes. The most interesting puzzle the paper addresses: how does a transformer, which has no recurrence, sustain a goal over many tokens of execution when it has fewer layers remaining than tokens to generate? The authors' answer, the Non-Recurrent Goal-Seeking (NRGS) account, is elegantly simple. The model doesn't carry forward an internal state. Instead, it re-reads the original task specification from the context, compares it against the visible progress in the growing output, and re-derives what to do next. Every forward pass is a fresh goal-retrieval, not a state-propagation. They test this with targeted causal interventions — modifying the context to make the progress-so-far look different and observing whether the model shifts its sub-goal accordingly. The experimental setup is well-constructed. The authors use a coding task with multiple sub-tasks, which gives them ground-truth decomposition of what the model 'should' be doing at each step. This avoids the usual interpretability trap of projecting human narratives onto activations without a clear behavioral target. The coding domain also provides natural cross-environment tests (same algorithm, different programming language) that would be hard to construct in freeform text generation. Where does this sit in the broader interpretability landscape? The lineage runs through circuit-level mechanistic interpretability (Elhage et al., Conmy et al.) and the emerging sub-field of goal/planning representations in transformers. The key tension in this field is whether LLMs do anything resembling planning or whether their apparent planning is an artifact of pattern completion over training distributions. This paper lands firmly on the 'there are internal goal representations, but they work differently than you'd expect' side. The NRGS account is a genuine contribution — it resolves the recurrence puzzle without invoking hidden state and makes testable predictions. The integrity profile is solid for an interpretability paper. Causal interventions (activation patching, transplantation across languages) are the gold standard for this kind of claim. The main limitation is scope: the experiments are in coding tasks, and the generalization to open-ended natural language generation is undemonstrated. The authors also don't benchmark against competing accounts of goal-like behavior in transformers with quantitative comparisons — the paper is more 'here's a mechanism we found and verified' than 'here's why our account beats the alternatives on metric X.' The practical upshot is significant for anyone building agentic systems. If LLMs sustain goals by re-reading rather than by internal state propagation, then context window management and prompt structure matter even more than you thought — the model's ability to 'plan' degrades with context pollution in ways that internal-state models wouldn't. The sparse attention head localization also opens a path toward goal-level steering: if you know which heads encode sub-goals, you can intervene on them directly rather than through prompt engineering.
The analogy
Think of the person who cooks a complex recipe by glancing at the cookbook every thirty seconds rather than memorizing the steps. They check what's done on the counter, look at the recipe, and execute the next step. LLMs do the same — re-reading the prompt, comparing against visible progress, and re-deriving the next sub-goal fresh each time. No memorized plan, just continuous reference-checking.
Cookbook cook
Glances at recipe, checks what's done on the counter, executes next step — no memorization of full plan
NRGS model
Re-reads task spec from context, compares against visible output progress, re-derives next sub-goal each forward pass
Honest assessment
A strong mechanistic interpretability result that finds and causally verifies goal-encoding attention heads in LLMs, with the NRGS account providing a clean explanation for how transformers sustain goals without recurrence. The scope is narrow (coding only), and there's no quantitative ladder to climb — this is a 'new phenomenon discovered' paper, not a 'beat the benchmark' paper. Most valuable to researchers building agentic systems and anyone who needs to understand what's actually happening inside an LLM when it appears to plan.
What Is CLAIMS?
63
/ 100
BedrockNews applies a structured analytical framework called CLAIMS to academic papers and technical research releases.
How CLAIMS worksClaim
4/5
Ladder
2/5
Architecture
4/5
Integrity
4/5
Milestone
2/5
Successor
3/5
What is this paper actually committing to?
Genuine mechanistic first: localizing goal-encoding attention heads with causal verification and the NRGS account of goal-sustaining without recurrence. Not a benchmark paper — a mechanism paper with testable predictions.
The field fight
Do LLMs do genuine planning with internal goal representations, or is apparent planning an artifact of next-token pattern completion?
Side A
LLMs are sophisticated pattern-matchers; planning-like behavior emerges from training distributions without internal goal states
Held by: Skeptics of LLM cognition, Marcus, Mitchell
Side B
LLMs develop internal representations that function as goals and guide multi-step action, even if the mechanism differs from human planning
Held by: Mechanistic interpretability community, Bau lab, this paper
Milestone tracker
Unlocks: Goal-level steering for agentic LLM systems and principled context-window management
Current
1
domain (coding)
this paper
Next
3+
domains
open-ended NL generalization
~1-2 years; requires solving sub-goal labeling for non-structured domains
Verified Facts (7)
Authors localize an encoding of the next sub-goal in the outputs of a sparse set of attention heads
The same heads can decode the LM's future actions in natural language (e.g., 'I'm checking if a word is a palindrome')
Encoding is causal for next action and is plastic: transplanting it into a different environment (another programming language) triggers the same operation realized with different tokens
The LM sustains the encoding throughout the action's execution
Under the NRGS account, the LM re-reads the goal from the task specification, compares it with the progress visible in the growing context, and pursues what remains
Project page, code and data: https://goals.baulab.info/
Authors: Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau
Practical Implications (4)
Context window hygiene matters more than assumed: if LLMs sustain goals by re-reading the prompt, context pollution directly degrades planning ability — design agentic prompts accordingly
Goal-level steering may be possible by intervening on the identified sparse attention heads, potentially offering finer control than prompt engineering for multi-step agent tasks
The NRGS account suggests that chain-of-thought prompting works partly because it creates visible progress for the model to compare against the task spec during re-reading
Debugging agentic LLM failures: if the model loses track of a sub-goal, check whether the relevant context is still accessible and unambiguous in the attention window
More latest news
Read all