논문 해설
Goal Encoding in LLMs
LLM에서의 목표 인코딩
- 연구 문제 LLM이 코드 생성 중 다음 하위 목표를 행동 전에 내부 표현으로 가지는지 확인하기 어렵습니다.
- 연구 방법 Qwen-2.5-Coder-32B-Instruct의 어텐션 헤드 122개를 목표 헤드로 찾고, 이 출력을 주입해 다음 하위 목표를 자연어로 읽는 GOALSCOPE를 씁니다.
목표를 행동 전에 가지는가
대규모 언어 모델이 목표를 가지는지는 행동을 설명하는 방식과 내부 표현을 구분해야 하는 질문입니다. 이 논문은 여러 하위 과제를 가진 코드 생성을 통제된 환경으로 삼아, 다음 하위 목표가 구현이 시작되기 전에 내부에 읽히는지, 다른 언어로 옮겨도 같은 동작을 촉발하는지, 실행 중에도 유지되는지를 확인합니다. 저자들은 이 세 기준을 Bratman의 계획 이론에서 가져왔습니다.

Figure 1 :Goal pursuit and its non-recurrent implementation in a transformer LM.A goal such as implementing merge sort (G) decomposes into sub-goals g1, g2, g3, each realized as a sequence of tokens (left). (i) An idealized agent commits to a sub-goal gk, keeps it active while pursuing it, and moves on once it is done. (ii) A transformer LM cannot persist a state across long sequence of tokens without running out of layers.(a)The intent to pursue gk =“divide into two halves”is nonethelesspre-committed: it is already readable at the indent token, multiple tokens before its implementation.(b)Because this commitment cannot be carried forward, the LM compensates with frequent re-computation: the LM frequently re-encodes the current sub-goal gk by reading the task span, and the progress-so-far eprog from the growing context tape, and compares the two to produce the next token (thesub-sub-goal). Different levels of goal hierarchy are maintained in the same way. (c)Once the sub-goalg k is complete, the LM moves on to the next sub-goalg k+1.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 2쪽에서 그림 영역을 추출했습니다.목표 헤드와 GOALSCOPE 판독
연구진은 Qwen-2.5-Coder-32B-Instruct에서 원천 실행의 어텐션 헤드 출력을 목적지 실행에 옮기고, 희소 마스크를 학습해 원천 과제를 목적지 언어에서 촉발하는 헤드를 찾았습니다. 주 설정에서 선택된 122개 헤드를 목표 헤드라고 부릅니다. GOALSCOPE는 이 헤드들이 쓴 출력을 하나의 벡터로 합쳐 별도 실행에 주입하고, 다음 하위 목표를 자연어로 설명하게 하는 프로브입니다. 이 방식은 PATCHSCOPE에 기반을 둡니다.

Figure 5 :Goal heads frequently re-read the goal from the task span.The source prompt (i) and the destination prompts (ii) have different tasks, but they share a common initial sub-tasks which can be prefilled in until the eq pivot. In the patched run, at the pivot (and onwards), the goal heads read from the KV-states of the
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.
Figure 12 :Comparison of readout sources.We compare the readout quality of the encoding captured with the goal-heads vs full attention outputs and residual states. Across different encoding sources, we use the same hparams: additive_norm steering with α= 0.1 , at layers 35–45. Each bar shows the average readout score over the four pre-implementation pivots, across the same 253 specifications (out of total 1012 points). Goal heads consistently give better readout performance compared to the larger representations.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 25쪽에서 그림 영역을 추출했습니다.
Figure 13 :GoalScope readout vs. head budget.Faithfulness (solid) and causality (dashed) readout success rate (y-axis) vs the number of goal heads (x-axis). The scores are averaged over the four pre-implementation pivots (additive_norm steering with α= 0.1 ). The core configuration with 122 heads is marked with star. Even 25 heads can give effective readout, and adding heads beyond ∼100 does not monotonically improve performance.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 25쪽에서 그림 영역을 추출했습니다.목표 헤드 접근의 충분성과 필요성
충분성 실험에서는 레이어 20 이상의 다른 어텐션 헤드가 과제 구간을 보지 못하게 막고, 목표 헤드만 접근을 유지하게 했습니다. 이때 122개 헤드 설정의 성공률은 0.806으로, clean 실행의 0.925에 가깝게 유지되었습니다. 저자들은 122개 헤드가 다른 경로로 보완될 수 있다고 해석합니다.

Figure 4 :Goal heads mediate implementa- tion.“Sufficiency” ablation preserves the selected heads’ access to the description of the next sub- goal and blinds all the other attention heads in layers 20–63. “Necessity” ablation blinds only the selected heads by sinking their attention to the first token, while other heads operate as usual. Bars show LM’s success rate of implementing the next sub-goal with the ablation. Only 122 goal heads can sustain LM performance, but it drops sharply when 250 goal heads are blinded.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.
Table 4 : We perform the intervention from Figure 20 at every generation positions and check if the LM can still implement the next sub-goal with this impairment. We see that even with just 122 heads the LM’s ability to implement the target sub-goal is largely preserved (0.806 vs the 0.925 in clean run). When a broader set of 250 goal heads can see the full context, the LM performance nearly matches the clean run performance.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 30쪽에서 그림 영역을 추출했습니다.
Table 5 :Qualitative examples with the sufficiency ablation.For each condition we prefilled the implementation up to the eq pivot (...b =). Then, we greedy-decode the LM’s generation under three settings.Baseline: no ablation.Spare goal: only the goal heads keep access to the task span (all other heads in layers ≥20 are blinded).Spare control: a matched number of random heads from later-half layers are spared instead. ✓/✗ mark whether an oracle judges the LM generation to be a successful implementation of the target sub-goal gk (markedboldin the spec). Results for 122 goal head set is shown on top. The single failure case (total_vowels) gets recovered when a broader set of 250 goal heads are spared.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 31쪽에서 그림 영역을 추출했습니다.다른 언어로 옮긴 인코딩의 촉발
사전 약속과 가소성은 피벗 위치에서 읽은 인코딩을 C++ 맥락에 옮겨 확인했습니다. 이 인코딩은 indent 위치 이후에 C++에서 같은 연산을 96%의 경우 촉발했고, indent 기준 평균 성공률은 약 87%였습니다. 저자들은 이 인코딩이 무엇을 할지는 정하지만 어떻게 할지는 정하지 않는다고 해석합니다.
KV 전달과 질의 전달의 결과
250개 목표 헤드가 피벗 이후 원천 실행의 과제 구간 KV 상태를 읽도록 바꾸면, 목적지 실행은 원천의 다음 하위 목표로 약 94%의 causal-shift를 보였습니다. 이 효과는 여러 데이터 유형과 언어 방향에 걸쳐 나타났습니다. 반면 질의 상태를 옮기는 실험에서는 NRGS가 예측한 대상 과제가 약 57%의 사례에서 선택되었고, 같은 전달을 무작위 후반부 헤드에 적용하면 약 3%에 그쳤습니다. 저자들은 질의 전달이 메커니즘의 전체를 설명하지 못한다고 밝힙니다.

Figure 6 :The progress encoding carried in goal head query dictates the selection of next operation.In the destination run with prompt (pdst : abd→b ), where the first sub-task a is prefilled, the LM picks up the next sub-task in the sequence b. When the query states of the goal heads at the pivot token are replaced with corresponding states from a source run (psrc : acb →c ), it transfers the source progress. This transfer causes the LM to selectd, the first task in destination task-list ({a,b,d}) which hasn’t been completed in source{a,b}.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.
Table 7 : Full breakdown of KV transfer intervention, across datatypes and cross-language transfer. Results reported in the format “{causal-shift} / {readout-shift}”.n= 32per cell.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 33쪽에서 그림 영역을 추출했습니다.
Figure 22 : Results when 250 goal heads read from the source task span key-value states, at pivot and every generated token after. Grouped bars show causal-shift (solid) and readout-shift (striped), broken down by language direction (left; mean over four datatypes) and by datatype (right; mean over four language directions). Full grid in Table 7.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 34쪽에서 그림 영역을 추출했습니다.
Figure 25 :Query transfer setup for multi-token generation.(i) From the source run (here with prompt psrc : acb →c ), we cache the query states of the goal heads at the pivot. (ii) In the clean run with the destination prompt pdst : abd→b , the goal heads concentrate their attention (gaze) on the next sub-goal’s description in the task span. The bar-plot on the right shows the mean value-weighted attention score over the tokens of a task-span. (iii) At the eq pivot, transferring the query states from the source run transfers the source progress (a and b are done), redirecting the goal heads to change their gaze tod’s description, and the readout at pivot also changes accordingly. (iv) For multi-token generation we restrict the goal heads’ attention to the task-span that received most gaze after the query transfer. The non-goal attention heads see the full context as usual.
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 37쪽에서 그림 영역을 추출했습니다.
Figure 26 : Query transfer (250 heads, α= 2 ): causal- and readout-shift. Top row shows the order- matched scores, bottom row order-diff scores. Left column by language direction and right column by datatype. Grouped bars for causal-shift (solid) and readout-shift (striped).
원문 · CC BY 4.0 · Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau · Goal Encoding in LLMs · 원문 그림 인용 · 원본 PDF 38쪽에서 그림 영역을 추출했습니다.논문 정보
- 저자
- Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2026년 11월 12일
- 등록일
- 2026년 11월 14일
- 수정일
- 2026년 11월 12일
- 버전
- v1
- arXiv
- 2611.17297
- 분류
- cs.CL · cs.AI · cs.LG
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
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.
원문 인용
Arnab Sen Sharma, Eric Todd, Sheridan Feucht, Andy Arditi, Rohit Gandikota, Natalie Shapira, Gabriele Sarti, Constanza Fierro, Lisa Schut, David Bau (2026). Goal Encoding in LLMs. arXiv:2611.17297v1. https://arxiv.org/abs/2611.17297v1
BibTeX
@misc{sharma2026goal,
title = {{Goal Encoding in LLMs}},
author = {Arnab Sen Sharma and Eric Todd and Sheridan Feucht and Andy Arditi and Rohit Gandikota and Natalie Shapira and Gabriele Sarti and Constanza Fierro and Lisa Schut and David Bau},
year = {2026},
eprint = {2611.17297},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.17297v1}
}