Daily AI Paper

Daily AI Paper

2026-11-14

Archived
2026-11-14

Goal Encoding in LLMs

Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, et al.

arXiv:2611.17297v1

Do large language models have goals in any meaningful internal sense, or do they only produce goal-like behavior from the outside? That is the central question this paper asks. And it matters because we often describe intelligent systems in intentional terms: we say they want, intend, plan, or decide. But for language models, that kind of language can be misleading unless there is some internal representation that actually corresponds to the goal and helps drive action. The authors focus on a more operational definition of a goal. They borrow from planning theory and treat a goal as something that is pre-committed to before action, plastic enough to be realized in different ways depending on the environment, and persistent enough to keep guiding execution over time. That gives them a concrete way to ask whether an LLM is merely producing the right next token, or whether it is carrying an internal sub-goal that shapes what comes next. They study this in a coding setting, because code generation naturally decomposes into multi-step tasks. If the overall job is something like implementing merge sort, then there are intermediate sub-goals: split the array, sort each half, merge the results. Those are useful because they let the researchers ask whether the model has already committed to the next sub-goal before it starts writing it, whether that sub-goal can be transferred across environments like Python and C++, and whether the same internal encoding persists while the model is actually carrying out the step. To make this precise, they build controlled prompts that specify several sub-tasks in sequence. They then look at token positions just before the model begins the next sub-goal. These positions are called pivots. By pre-filling the prompt up to a pivot, they can inspect the model’s internal state at the moment when the next sub-goal should already be selected, but before the implementation begins. That lets them compare what is encoded internally with what the model later does in generated text. The broader technical backdrop here is the transformer architecture. A transformer language model builds each next-token prediction from a residual stream updated by attention heads and MLPs across layers. Attention heads can be especially interesting because they can move information from earlier tokens into the current computation. The paper’s question is whether some attention heads carry a portable representation of the next sub-goal — something abstract enough to outlive a particular syntax choice, but specific enough to determine the next action. The authors first localize what they call goal heads. They do this by constructing source and destination prompts that ask for different predicates on the same data type, but in different programming languages. For example, a source prompt might ask for a palindrome check in C++, while a destination prompt asks for duplicate characters in Python. They then cache internal activations from the source run and learn a sparse mask over attention heads in the destination run. The objective is to find which heads, when transplanted, cause the destination model to begin implementing the source predicate instead of its own. In other words, they are searching for heads whose outputs contain an abstract encoding of the upcoming operation, not just the exact token sequence. After optimization, they binarize the mask and call the selected heads the goal heads. In their main setup, they identify 122 such heads, distributed across layers 28 through 55 in a 64-layer Qwen-2.5-Coder-32B-Instruct model. That detail matters because it suggests the encoding is not isolated in one tiny region of the network, but spread across a sparse set of heads in the upper-middle to upper layers. Once they have these heads, they build a probe they call GoalScope. The idea is simple: take what the selected heads write to the residual stream at the pivot, sum those contributions into one vector, and inject that vector into a separate run of the same model that has been given a generic verbalizer prompt, something like asking what operation is being performed. Since the verbalizer run does not contain the source context, any useful information has to come from the injected activation. The result is a lightweight readout that can turn the internal encoding into a natural-language description of the upcoming sub-goal. They evaluate this in two ways. First is faithfulness: does the readout correctly describe a meaningful part of the model’s upcoming behavior? Because they know the ground-truth sub-goal in their controlled setting, they can compare the verbalization to the actual implementation that follows. Second is causality: if they transplant the same encoding into a different code stub, even in a different programming language, does it trigger a nontrivial part of the source operation there too? That second test is important because it checks plasticity, not just interpretability. The results in this section are striking. The next sub-goal becomes decodable well before the model begins to implement it. In other words, the internal representation shows up at the pivot positions before the generated code reaches the point where the sub-goal is written out. And when they transplant that encoding into another language, it can steer the model toward the same operation, but realized through a different token sequence suited to the new environment. That is exactly the kind of plasticity the authors wanted to test. They also find that the same goal-head encoding can be read out as a natural-language description of the upcoming action. So the internal state is not just predictive of the next token distribution; it can be interpreted as something like “I’m checking whether a word is a palindrome” or another similar sub-goal description. The paper emphasizes that this is not just a probe artifact, because the same encoding has causal effects when transplanted. The next question is persistence. If the model has a goal encoding at the start of a sub-task, does that same encoding remain available while the model executes the sub-task over many generated tokens? Empirically, they find that it does. The goal heads continue to sustain the encoding throughout execution. But this creates a puzzle. A transformer language model has no recurrence in the usual sense. Information can only move forward through layers, and a token position only has a finite number of layers available to influence later positions. So how can a goal encoded at one point keep affecting tokens many steps later? The authors argue that the model may not be carrying the goal forward as a persistent hidden state at all. Instead, they propose a non-recurrent goal-seeking account, or NRGS. Under this view, the model repeatedly re-derives the goal from the task specification in the prompt, re-encodes the current progress from the growing context, and chooses the next action by comparing the two. So the goal is not a single state handed off through time; it is reconstructed at each step from the prompt and the partial solution so far. To test that idea, they use targeted causal interventions. They control what the goal heads read from the task span in the middle of implementing a sub-goal. If they alter that readout, they can redirect the model toward a different sub-goal. Importantly, this works across programming languages, which supports the idea that the encoding is abstract rather than tied to a specific surface form. The same intervention also works consistently across different levels of the goal hierarchy, suggesting the mechanism generalizes beyond one narrow kind of sub-task. What do these experiments actually show? First, they show that in these controlled coding tasks, the model contains a decodable internal representation of the next sub-goal before execution starts. Second, that representation is causally relevant: if you transplant it, you can steer behavior. Third, it is plastic: the same abstract operation can be realized in a different language with different syntax and token sequences. And fourth, the model seems to sustain this encoding during execution, but the authors argue this does not require a recurrent hidden state. A repeated read-from-prompt, compare-with-progress mechanism may be enough. There are also some useful broader implications. The authors note that although they localize goal heads in code generation, their readouts can be informative in non-code settings too, such as verbalizing the implicit rule in a few-shot prompt or the intentions of a misaligned model. That suggests the mechanism may be more general than coding alone. At the same time, there are clear limitations. The study is done in a controlled setting with specific multi-step coding prompts, so we should be careful about overgeneralizing to open-ended real-world tasks. The models they analyze do not robustly show obstacle persistence in the sense of maintaining a goal despite unexpected disruptions. And while the causal interventions are persuasive, they are still tied to the particular architecture, model scale, and task design used here. So the main takeaway is nuanced. The paper does not claim that LLMs have human-like intentions. Instead, it shows that at least in these coding tasks, they can encode something that behaves like a goal in a functional sense: it is present before action, portable across environments, and causally linked to what the model does next. The authors then offer a plausible explanation for how that can happen in a transformer without recurrence: the model may be re-reading and re-deriving the goal as it goes, rather than carrying one uninterrupted internal plan forward.

Previous daily papers

2026-11-28How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent Patches2026-11-27Spectrum Adaptation of AI-Native Autoencoder Communications with Transfer Learning2026-11-26Stranger Things: When Objects Appear Without Their Typical Neighbors2026-11-25OmniAct: One Policy, One Million Embodiments2026-11-24Let Vision-Language Models Generate Images through Their Representations2026-11-24Pruning Autonomous Driving VLAs: What to Preserve for Reasoning and Action2026-11-24Tabular Foundation Models for Weighted Regression and Classification2026-11-23BioEmu2: Scalable Emulation of Biomolecular Dynamics2026-11-23Model Carving: Training Transformers That Optimize Their Own Topology2026-11-23MemOnce: A Scalable Memory Architecture for Large Language Models2026-11-22SoK: Assessing the Evolution of LLM Capability in Software Vulnerability Research2026-11-22Depth Pro 2: Sharp and Temporally Consistent Metric Monocular Depth2026-11-22RL Post-Training in Diffusion Transformers Is Activation Steering2026-11-20FrontierReplay: Split-Free Exact Prefix Caching for Hybrid Language Models2026-11-19Jailbreak Detection on Large Language Models via Contrastive Prototype Structures2026-11-19Auditing black-box clinical prediction models with a large language model through queries alone: a blinded test with planted flaws2026-11-18Spool: Low-Latency Streaming Inference for Hybrid Vision-Language Models2026-11-18Ambient LLMs: Data-Efficient Supervised Fine-tuning via Temperature Matching2026-11-18Know When to Zoom: How Small Is Too Small for Vision-Language Models?2026-11-17ViRA: Toward Ultra-High-Resolution Visual Agents via Cross-Input Relative Policy Optimization2026-11-17Latent Lattice Language Models2026-11-17SWE-CoWork: Benchmarking Coding Agents as Digital Employees in Organizations2026-11-16StreamEmbed: Real-Time Indexing from Pixels for Screenshot Retrieval2026-11-15ArchSpace: Recording, Reviewing, and Referencing LLM Architecture Research2026-11-15Classical Energies Learn to Reason 1,000x Faster than Looped Models2026-11-15Unbundling Multimodal Vision Encoding2026-11-13Dataset Distillation via Drifting2026-11-12AutoScaffold: AI-Guided Scaffolding for Reinforcement Learning of Language Models2026-11-12Contrastive Discovery: Open-Ended Scientific Discovery over Competing Explanations2026-11-12Emergent Biological Capabilities in a Foundation Model for Molecular Interactions2026-11-11Medical Image Segmentation: Foundation Model Adaptation versus Task-Specific Training2026-11-10Mitigating Agentic Deception via Evaluation-Side Partially Observable Games2026-11-09On Agentic Manipulation Policies2026-11-09Can Agentic Systems Close the Gap in Radiology with Production AI Tools?2026-11-09Computer-Use Agents Are Embodied Generalists2026-11-08Failure Prediction and Classification in Vision-Language-Action Models Via Calibrated Latent Probing2026-11-08Scientist World: Grow a Research World for AI-Scientists2026-11-08Understanding AI from the Inside: The State of Mechanistic Interpretability for AI Safety2026-11-06User Embeddings are Superpositions of Interpretable Behavioral Modes2026-11-05FrontierPhysics: Evaluating Agents for End-to-End Physics Research2026-11-05Reinforcement Learning Enables Scaling Generalist Robot Policy Improvement2026-11-05Perceptive Humanoid Motion from Simulation2026-11-04From Autonomous Agents to Cognitive Symbionts: Toward AI-Augmented Human Intelligence2026-11-04DreamX: Video Diffusion Model is a Universal Latent Action Learner2026-11-04PyRUA-DataFarm: LLM Agent as a Cost-Efficient Teleoperator for Real-Ready Robot Data2026-11-03Pixel: A Co-Designed Full-Stack Robot System for Learning General-Purpose Mobile Manipulation2026-11-03Strategist: Evolving Reasoning with Agents2026-11-03DR Pixel: Page-Native Deep Research with Vision-Language Models2026-11-02ACCT: Asymmetric Cross-LLM Context Transfer2026-11-02Latent Reasoning in Continuous Space for Unified Multimodal Models2026-11-02Subquadratic Attention with a Hierarchical Tree-Structured Indexer2026-11-01Testimony from Timelines: Evidence-Grounded Significance Testing of Temporal Clinical Hypotheses2026-11-01ShallowDefend: Harnessing Shallow Safety Alignment for Multi-Turn Defender2026-10-31Difficulty Calibration Across Time for Membership Inference in Diffusion Models2026-10-30world2vec: Mechanistic world models through latent dynamics learning2026-10-30Elucidating the Design Space of LM Data Attribution2026-10-29Pushing Dexterity and Safety for In-Hand Object Pose Reaching That Works Remarkably Well2026-10-29Can LLMs Uncover Hidden Physical Laws through Free Exploration?2026-10-29Scaling Laws for Tool-Use Agents via Controllable Environment Synthesis