논문 해설
How Do Small Coding Agents Use Code Graphs and Embeddings?
소형 코딩 에이전트는 코드 그래프와 임베딩을 어떻게 사용하는가?
- 연구 문제 소형 코딩 에이전트가 이슈에서 수정 위치를 찾을 때, 코드 그래프상 거리(hop 깊이)와 임베딩·그래프 도구가 얼마나 도움이 되는지를 SWE-bench Verified에서 측정합니다.
- 연구 방법 과제마다 코드 그래프 hop 깊이를 결정적으로 라벨링하고, grep·임베딩 검색·그래프 도구의 네 가지 도구 집합을 같은 과제에서 비교하며, 모델 활성화에서 within-anchor 선형 프로브로 호출 관계를 측정합니다.
- 주요 결과 깊이는 국소화 성공의 강한 예측자이며, 소형 모델에서 구조 도구의 이득은 주로 hop 0과 hop 1에 집중됩니다. 직접 호출 관계는 선형으로 디코딩되지만 어휘 기준선보다 약하고 2홉 관계는 거의 보이지 않습니다.
코드 에이전트는 저장소 구조가 필요한가
코딩 에이전트는 이슈를 해결하기 위해 먼저 수정해야 할 코드를 찾아야 합니다. 최근 에이전트에는 임베딩 검색과 정적 코드 그래프 질의 도구가 함께 제공되는데, 이 도구들은 저장소 구조를 모델이 모르고 도구가 제공한다는 전제에서 출발합니다. 이 논문은 그 전제를 소형 오픈 웨이트 모델로 검증합니다. 핵심 질문은 이슈가 언급한 코드에서 골드 패치가 수정한 코드까지의 코드 그래프상 hop 깊이가 국소화 성공을 예측하는지, 그리고 grep, 임베딩 검색, 그래프 도구가 각각 어떤 기여를 하는지입니다.
hop 깊이 라벨과 코드 그래프
각 SWE-bench Verified 과제에서 base commit의 .py 파일을 Python ast 모듈로 파싱하여 파일, 클래스, 함수를 노드로 하고 포함, 임포트, 호출, 상속을 간선으로 하는 무방향 그래프를 만듭니다. 골드 패치의 수정 줄을 포함하는 가장 안쪽 정의들이 타깃 집합이 되고, 이슈 텍스트에서 정규식으로 추출한 언급 집합과의 최단 경로 길이가 hop 깊이로 정의됩니다. 깊이는 이슈와 골드 패치로 계산되므로 평가 대상 시스템에 보여 주지 않으며, 과제의 속성이지 에이전트의 경로가 아닙니다. 이 라벨은 186/128/78/76개 과제가 hop 0/1/2/3+에 배정되었습니다.

Figure 1 : Hop depth on SWE-bench Verified.(a) Default label (all four edge types). (b) The same 469 tasks with a mention and a target, re-labelled with containment edges only and with containment plus one other edge type; grey segments are tasks whose mentions are disconnected from the targets under that edge set. Calls are the edge type that connects most tasks; imports and inheritance alone leave 12 and 64 tasks unreachable respectively.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.
Table 11 : Hop-depth buckets by repository(default label, all 500 SWE-bench Verified tasks).
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 27쪽에서 그림 영역을 추출했습니다.깊이가 국소화 실패를 예측하는지
깊이의 효과는 GEE 로지스틱 모델로 확인했습니다. 에피소드 성공 여부를 hop과 도구 집합, 저장소, 골드 함수 수, 패치 줄 수에 대해 적합하고, 같은 과제의 반복 실행이 독립적이지 않도록 과제 단위로 군집화합니다. 저자들은 기본 라벨과 통제 변수를 포함한 모델에서 Qwen3-4B, Qwen3-8B, Gemma 4 E4B, Qwen3-32B의 홉당 오즈비가 각각 0.472, 0.468, 0.544, 0.552로 보고합니다. 측정 선택의 영향은 호출 해석을 바꾸면 거의 움직이지 않았으나 언급 추출을 엄격하게 하면 많은 과제가 언급을 잃었습니다.

Table 1 : DEPTHGEE / LABELVAR: odds ratio per additional hopfor function Acc@10, from the GEE model of Eq. (3), for the default label and three measurement variants. “plain” includes only hop and arm; “controls” adds repository, number of gold functions and log patch size. Qwen3-4B and Gemma 4 E4B pool three runs (temperature 0 and two seeds at 0.7) on the 160-task subset; Qwen3-8B uses one temperature-0 run on the subset; Qwen3-32B uses one temperature-0 run on all 500 tasks (457 bucketed tasks with function-level gold); the “(500)” rows refit the Qwen3-4B and Qwen3-8B greedy runs on the same 500 tasks (Section 5.3). nep is the number of episodes,n task the number of tasks.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.도구 절제 실험의 설계
국소화 전용 에이전트는 이슈를 읽고 최대 10개의 위치를 submit으로 제출합니다. 네 가지 도구 집합 G, E, T, ET를 비교하는데, G는 grep과 read_file, list_dir이고 E는 G에 임베딩 검색을 더하며 T는 G에 find_entity와 graph_neighbors를 더합니다. 임베딩 검색은 Qwen3-Embedding-0.6B로 함수와 클래스 텍스트를 조회하고, 그래프 도구는 이름으로 엔티티를 찾고 한두 홉 확장한 간선을 출력합니다. 이 실험은 깊이 균형 160개 과제 부분집합에서 도구 집합만 바꾸도록 설계되었습니다.
도구가 정확도에 주는 차이
Qwen3-8B에서 grep만 쓰면 function Acc@10이 12.8%이고 구조화 도구를 더하면 23.7%에서 29.5% 사이로 올라갑니다. Qwen3-4B에서는 임베딩 도구가 grep 대비 −1.1점으로 효과가 없었지만 그래프 도구는 +8.1점이었습니다. 그래프 도구의 이득은 hop 0에서 가장 크고 hop 2+에서는 줄거나 사라집니다. 이 결과는 160개 부분집합에서 얻은 것이며, 시드 세 번 평균과 greedy 실행을 함께 보고합니다.

Table 3 : Tool ablation, primary greedy runs(160 tasks; function Acc@10 and recall over the 156 tasks with function-level gold). Steps and submit rate are per episode. The last columns give exact McNemar p-values againstG(discordant counts in parentheses, arm-only wins /G-only wins) on function Acc@10.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.
Table 4 : Three-run estimates(greedy run plus two seeds at T=0.7 ; Gemma’s runs restricted to the subset). Each task’s function Acc@10 is averaged over runs; entries are means over 156 tasks with 95% percentile- bootstrap intervals over tasks. Differences are paired.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.
Figure 2 : function Acc@10 by hop bucket and tool set.All panels pool three runs (one greedy, two sampled). Each bucket has 40 tasks (38–40 with function-level gold). The advantage of the graph tools (T) overGis largest at hop 0 (16–22 points) and shrinks to 2 points by hop 3+ for the Qwen models (7 for Gemma, whoseGarm falls to 2.6%); the embedding arm (E) has the flattest slope.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 12쪽에서 그림 영역을 추출했습니다.
Table 13 : function Acc@10 (%) by hop bucket for every run.40 tasks per bucket (38–40 with function-level gold). BUDGETis on 20 tasks per bucket.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 28쪽에서 그림 영역을 추출했습니다.선형 프로브로 본 모델 내부 표현
프로브는 정의의 마지막 토큰에서 얻은 잔차 스트림 표현으로 두 정의 사이의 관계를 예측합니다. 전체 쌍을 한꺼번에 평가하면 노드 수준 단서만으로도 높은 AUC가 나왔기 때문에, 저자들은 같은 앵커를 공유하는 쌍끼리만 순위를 매기는 within-anchor 프로토콜을 쓰고 대상의 in-degree 구간으로 층화했습니다. 이 프로토콜에서 직접 호출 간선은 Qwen3-4B 기준 AUC 0.74 수준으로 디코딩되었으나, 대상 이름이 텍스트에 있는지 보는 어휘 기준선은 0.99였습니다. 2홉 간선은 어휘 단서를 제거했을 때 0.57 수준이었습니다.

Table 9 : ANCHORPROBE: within-anchor AUC at layer 24, strict grouping (anchor × in-degree bin of b), with 95% anchor-bootstrap intervals for Qwen3-4B. A relational representation shows as pair/interaction AUC above b-only, the permuted control and the in-degree baseline. The lexical baseline is 1[name(b) ∈ text(a)]; it is 0.5 for CALL2 by construction. Qwen3-8B point estimates from the same protocol are given in the last two columns (pair / b-only).
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 20쪽에서 그림 영역을 추출했습니다.
Figure 6 : ANCHORPROBE across layers (strict grouping, mean of the two folds). Direct CALL edges are decodable from the middle layers on, peaking at layer 24, with the interaction term carrying almost all of the signal and the b-only probe at chance; CALL2 is barely above b-only; for INHERIT the b-only probe is at or above the pair probe. The degenerate Qwen3-8B layer-32 fit (AUC exactly 0.5 for every pair probe, a numerical failure of the standardised logistic fit at that layer) is omitted.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 20쪽에서 그림 영역을 추출했습니다.해석의 한계와 적용 범위
깊이 라벨은 이름 기반 해석과 정적 분석에 의존하므로 실제 에이전트가 따르는 경로가 아니라 최단 경로 거리로 읽어야 합니다. 동적 디스패치는 그래프에 보이지 않습니다. 주요 모델은 4B에서 8B 규모이며, 0.6B에서 32B까지의 확장 곡선은 과제 전체에서 얻었으나 32B는 비사고 모드 FP8 체크포인트이므로 점근선으로 읽을 수 없습니다. 선형 프로브는 하한에 가까운 증거이며 비선형 판독이나 인과 개입은 배제하지 않습니다.

Table 7 : SCALECURVE: function Acc@10 (%) on all 500 tasks by model size and tool set.Left block: strict function Acc@10, the per-task mean over the T=0.7 seeds (four for the Qwen3 sizes, two for Qwen3-14B-FP8 and Gemma), on the 485 tasks with function-level gold, with the paired arm−Gdifference and its 95% bootstrap interval; every Qwen difference has Holm-adjusted p= 0.002. Right block: the same under canonical rescoring (not available for Gemma E2B/E4B, whose notebook kept only the last model’s rescoring). Gemma 4 12B is one greedy run on the 307 tasks it completed; the run is degenerate (Section E) and is listed for completeness only.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 14쪽에서 그림 영역을 추출했습니다.
Figure 3 : SCALECURVEover the six Qwen3 sizes( T=0.7 seeds pooled, all 500 tasks). (a) Strict function Acc@10 per arm. (b) Gain of each structured arm overGwith 95% bootstrap intervals over tasks; the gain peaks at 1.7–4B and falls to 4–5 points at 32B. (c) The same gain under canonical rescoring: from 8B up, about half of the strict gain is the form of the submission. (d) Fraction of episodes in which the agent calls the structured tool at all: find_entity survives to 14B, graph_neighbors is largely abandoned after 8B, and at 32B every structured tool is called in under half of the episodes.
원문 · CC BY 4.0 · Saurav Bellam · How Do Small Coding Agents Use Code Graphs and Embeddings? · 원문 그림 인용 · 원본 PDF 15쪽에서 그림 영역을 추출했습니다.논문 정보
- 저자
- Saurav Bellam
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2026년 10월 25일
- 등록일
- 2026년 11월 4일
- 수정일
- 2026년 10월 25일
- 버전
- v1
- arXiv
- 2610.33958
- 분류
- cs.SE · cs.CL · cs.LG
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
Coding agents are given embedding search and code-graph tools on the premise that a repository's structure is something the model lacks and the tool supplies. We test that premise on SWE-bench Verified with small open-weight models, stratifying tasks by a deterministic hop depth (the shortest code-graph path from code the issue mentions to code the gold patch changes) that a companion paper defines and validates. First, we ablate a localization agent's tool set (grep only; +embedding search; +graph tools; all) on a depth-balanced 160-task split and on all 500 tasks for ten models (six Qwen3 sizes from 0.6B to 32B with five decodings each, an FP8 control, three Gemma 4 sizes; 79k episodes). Structured tools double grep-only accuracy for Qwen3-8B and Gemma 4 E4B; their gain peaks at 17-21 points at 1.7-4B and falls to 4-5 points at 32B (odds ratio 0.77-0.82 per doubling of parameters). From 8B up, about half of that gain is the form of the submission rather than finding the target; the fall from 14B to 32B is a fall in tool uptake at equal grep-only accuracy; and the same 4B size gains or does not gain from a tool depending on the checkpoint. Each extra hop multiplies the odds of correct localization by 0.50-0.67 at every size, and no tool set flattens that gradient: traces show the graph tools' gain is name lookup at hop 0 and one expansion at hop 1, and agents chain expansions in only 12-14% of episodes. A fixed repair model resolves 6-13 of 160 tasks from these localizations (oracle 26). Second, linear probes find direct call edges decodable under a within-anchor, degree-stratified protocol (AUC 0.74; 0.61-0.66 inside agent conversations), but below a lexical baseline (0.99), with two-hop edges at 0.57. Small agents carry a one-hop, largely lexical picture of their repository, in weights and in use. We release the agent, probes, logs and traces.
원문 인용
Saurav Bellam (2026). How Do Small Coding Agents Use Code Graphs and Embeddings?. arXiv:2610.33958v1. https://arxiv.org/abs/2610.33958v1
BibTeX
@misc{bellam2026small,
title = {{How Do Small Coding Agents Use Code Graphs and Embeddings?}},
author = {Saurav Bellam},
year = {2026},
eprint = {2610.33958},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2610.33958v1}
}