How Do Small Coding Agents Use Code Graphs and Embeddings?
Organizations: The University of Texas at Austin
Abstract
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.
Figures & tables
| Model | Label variant | plain | controls | ||||
|---|---|---|---|---|---|---|---|
| OR [95% CI] | OR [95% CI] | ||||||
| Qwen3-4B | default | 1872 | 156 | 0.523 [0.401, 0.682] | 0.472 [0.345, 0.644] | ||
| strict_resolve | 1872 | 156 | 0.537 [0.414, 0.696] | 0.474 [0.353, 0.636] | |||
| loose_resolve | 1872 | 156 | 0.518 [0.393, 0.682] | 0.467 [0.338, 0.645] | |||
| strict_mentions | 612 | 51 | 0.657 [0.428, 1.008] | 0.054 | 0.553 [0.344, 0.888] | 0.014 | |
| Qwen3-8B | default | 624 | 156 | 0.547 [0.403, 0.744] | 0.468 [0.334, 0.655] | ||
| ID | Model | Setting | Hardware |
|---|---|---|---|
| Abl-4B | Qwen3-4B-Instruct-2507 | tool ablation: 4 arms, | L4 |
| Abl-8B | Qwen3-8B (non-thinking) | tool ablation: 4 arms, | A100 |
| Abl-Gemma | Gemma 4 E4B-it | tool ablation: 4 arms, , gemma4 tool parser; all 500 tasks | A100 |
| Abl-32B | Qwen3-32B (FP8, non-thinking) | tool ablation: 4 arms, ; all 500 tasks | A100 80GB |
| Abl-4B-500 , Abl-8B-500 | Qwen3-4B, Qwen3-8B | 4 arms, , the 340 tasks outside the subset (with Abl-4B / Abl-8B : all 500) | A100 80GB |
| Seeds | Qwen3-4B, Qwen3-8B, Gemma 4 E4B | run-to-run variance: 4 arms, , seeds 1 and 2 (Gemma: all 500 tasks) | L4 / A100 |
| Model | Arm | function Acc@10 | func. recall@10 | file Acc@5 | steps | submit | vs. G (wins) |
|---|---|---|---|---|---|---|---|
| Qwen3-4B ( Abl-4B ) | G | 24.4 | 28.1 | 53.1 | 7.8 | 0.975 | — |
| E | 23.1 | 27.6 | 56.2 | 8.8 | 0.956 | (9/11) | |
| T | 30.8 | 35.2 | 56.9 | 8.5 | 0.994 | (20/10) | |
| ET | 29.5 | 33.2 | 56.2 | 8.9 | 0.988 | (18/10) | |
| Qwen3-8B ( Abl-8B ) | G | 12.8 | 14.6 | 33.1 | 16.6 | 0.619 | — |
| E | 26.3 | 29.5 | 51.2 | 11.9 | 0.819 | (24/3) |
| Qwen3-4B | Qwen3-8B | Gemma 4 E4B | ||||
| Arm | mean | 95% CI | mean | 95% CI | mean | 95% CI |
| G | 22.6 | [16.7, 28.8] | 13.0 | [8.5, 17.9] | 13.5 | [9.6, 17.7] |
| E | 21.6 | [16.2, 27.4] | 24.6 | [18.6, 30.6] | 25.2 | [19.7, 31.2] |
| T | 30.8 | [24.1, 37.6] | 24.1 | [17.9, 30.3] | 22.4 | [16.9, 28.2] |
| ET | 28.0 | [22.0, 34.2] | 26.5 | [20.5, 32.9] | 27.1 | [21.4, 33.1] |
| E G | [-4.9, +2.6] | [+7.1, +16.2] | [+7.5, +16.5] | |||
| Qwen3-4B | Qwen3-8B | Gemma 4 E4B | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Run | G | E | T | ET | G | E | T | ET | G | E | T | ET |
| greedy | 24.4 | 23.1 | 30.8 | 29.5 | 12.8 | 26.3 | 23.7 | 29.5 | 9.6 | 21.8 | 21.8 | 23.7 |
| , seed 1 | 23.7 | 19.9 | 30.8 | 29.5 | 12.2 | 21.8 | 23.7 | 26.3 | 14.7 | 28.2 | 21.2 | 29.5 |
| , seed 2 | 19.9 | 21.8 | 30.8 | 25.0 | 14.1 | 25.6 | 25.0 | 23.7 | 16.0 | 25.6 | 24.4 | 28.2 |
| SD | 2.4 | 1.6 | 0.0 | 2.6 | 1.0 | 2.4 | 0.7 | 2.9 | 3.4 | 3.2 | 1.7 | 3.0 |
| overall | function Acc@10 by bucket | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Model | Arm | function Acc@10 | file Acc@5 | hop 0 | hop 1 | hop 2 | hop 3+ | steps | submit | vs. G |
| Qwen3-4B | G | 26.8 | 61.2 | 36.8 | 33.3 | 13.2 | 6.8 | 7.6 | 0.982 | — |
| E | 29.1 | 63.0 | 38.4 | 34.1 | 10.5 | 20.5 | 8.0 | 0.970 | (41/30) | |
| T | 37.1 | 65.4 | 53.5 | 39.8 | 19.7 | 15.1 | 8.4 | 0.994 | (75/25) | |
| ET | 36.5 | 64.8 | 53.0 | 40.7 | 21.1 | 11.0 | 8.8 | 0.988 | (73/26) | |
| Qwen3-8B | G | 16.7 | 41.8 | 24.3 | 25.2 | 3.9 | 2.7 | 15.8 | 0.638 | — |
| strict function Acc@10 | canonical ids | ||||||||||
| Model | seeds | G | E | T | ET | E G | T G | ET G | G | ET | ET G |
| Qwen3-0.6B | 4 | 0.2 | 9.4 | 7.0 | 8.0 | [7.6, 11.0] | [5.2, 8.4] | [6.4, 9.3] | 1.9 | 9.5 | [6.1, 9.1] |
| Qwen3-1.7B | 4 | 0.9 | 22.4 | 12.3 | 19.0 | [18.5, 24.6] | [9.4, 13.6] | [15.7, 20.7] | 11.2 | 24.5 | [10.7, 16.0] |
| Qwen3-4B (hybrid) | 4 | 10.1 | 27.7 | 27.1 | 29.5 | [14.6, 20.7] | [14.0, 20.0] | [16.4, 22.6] | 17.7 | 33.5 | [12.9, 18.6] |
| Qwen3-8B | 4 | 17.1 | 30.4 | 30.2 | 32.1 | [10.4, 16.3] | [10.2, 16.1] | [12.2, 17.9] | 25.7 | 34.3 | [5.9, 11.4] |
| Qwen3-14B | 4 | 32.1 | 44.0 | 41.4 | 46.0 | [8.7, 15.2] | [6.5, 12.2] | [11.0, 17.0] | 42.1 | 48.9 | [4.4, 9.4] |
| calls / episode | eps. using | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | arm | acc | saw | conv. | submit | cap | steps | grep | read_file | ss | fe | gn | ss | fe/gn |
| Qwen3-4B | G | .226 | .562 | .380 | .983 | .017 | 8.0 | 3.8 | 1.9 | — | — | — | — | — |
| E | .216 | .588 | .338 | .951 | .045 | 8.8 | 3.2 | 2.6 | 0.59 | — | — | .43 | — | |
| T | .308 | .660 | .456 | .989 | .004 | 8.6 | 2.6 | 1.3 | — | 1.54 | 1.37 | — | .98/.90 | |
| ET | .280 | .658 | .416 | .974 | .024 | 9.2 | 2.6 | 1.6 | 0.23 | 1.73 | 1.18 | .14 | .98/.87 | |
| Qwen3-8B | G | .130 | .481 | .271 | .596 | .402 | 17.1 | 10.0 | 3.6 | — | — | — | — | — |
| Qwen3-4B | Qwen3-8B | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Task | Test fold | pair | interaction | -only | permuted | in-degree | lexical | pair | -only |
| call | Django | 0.740 [.724, .756] | 0.731 [.715, .746] | 0.510 [.493, .527] | 0.502 [.484, .520] | 0.534 | 0.993 | 0.733 | 0.533 |
| others | 0.683 [.665, .700] | 0.669 [.651, .686] | 0.530 [.511, .550] | 0.497 [.479, .516] | 0.513 | 0.987 | 0.661 | 0.523 | |
| call2 | Django | 0.569 [.548, .590] | 0.532 [.512, .552] | 0.520 [.497, .542] | 0.476 [.458, .493] | 0.501 | 0.500 | 0.606 | 0.608 |
| others | 0.573 [.552, .593] | 0.555 [.534, .577] | 0.559 [.536, .581] | 0.509 [.489, .529] | 0.500 | 0.500 | 0.552 | 0.562 | |
| inherit | Django | 0.619 [.593, .647] | 0.569 [.544, .597] | 0.688 [.663, .715] | 0.462 [.436, .487] | 0.500 | 0.927 | 0.655 | 0.667 |
| Task | Subset (fold) | pos | pair | -only | permuted | in-degree | |
| call | all (Django) | 4860 | 500 | 0.605 [.513, .690] | 0.511 [.423, .594] | 0.458 [.365, .554] | 0.521 |
| all (others) | 5728 | 578 | 0.655 [.590, .717] | 0.520 [.447, .595] | 0.516 [.455, .578] | 0.580 | |
| unstated (Django) | 4565 | 246 | 0.590 [.474, .697] | 0.479 [.370, .580] | 0.486 [.374, .596] | 0.503 | |
| unstated (others) | 5399 | 294 | 0.599 [.515, .686] | 0.483 [.390, .584] | 0.529 [.446, .613] | 0.541 | |
| arm G (Django) | 238 | 33 | 0.778 [.500, 1.00] | 0.556 [.125, .889] | 0.333 [.000, .667] | 0.500 | |
| arm G (others) | 396 | 64 | 0.706 [.467, .900] | 0.588 [.312, .840] | 0.588 [.294, .833] | 0.529 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Repository | hop 0 | hop 1 | hop 2 | hop 3+ | no mention | unreachable | total |
|---|---|---|---|---|---|---|---|
| django/django | 87 | 64 | 29 | 38 | 13 | 0 | 231 |
| sympy/sympy | 28 | 25 | 14 | 5 | 3 | 0 | 75 |
| sphinx-doc/sphinx | 2 | 5 | 11 | 17 | 9 | 0 | 44 |
| matplotlib/matplotlib | 14 | 8 | 8 | 4 | 0 | 0 | 34 |
| scikit-learn/scikit-learn | 20 | 9 | 3 | 0 | 0 | 0 | 32 |
| astropy/astropy | 10 | 6 | 5 | 1 | 0 | 0 | 22 |
| Term | Qwen3-4B (3 runs) | Qwen3-8B (greedy) | Qwen3-8B (3) | Gemma 4 E4B (3) | Qwen3-32B (500) | |
|---|---|---|---|---|---|---|
| Arm effect | E vs G | 0.93 [0.72, 1.20] | 2.83 [1.74, 4.61] | 2.61 [1.78, 3.81] | 2.48 [1.78, 3.45] | 1.21 [1.01, 1.44] |
| (OR) | T vs G | 1.68 [1.20, 2.37] | 2.40 [1.46, 3.94] | 2.53 [1.72, 3.71] | 2.06 [1.48, 2.88] | 1.13 [0.94, 1.36] |
| ET vs G | 1.42 [1.00, 2.02] | 3.43 [2.00, 5.89] | 2.96 [1.98, 4.45] | 2.80 [1.98, 3.95] | 1.24 [1.03, 1.49] | |
| per gold function | 0.49 [0.23, 1.07] | 0.72 [0.38, 1.38] | 0.71 [0.34, 1.47] | 0.44 [0.15, 1.25] | 0.67 [0.39, 1.15] | |
| per patch line | 0.86 [0.51, 1.47] | 0.58 [0.31, 1.06] | 0.59 [0.31, 1.10] | 1.01 [0.53, 1.94] | 0.67 [0.47, 0.94] | |
| Interaction | hop (arm G ) | 0.46 [0.31, 0.69] | 0.46 [0.26, 0.82] | 0.46 [0.27, 0.76] | 0.45 [0.30, 0.67] | 0.55 [0.44, 0.70] |
| G | E | T | ET | ||||||||||||||
| Model | Run | 0 | 1 | 2 | 3+ | 0 | 1 | 2 | 3+ | 0 | 1 | 2 | 3+ | 0 | 1 | 2 | 3+ |
| Qwen3-4B | Abl-4B | 45.0 | 26.3 | 15.0 | 10.5 | 40.0 | 18.4 | 15.0 | 18.4 | 55.0 | 31.6 | 22.5 | 13.2 | 47.5 | 28.9 | 27.5 | 13.2 |
| Seeds s1 | 37.5 | 31.6 | 15.0 | 10.5 | 30.0 | 15.8 | 22.5 | 10.5 | 62.5 | 23.7 | 25.0 | 10.5 | 50.0 | 23.7 | 27.5 | 15.8 | |
| Seeds s2 | 37.5 | 21.1 | 12.5 | 7.9 | 40.0 | 18.4 | 20.0 | 7.9 | 57.5 | 28.9 | 25.0 | 10.5 | 45.0 | 23.7 | 20.0 | 10.5 | |
| ForceTool | — | — | — | — | 60.0 | 18.4 | 22.5 | 7.9 | 52.5 | 23.7 | 22.5 | 18.4 | — | — | — | — | |
| Qwen3-8B | Abl-8B | 25.0 | 15.8 | 5.0 | 5.3 | 47.5 | 23.7 | 20.0 | 13.2 | 47.5 | 18.4 | 20.0 | 7.9 | 55.0 | 18.4 | 27.5 | 15.8 |
| Arm | function Acc@10 | func. recall@10 | file Acc@5 | steps | submit | |
|---|---|---|---|---|---|---|
| G | 17.5 | 20.8 | 38.0 | 11.8 | 0.797 | 158 |
| E | 20.0 | 23.4 | 43.4 | 13.7 | 0.736 | 159 |
| T | 19.6 | 21.7 | 38.2 | 15.4 | 0.637 | 157 |
| ET | 22.4 | 26.6 | 40.4 | 14.8 | 0.692 | 156 |
| arm T | arm ET | arm E | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | bucket | grep | rf | fe | gn | none | grep | rf | fe | gn | ss | none | grep | rf | ss | none | |
| Qwen3-4B | hop 0 | .28 | .01 | .53 | .07 | .12 | .32 | .03 | .53 | .03 | .01 | .09 | .78 | .07 | .03 | .13 | |
| hop 1 | .29 | .07 | .04 | .40 | .20 | .22 | .08 | .06 | .40 | .01 | .23 | .30 | .20 | .07 | .43 | ||
| hop 2 | .35 | .03 | .04 | .17 | .41 | .29 | .07 | .03 | .14 | .02 | .46 | .30 | .07 | .13 | .49 | ||
| hop 3+ | .17 | .04 | .00 | .16 | .64 | .17 | .03 | .03 | .15 | .04 | .60 | .17 | .09 | .13 | .60 | ||
| Qwen3-8B | hop 0 | .32 | .03 | .46 | .12 | .08 | .42 | .03 | .25 | .03 | .17 | .10 | .59 | .03 | .20 | .17 | |
| Model | Task / fold | pair | permuted | -only | -only | name | distance | same class | in-degree( ) | out-degree( ) | best |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3-4B | call / Django | .785 | .520 | .709 | .613 | .968 | .609 | .561 | .847 | .893 | L24 .785 |
| call / others | .747 | .487 | .656 | .608 | .970 | .604 | .538 | .852 | .860 | L24 .747 | |
| call2 / Django | .700 | .514 | .695 | .591 | .500 | .507 | .542 | .744 | .832 | L24 .700 | |
| call2 / others | .672 | .509 | .687 | .614 | .500 | .477 | .512 | .763 | .797 | L24 .672 | |
| inherit / Django | .711 | .499 | .743 | .708 | .968 | .677 | .392 | .292 | .306 | L36 .774 | |
| inherit / others | .708 | .477 | .772 | .688 | .970 | .687 | .368 | .301 | .283 | L28 .805 |
| Task | Test fold | pair | interaction | -only | permuted | in-degree | lexical |
|---|---|---|---|---|---|---|---|
| call | Django | 0.742 [.732, .753] | 0.727 [.716, .737] | 0.622 [.614, .631] | 0.523 [.514, .532] | 0.892 [.885, .899] | 0.991 |
| others | 0.705 [.693, .717] | 0.672 [.660, .685] | 0.617 [.606, .627] | 0.498 [.488, .508] | 0.889 [.881, .897] | 0.985 | |
| call2 | Django | 0.595 [.583, .608] | 0.567 [.554, .579] | 0.595 [.582, .608] | 0.500 [.487, .513] | 0.790 [.776, .805] | 0.500 |
| others | 0.612 [.600, .624] | 0.554 [.540, .568] | 0.626 [.612, .641] | 0.519 [.506, .532] | 0.789 [.778, .801] | 0.500 | |
| inherit | Django | 0.628 [.605, .651] | 0.572 [.548, .596] | 0.681 [.659, .704] | 0.484 [.462, .506] | 0.301 [.291, .313] | 0.891 |
| others | 0.607 [.569, .644] | 0.490 [.452, .530] | 0.660 [.624, .697] | 0.455 [.419, .490] | 0.325 [.305, .344] | 0.862 |
| Model | arm | hop 0 | hop 1 | hop 2 | hop 3+ | OR per hop |
|---|---|---|---|---|---|---|
| Qwen3-0.6B | G | 0.4 | 0.2 | 0.0 | 0.0 | 0.67 [0.57, 0.78] |
| E | 9.9 | 13.0 | 7.6 | 4.5 | ||
| T | 11.2 | 9.3 | 1.6 | 0.3 | ||
| ET | 10.8 | 8.5 | 4.6 | 2.7 | ||
| Qwen3-1.7B | G | 1.8 | 0.6 | 0.3 | 0.0 | 0.58 [0.49, 0.69] |
| E | 30.3 | 22.6 | 14.5 | 11.0 |
| Model | arm | acc | saw | conv. | submit | cap | steps | grep | read_file | ss | fe | gn | use | 2-hop |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3-0.6B | G | 0.2 | 0.05 | 0.03 | 0.64 | 0.07 | 7.9 | 1.5 | 0.7 | — | — | — | — | — |
| E | 9.4 | 0.40 | 0.20 | 0.72 | 0.13 | 10.4 | 1.1 | 2.5 | 2.93 | — | — | .87 | — | |
| T | 7.0 | 0.21 | 0.23 | 0.52 | 0.22 | 13.8 | 1.7 | 0.2 | — | 7.00 | 0.11 | .98/.08 | .32 | |
| ET | 8.0 | 0.42 | 0.16 | 0.71 | 0.16 | 12.3 | 1.1 | 1.3 | 4.44 | 1.48 | 0.44 | .68/.42 | .20 | |
| Qwen3-1.7B | G | 0.9 | 0.28 | 0.02 | 0.76 | 0.13 | 13.8 | 9.5 | 0.5 | — | — | — | — | — |
| E | 22.4 | 0.46 | 0.45 | 0.97 | 0.02 | 7.2 | 3.8 | 0.2 | 1.01 | — | — | .84 | — |
AI Coding Agents
AI coding agents use language models and software tools to plan, edit, test, and maintain code with varying levels of autonomy.
See all 326 papers