GoalScope reads a coding model’s upcoming operation from internal activity
A new preprint identifies attention heads carrying information about a coding model’s upcoming subtask. GoalScope transfers that activity to another run, which describes the operation in ordinary language. Experiments in Python and C++ also intervene on the representation to test its influence on what the model writes next in controlled multistep tasks.
Artificial Intelligence··Night
Internal activity describes the next operation
GoalScope, a method for reading internal model activity, turns selected attention-head contributions into descriptions of an upcoming operation. In the Goal Encoding in LLMs preprint, the main experiments use Qwen2.5-Coder-32B-Instruct, a coding model with 64 layers. Researchers supply 253 task specifications for operations on lists, strings and integers, with between two and four subtasks apiece. They inspect activity before the next operation begins, rather than inferring its content only from code already written.[1]
Transferred representations change generated code
The method selects 122 heads across layers 28 to 55 and transfers their combined output into another model run. That run receives no original task in its text input. Researchers also move representations between Python and C++ contexts, testing whether the same operation can appear through different tokens. Separate interventions block access to task descriptions or replace internal states with those from another run, which can redirect the next generated operation.[1]
The model repeatedly consults its task
The authors propose that the model repeatedly reads the task specification and compares it with progress visible in context, reconstructing the next subgoal. Tests of sufficient and necessary activity use different head sets, including an intervention that blocks 250 goal heads. The main findings concern controlled code generation; additional natural-language examples explore broader behavior on a smaller scale. Some outcome scoring uses a language-model judge, with checks against people and another model.[1]