betaFeedback

WorksComputer Science

GraphScent: Calibrating Directional Relevance Signals for Bounded-Context Code Localization

Abstract

Running open-weight language models locally on a single consumer GPU requires replacing expanding multi-turn exploration histories with short, stateless code inspections. Stateless repository localization, however, hinges on a foundational question: when a frozen language model evaluates an unedited code entity from a compact view, which structural relationships make its relevance judgment informative about a nearby repair target? Studying Gemma 4 models across 211 real-world Python issues in 86 repositories, we uncover a systematic directional relevance asymmetry: zero-temperature relevance scores on enclosing scopes and upstream callers consistently separate true structural neighbors from hard lexical distractors, whereas scores on downstream callees, peer methods, historical co-change partners, and dense node embeddings remain near chance. Zero-leakage masked-scope probes and regressions controlling for lexical similarity and snippet length confirm that this asymmetry reflects functional role (callers expose symptom entrypoints delegating to defective routines, while downstream helpers appear benign alone) rather than target leakage or surface overlap. Guided by this finding, we introduce GraphScent, a training-free search controller that propagates out-of-repository, relation-conditioned log-likelihood ratios over runtime Typed-AST multigraphs before resolving ties via a single listwise comparison, alongside AST Ripple, a lightweight post-edit check for missed co-edits. Likelihood calibration prevents overconfident smaller models from chasing false-positive callers while lifting exact localization on lexically hard targets from 12.8 to 23.4 percent at 31B within a single-GPU budget.

Preprint. Submitted to The Gemma 4 Developer Agent Paper Track (2026).

Introduction

Deploying capable software-engineering agents on local workstation hardware requires strict control over prompt length and key-value (KV) cache growth. Under 4-bit quantization-aware training (w4a16) [3], Gemma 4 E4B, 12B, and 31B occupy 10.42 GiB, 8.51 GiB, and 20.28 GiB of GPU memory including captured CUDA graphs—fitting on a single 24 GB consumer accelerator whenever individual inference calls remain stateless and compact (<4.5< 4.5K prompt tokens). In contrast, standard multi-turn coding scaffolds [20, 7] append successive file reads, directory listings, and search outputs into an expanding conversation history, rapidly exhausting local VRAM while compounding early navigation mistakes [23].

Replacing long multi-turn trajectories with bounded-context stateless probes shifts the burden of repository exploration onto an explicit external search controller. Suppose an external controller selects candidate functions or classes one at a time, renders each as a compact folded view (≤60\le60 lines), and obtains a discrete relevance judgment S(u)∈{0,1,2,3}S(u) \in\{0, 1, 2, 3\} from a frozen local LLM. When uu itself is not the repair target, under what structural conditions does reading uu provide diagnostic evidence about a nearby target v∗∈V∗v^{*} \in V^{*}? Prior repository-localization frameworks equip multi-turn agents with directed heterogeneous code graphs [1, 6, 22] or rank directed call and inheritance views via Personalized PageRank [24], while active retrieval methods such as BAGEL [9] and ReBOL [10] propagate sparse LLM relevance scores through Gaussian processes over dense passage embeddings. Yet static graph centrality ignores what the LLM discovers when reading candidate code, and symmetric kernel or graph propagation implicitly assumes that local relevance evidence decays isotropically across edges.

We investigate this question within the setting of the Gemma 4 Developer Agent Challenge and Paper Track (https://www.kaggle.com/competitions/gemma-4-developer-agent-paper), an open benchmark for local software-engineering agents that provides 129 real-world Python GitHub issue-resolution tasks together with precomputed repository call graphs and 256-d node embeddings, which we extend with a second zero-overlap panel of 102 temporally held-out 2025–2026 issues across 84 additional Python repositories. Evaluating Gemma 4 E4B, 12B, and 31B across 211 localized tasks in 86 repositories (46,032 cached live T=0T = 0 node evaluations), we make four findings and contributions:

  1. Structural Graph Audit and Static Centrality Controls (Section 2). Auditing the benchmark’s supplied Oct 13 call graphs (129 public tasks), we find that 100.0% of non-self edges are stored reciprocally (u→v⟺v→uu \to v \Longleftrightarrow v \to u), 27.3% of candidate entities (44.3% in fastapi) are isolated, and static Personalized PageRank (MRR 0.083) degrades lexical BM25 (0.174). Rebuilding a runtime Typed-AST multigraph in pure Python (median 0.17 s on CPU) connects 100.0% of candidates overall and 83.4%–83.7% strictly via non-containment call, inheritance, and override edges. Even on this repaired graph, however, static undirected and directed PageRank (MRR 0.268 and 0.205) trail BM25 (0.357), showing that repository topology helps localization only when paired with live semantic judgments.

  1. Controlled Measurement of Directional Relevance Asymmetry (Section 3). Evaluating ordinal T=0T = 0 judgments on unedited structural neighbors against hard lexical distractors across two disjoint repository panels, we find that enclosing scopes (parent) and upstream callers (called_by) consistently carry positive proximal signal across all three model scales, whereas downstream callees (calls) sit near chance despite 2.4× higher fan-out. Zero-leakage masked-parent probes, span-disjoint caller-versus-callee comparisons, and regressions controlling simultaneously for BM25 similarity and snippet length rule out target-code leakage and lexical confounds.

  1. Calibrated Bounded-Context Search and Post-Edit Ripple Check (Sections 4–5). Guided by a 5,760-run diffusion phase diagram, GraphScent propagates out-of-repository Laplace-smoothed log-likelihood ratios selectively along positive-scent directed relations (parent →\to child, caller →\to callee) across B=24B = 24 stateless probes, followed by a single top-6 listwise tie-break. Ablations show that out-of-repository likelihood calibration specifically stabilizes overconfident E4B (+3.8 pp over uncalibrated Fixed-Dir), forward structural orientation beats reversed edges across all scales, and listwise tie-breaking adds +7.6 to +12.3 pp over pointwise arg max. A supporting ∼160\sim160-token post-edit tool (AST Ripple) surfaces missed reference-patch files in 50.0% of unresolved 31B multi-file runs.

  1. Verifiable Open Benchmark and Toolkit (Section 7). We release GraphScent-Bench under Apache-2.0, including the standalone graphscent Python package, audited manifests, 46,032 cached T=0T = 0 judgments, out-of-repository calibration folds, negative-result logs, and an executable Kaggle reproduction notebook.

Benchmark Panels, Structural Audit, and Static Graph Controls

Repository-Disjoint Panels, Provenance, and Exclusion Accounting

To test whether structural relevance patterns generalize beyond the four repositories in the public competition benchmark, we evaluate two repository-disjoint Python panels totaling 211 entity-localized tasks across 86 unique repositories (3–2,140 non-test Python files per repository, median 45, P90 237; 719–167,538 non-test lines of code, median 10,726, P90 83,671).

Public benchmark panel (public_113; 4 repositories, 113 tasks). The public release of the Gemma 4 Developer Agent Challenge supplies 129 real-world GitHub issues across fastapi/fastapi (56 localized tasks), Textualize/rich (44), psf/requests (12), and encode/httpx (1). Because entity-level localization evaluates functions, methods, and classes, we apply a deterministic ground-truth mapping filter prior to evaluation: 113 tasks modify at least one existing non-test Python function or class, whereas 16 tasks are excluded upfront—13 whose reference patch edits only module-top-level statements or introduces brand-new top-level symbols outside existing definitions, and 3 that touch only documentation, tests, or non-Python files.

Temporally held-out panel (post2025_98; 82 repositories, 98 tasks). We complement the public split with 102 GitHub issues collected across 84 open-source Python repositories having zero repository overlap with public_113. Every issue/commit timestamp (102/102, 100.0%) falls between 2025-01-02 and 2026-05-11 (P10 2025-02-07, median 2025-06-12, P90 2026-04-13). Applying the identical entity-mapping rule yields 98 tasks across 82 repositories; the 4 excluded tasks (montepy_850, toqito_1484, jsonata_python_14, and shtab_182) modify only module-level statements or add new symbols outside existing definitions. We refer to this split as temporally held-out 2025–2026 repositories rather than claiming guaranteed pretraining non-exposure, since public model documentation does not enumerate per-commit pretraining cutoffs.

Zero-context parametric recall probe. Before evaluating graph search, we check whether models can already recall defective file paths from parametric memory alone. Given only the repository name and issue text (zero repository files or directory trees), we prompt each model at T=0T = 0 to predict up to five likely buggy file paths and stratify tasks by whether a gold filename already appears verbatim in the issue text (Table 1). On unnamed issues in post2025_102 (n=63n = 63), E4B, 12B, and 31B recover any gold path on only 3.2%, 9.5%, and 11.1% of tasks (compared to 8.4%, 19.3%, and 38.7% on widely studied public_129 repositories), confirming that active repository search is essential.

Model ScalePublic Panel (public_129, 4 repos)Held-Out 2025–26 Panel (post2025_102, 84 repos)
All (129)Named (10)Unnamed (119)All (102)Named (39)Unnamed (63)
Gemma 4 E4B12.4%60.0%8.4%31.4%76.9%3.2%
Gemma 4 12B24.0%80.0%19.3%34.3%74.4%9.5%
Gemma 4 31B43.4%100.0%38.7%38.2%82.1%11.1%

Table 1. Zero-context parametric file-path recall (Hit@5) from repository name and issue text alone (T=0T = 0), stratified by whether a gold filename appears verbatim in the issue prompt.

Audit of Supplied Call Graphs vs. Runtime Typed-AST Multigraphs

The public competition benchmark includes precomputed repository call graphs and 256-d node embeddings for all 129 tasks (revised Oct 13 release, which replaced an initial Sep 22 release where 61/129 graphs were empty). Auditing all 460,018 edge records in the Oct 13 release uncovers three structural bottlenecks that explain why naive graph baselines struggle (Figure 1a). First, after removing 2,598 self-loops and 96 duplicate records, the remaining 457,324 non-self directed edges span 228,662 unordered node pairs, of which 228,662/228,662 (100.0%) are stored reciprocally (u→vu \to v and v→uv \to u) under a single calls label, erasing caller–callee direction. Second, 27.3% of non-test Python candidate entities have degree zero (44.3% in fastapi/fastapi, where decorator-registered route handlers lack explicit Python callers), leaving 39/113 tasks unreachable from issue-mentioned anchors and 8/113 unreachable from BM25 top-5 seeds. Third, running Personalized PageRank (PPR) seeded by BM25 over the Oct 13 graphs lowers mean reciprocal rank (MRR) from 0.174 to 0.083.

Figure 1. Structural graph audit and multi-file co-edit gap. (a) Audit of the supplied Oct 13 benchmark call graphs against our runtime Typed-AST multigraph (n=113n = 113 public tasks), together with static BM25 and Personalized PageRank (PPR) MRR. (b) Single-trajectory 31B issue-resolution drop from 1-file (39.1%) to 3+-file patches (9.4%), alongside post-edit AST Ripple missed reference-file recall (50.0% on 31B) and zero-shot ripple-judge AUROC (65.9% on 12B).

To recover typed directionality without external language servers or pre-built indexes, we parse non-test repository Python files on the fly using Python’s standard ast module into a directed Typed-AST multigraph multigraph G=(V,E)G = (V, E) over modules, classes, methods, and functions. Across all 86 benchmarked repositories on an AMD EPYC 9575F CPU, full AST construction plus BM25 indexing takes a median of 0.17 s (P90 1.48 s, maximum 7.94 s). Each edge carries one of four structural types: lexical containment (parent/child, plus peer sibling edges within a class), resolved intra-repository calls (calls/called_by; median 677 and 858 resolved call edges per repository on public_113 and post2025_98), class inheritance (inherits), and same-name subclass/protocol method overrides (mirror).

On public_113 and post2025_98, Typed-AST multigraphs connect 100.0% of candidate nodes overall and connect 83.42% and 83.74% of candidates strictly through non-containment (calls, inherits, mirror) edges alone, placing 81.4% (92/113) of public gold targets within 2 undirected hops of BM25 top-5 (100.0% within 4 hops). Yet Table 2 establishes a critical control: without live LLM judgments, static PageRank over Typed-AST graphs—whether undirected or directed along parent → child and caller → callee—still trails plain lexical BM25 (MRR 0.268 and 0.205 vs. 0.357 on pooled_211). Repository structure becomes informative only when coupled with semantic inspection of candidate code.

Static Ranking Methodpublic_113 R@5public_113 MRRpost2025_98 R@5post2025_98 MRRpooled_211 R@5pooled_211 R@20pooled_211 MRR
Lexical BM25 (folded AST views)39.8%0.27454.1%0.45446.5%67.3%0.357
Undirected Typed-AST PPR25.7%0.16754.1%0.38538.9%62.6%0.268
Directed Typed-AST PPR26.5%0.15141.8%0.26633.6%57.3%0.205
BM25 + Undirected PPR Fusion37.2%0.24856.1%0.44946.0%67.3%0.342
BM25 + Directed PPR Fusion38.9%0.26753.1%0.44845.5%67.8%0.351

Table 2. Static retrieval controls (zero LLM calls) on Typed-AST multigraphs across public_113, post2025_98, and pooled_211. Even on fully connected directed Typed-AST graphs, static undirected and directed Personalized PageRank (PPR) fail to improve upon plain lexical BM25.

Measuring Directional Relevance Asymmetry and Ruling Out Confounds

Protocol and Multi-Scale Directional Scent

Motivated by information foraging theory (Pirolli and Card [13]), we measure how strongly an LLM’s relevance judgment on an unedited neighbor cues a nearby repair target. Each AST entity u∈Vu \in V is rendered into a deterministic folded view of at most 60 lines preserving its signature, decorators, docstring, control-flow/call statements, and return/raise lines (skeletonizing classes >60> 60 lines to their docstring and 1-line method headers). Given the issue description and folded view of uu, a frozen Gemma 4 model at T=0T = 0 (thinking=off) emits an ordinal judgment S(u)∈{0,1,2,3}S(u) \in\{0, 1, 2, 3\} (3: defect is directly inside uu; 2: likely involved or direct neighbor; 1: on execution path; 0: unrelated).

For any directed relation rr defined relative to the unknown ground-truth edit set V∗V^{*}—such as u∈Ncalled_by(V∗)u \in\mathcal{N}_{\mathrm{called\_by}}(V^{*}) meaning unedited uu calls some v∗∈V∗v^{*} \in V^{*}, versus u∈Ncalls(V∗)u \in\mathcal{N}_{\mathrm{calls}}(V^{*}) meaning some v∗∈V∗v^{*} \in V^{*} calls unedited uu—we define directional relevance scent as the Mann–Whitney probability (AUROC) that an unedited rr-neighbor outranks an unedited hard lexical distractor ufar∈Vfaru_{\mathrm{far}} \in V_{\mathrm{far}} (top-BM25 non-gold candidates at undirected AST distance ≥3\ge3 from V∗V^{*}):

Scent⁡(r)=Pr⁡(S(ur)>S(ufar))+12Pr⁡(S(ur)=S(ufar)),ur∼Nr(V∗),ufar∼Vfar.(1)\operatorname{Scent}(r) = \Pr\left(S(u_r) > S(u_{\mathrm{far}})\right) + \frac{1}{2}\Pr\left(S(u_r) = S(u_{\mathrm{far}})\right), \qquad u_r \sim\mathcal{N}_r(V^{*}),\quad u_{\mathrm{far}} \sim V_{\mathrm{far}}. \tag*{(1)}

Here Scent(r)(r) = 0.50 indicates zero discrimination beyond lexical similarity, Scent(r)(r) > 0.50 indicates positive proximal cueing toward V∗V^{*}, and Scent(r)(r) < 0.50 indicates suppression below lexical distractors. On public_113, we also evaluate historical git co-modification (cochange), kk-nearest neighbors in the competition’s 256-d embeddings (knear_comp256), and kk-nearest neighbors in Qwen3-Embedding-0.6B (knear_qwen), reporting 1,000-resample task-cluster bootstrap 95% CIs.

Asymmetry between callers/scopes and callees. Table 3 and Figure 2 show a consistent directional asymmetry across all three Gemma 4 scales and both repository panels. On pooled_211, parent scores 0.643, 0.713, and 0.719 across E4B, 12B, and 31B, and called_by scores 0.600, 0.641, and 0.623 (every 95% CI strictly above 0.56). By contrast, downstream callees (calls: 0.477, 0.483, 0.487) sit at or slightly below the 0.50 distractor baseline while exhibiting 2.4× higher per-target multiplicity than callers. Peer methods (sibling: 0.506–0.519), historical cochange (0.463–0.498), and supplied 256-d competition embeddings (knear_comp256: 0.436–0.470) similarly remain near chance, while Qwen3-Embedding-0.6B neighbors (knear_qwen: 0.541–0.565) carry modest signal well below parent and called_by.

Relation rr rel. to V∗V^*Panel (nn)Gemma 4 E4BGemma 4 12BGemma 4 31B31B Pub31B Post
gold (v∈V∗v \in V^*, direct target)Pool (394)0.658 [.63, .69]0.738 [.70, .78]0.734 [.70, .77]0.7190.754
parent (enclosing scope)Pool (187)0.643 [.60, .69]0.713 [.67, .76]0.719 [.67, .77]0.6960.775
called_by (upstream caller)Pool (328)0.600 [.57, .63]0.641 [.60, .68]0.623 [.59, .66]0.6510.587
inherits (base / subclass)Pool (22)0.546 [.43, .66]0.526 [.43, .65]0.563 [.47, .67]0.6520.524
mirror (parallel override)Pool (113)0.462 [.39, .54]0.523 [.47, .59]0.536 [.49, .59]0.5610.519
sibling (peer in same class)Pool (545)0.519 [.49, .55]0.513 [.48, .54]0.506 [.48, .53]0.5170.494
calls (callee, 2.4× fan-out)Pool (389)0.477 [.44, .51]0.483 [.45, .51]0.487 [.46, .51]0.4780.507
knear_qwen (Qwen3-Embed-0.6B)Pub (339)0.556 [.52, .59]0.565 [.52, .60]0.541 [.51, .57]0.541—
cochange (git commit history)Pub (220)0.463 [.42, .50]0.488 [.45, .53]0.498 [.46, .53]0.498—
knear_comp256 (Oct 13 256-d)Pub (324)0.436 [.40, .48]0.455 [.42, .49]0.470 [.44, .50]0.470—

Table 3. Multi-scale T=0T = 0 directional relevance scent (AUROC vs. 1,266 hard BM25 far distractors; 1,000-resample task-cluster bootstrap 95% CIs on pooled_211, plus panel split). Non-AST channels (knear_qwen, cochange, knear_comp256) are measured on public_113.

Figure 2. Directional relevance asymmetry across model scales and disjoint repository panels. Point estimates and 95% task-cluster bootstrap CIs for Scent(rr) on (a) public_113 (4 repositories) and (b) temporally held-out post2025_98 (82 repositories). Enclosing scopes (parent) and upstream callers (called_by) consistently exceed the 0.50 distractor baseline and τ=0.55\tau= 0.55 gate across E4B, 12B, and 31B, whereas downstream callees (calls) remain near 0.48–0.51.

Scale-dependent distractor overconfidence. Score histograms on far distractors (public_113 / post2025_98) expose a striking calibration difference across model sizes: E4B assigns the top score S=3S = 3 to 50.9%/26.5% of distractors, compared to 17.4%/9.9% for 12B and 9.6%/7.5% for 31B. Even under this high false-positive rate, E4B separates called_by from far (AUROC 0.600) because it assigns S=0S = 0 far less often to true callers than to distractors (6.6% vs. 28.2% on public_113), motivating full ordinal likelihood calibration rather than raw-score propagation.

Zero-Leakage Masked-Parent and Lexical/Length Confound Controls

Before attributing positive parent and called_by scent to structural role, we test two confounds that could inflate neighbor scores (Table 4).

Control Experiment (pooled_211)Sample nnGemma 4 E4BGemma 4 12BGemma 4 31B
Original parent vs. far187 vs. 12660.643 [.60, .69]0.713 [.67, .76]0.719 [.67, .77]
parent_gold_masked (0 gold child lines) vs. far187 vs. 12660.654 [.61, .70]0.700 [.66, .75]0.700 [.66, .75]
parent_header_doc (hdr + doc + non-gold sigs)187 vs. 12660.654 [.61, .70]0.716 [.67, .77]0.728 [.68, .77]
Skeletonized parent (> 60 lines) vs. far114 vs. 12660.678 [.63, .73]0.785 [.73, .84]0.811 [.77, .87]
Span-disjoint called_by vs. far297 vs. 12660.592 [.56, .63]0.652 [.61, .69]0.638 [.60, .68]
Span-disjoint called_by vs. span-disjoint calls297 vs. 3720.630 [.59, .67]0.652 [.61, .69]0.629 [.59, .67]
High-BM25 (≥0.45\ge0.45) called_by vs. far58 vs. 9640.650 [.60, .70]0.756 [.70, .81]0.756 [.69, .82]
OLS slope β^caller\hat{\beta}_{\mathrm{caller}} (ctrl. BM25 + lines)n=669n = 669+0.471+0.471 [+.27,+.68+.27, +.68]+0.344+0.344 [+.14,+.55+.14, +.55]+0.221+0.221 [+.05,+.40+.05, +.40]

Table 4. Zero-leakage parent controls and span-disjoint, lexical, and length controls for called_by vs. calls on pooled_211 (95% task-cluster bootstrap CIs in brackets).

Zero-leakage control for parent views. When an enclosing class has ≤60\le60 lines, its folded view includes short method bodies and could expose lines of an edited method v∗∈V∗v^* \in V^*. We re-scored all 187 parent nodes across E4B, 12B, and 31B under two strict zero-leakage transformations: parent_gold_masked, replacing every line of any gold child method with # [method body omitted], and parent_header_doc, stripping all method bodies to keep only the class signature, class docstring, and 1-line non-gold method headers. Table 4 shows zero degradation: parent_gold_masked achieves 0.654, 0.700, and 0.700, parent_header_doc achieves 0.654, 0.716, and 0.728, and already-skeletonized long classes (> 60 lines, n=114n = 114) achieve 0.678, 0.785, and 0.811. Enclosing-scope signal comes from class-level responsibilities and docstrings rather than leaked target lines.

Span-disjoint, lexical, and length controls for called_by vs. calls. First, far distractors have 2.1× higher mean normalized BM25 similarity (0.634) than called_by (0.308) and nearly identical folded length (38.5 vs. 38.7 lines), so caller scent overcomes a substantial lexical disadvantage relative to far. Second, restricting strictly to zero-span-overlap nodes (297 callers vs. 372 callees), direct discrimination AUROC(called_by vs. calls) is 0.630 [.59, .67] (E4B), 0.652 [.61, .69] (12B), and 0.629 [.59, .67] (31B). Third, OLS regressions of S(u)S(u) on a caller indicator (called_by = 1, calls = 0) controlling simultaneously for normalized BM25 similarity and snippet length (n=669n = 669) yield positive caller slopes at every scale: β^caller=+0.471\hat{\beta}_{\mathrm{caller}} = +0.471 [+.27, +.68] (E4B), +0.344+0.344 [+.14,+.55+.14, +.55] (12B), and +0.221+0.221 [+.05,+.40+.05, +.40] (31B), while high-BM25 (≥0.45\ge0.45) 31B AUROC(called_by vs. far) reaches 0.756 [.69, .82]. These observations are consistent with callers exposing user-facing symptom entrypoints that delegate work to defective callees, whereas generic downstream utilities called by v∗v^* look self-contained and benign in isolation.

Method: Calibrated Bounded-Context Search and AST Ripple

When Does Graph Propagation Help? Linear-Diffusion Phase Diagram

To understand when neighbor propagation improves bounded-budget (B=24B = 24) target discovery, we simulated active search under linear score diffusion across 5,760 rollouts spanning a 12×1212 \times12 grid of direct judge discrimination AUROC(gold vs. far) ∈[0.58,0.99]\in[0.58, 0.99] and neighbor edge scent Scent⁡(r)∈[0.44,0.80]\operatorname{Scent}(r) \in[0.44, 0.80] on 40 public repository graphs (Figure 4a). Within the empirical discrimination range of open-weight judges (0.65–0.74), propagating scores along low-scent edges (Scent⁡(r)≤0.52\operatorname{Scent}(r) \le0.52) lowers multi-hop Found@24 by up to −15-15 pp because false-positive scores diffuse across 2.4×2.4 \times high-fan-out calls edges and displace genuine lexical candidates. Net discovery gain turns positive only when traversal restricts to directed relations with Scent⁡(r)≥0.55\operatorname{Scent}(r) \ge0.55.

Figure 4. Phase diagram and live T=0T = 0 localization results. (a) 5,760-run linear-diffusion phase diagram showing Δ\DeltaFound@24 (percentage points) across direct judge AUROC(gold vs. far) and neighbor edge scent, overlaid with directed Gemini 4.0 operating points. (b) Overall Commit@1 across all 211 tasks (B=24B = 24). (c) BM25-Hard (rank >10> 10, n=94n = 94) Commit@1 comparing Flat BM25, Undir-AST, Fixed-Dir, and GraphScent.

GraphScent Active Search Controller and Listwise Commitment

Guided by this threshold, GraphScent executes three lightweight stages (Figure 3):

Figure 3. System architecture of GraphScent and AST Ripple. Stage 0 parses repository Python files into a directed Typed-AST multigraph (median 0.17 s on CPU) and initializes lexical BM25 log-beliefs. Offline out-of-repository calibration fits ordinal log-likelihood ratios ℓr(s)\ell_r(s) and gates propagation to R+={r:Scent⁡cal(r)≥0.55}\mathcal{R}_+ = \{r : \operatorname{Scent}_{\mathrm{cal}}(r) \ge0.55\} (parent →\to child, caller →\to callee). Stage 1 executes B=24B = 24 stateless T=0T = 0 folded-view probes (<21.5< 21.5 GiB single-GPU VRAM), Stage 2 resolves discrete score ties via a single top-6 listwise commitment call, and Stage 3 runs post-edit AST Ripple (∼160\sim160 tokens) to surface unedited callers and overrides.

Stage 0: Lexical log-prior. Given issue description qq and runtime Typed-AST multigraph G=(V,E)G = (V,E), we compute normalized BM25 similarity over folded entity views to define prior π(v)∝exp⁡(α BM25(q,v))\pi(v) \propto\exp(\alpha\,\mathrm{BM25}(q,v)) and initialize log-belief b0(v)=log⁡π(v)b_0(v) = \log\pi(v).

Stage 1: Out-of-repository calibrated directional propagation. Using strictly out-of-repository calibration data—leave-one-repository-out cross-validation across the 4 public_113 repositories, and a single frozen public_113 table transferred zero-shot to all 82 post2025_98 repositories—we estimate Laplace-smoothed ordinal likelihoods P^cal(S=s∣rel=r)\widehat{P}_{\mathrm{cal}}(S = s \mid\mathrm{rel} = r) for s∈{0,1,2,3}s \in\{0,1,2,3\} and define relation-conditioned log likelihood ratios (LLRs) and gated relation set R+\mathcal{R}_+:

ℓr(s)=log⁡P^cal(S=s∣rel=r)P^cal(S=s∣rel=far),R+={r:Scent⁡cal(r)≥τ},(2)\ell_r(s) = \log\frac{\widehat{P}_{\mathrm{cal}}(S = s \mid\mathrm{rel} = r)}{\widehat{P}_{\mathrm{cal}}(S = s \mid\mathrm{rel} = \mathrm{far})}, \qquad\mathcal{R}_+ = \{r : \operatorname{Scent}_{\mathrm{cal}}(r) \ge\tau\}, \tag*{(2)}

with τ=0.55\tau= 0.55 (which selects parent and called_by across every fold, plus inherits/mirror where supported, while rejecting calls and sibling across τ∈{0.52,0.55,0.58}\tau\in\{0.52, 0.55, 0.58\}; Appendix § 9). Propagation follows the diagnostic orientation: when probe tt inspects utu_t and observes st=S(ut)s_t = S(u_t), evidence flows from inspected scopes and callers toward candidate repair targets (parent →\to child, caller →\to callee) with degree damping 1/deg⁡r(v)1/\sqrt{\deg_r(v)} (plus 0.5-weighted 2-hop class-entry edges from callers of a class to its methods):

bt(v)=bt−1(v)+ℓself(st)I[v=ut]+∑r∈R+wr(ut→v)max⁡(1,deg⁡r(v))ℓr(st).(3)b_t(v) = b_{t-1}(v) + \ell_{\mathrm{self}}(s_t)\mathbb{I}[v = u_t] + \sum_{r \in\mathcal{R}_+} \frac{w_r(u_t \to v)}{\sqrt{\max(1,\deg_r(v))}} \ell_r(s_t). \tag*{(3)}

At each step t∈{1,…,B}t \in\{1,\ldots,B\}, GraphScent queries the unvisited candidate maximizing at(v)=bt−1(v)+c/1+nvis(v)a_t(v) = b_{t-1}(v) + c/\sqrt{1+n_{\mathrm{vis}}(v)}, resetting KV cache after every call. On E4B, calibration maps a noisy S=3S = 3 caller hit to ℓcalled_by(3)=+0.26\ell_{\mathrm{called\_by}}(3) = +0.26 while penalizing S=0S = 0 at −1.39-1.39, preventing false-positive callers from dominating search.

Stage 2: Stateless top-6 listwise commitment. Because four-level ordinal scores create ties among plausible candidates, pointwise arg max commitment (PW@1) suffers tie-breaking noise. After BB probes, GraphScent issues one stateless listwise prompt (median 2.1K, P90 3.1K input tokens) comparing the top-6 belief-ranked visited candidates side-by-side to select LW Commit@1.

Supporting Post-Edit Co-Edit Tool: AST Ripple

Across 1,087 single-trajectory Gemma 4 31B issue-resolution runs, solve rates drop 4.2×\times from single-file patches (39.1%, n=667n = 667) to 2-file (18.6%, n=234n = 234) and 3+-file patches (9.4%, $n = 186; Figure 1b). In Stage 3, AST Ripple parses an agent’s draft diff, extracts modified function/class signatures, queries GG for unedited direct callers (called_by) and overrides (mirror) in other files, and formats a compact ≤900\le900-character (∼160\sim160-token) co-edit alert.

Experimental Evaluation

Experimental Setup, Baselines, and Multi-Hop Stratification

We evaluate all methods live at T=0T = 0 (thinking=off, vLLM 0.19.1 on an isolated single NVIDIA H200 NVL GPU; all 4-bit QAT w4a16 models fit within <21.5< 21.5 GiB VRAM) across E4B, 12B, and 31B on public_113 and post2025_98 (pooled_211) at budgets B=24B = 24 (main text) and B=15B = 15 (Appendix D) using identical folded views and prompts.

Baselines and ablations. We compare GraphScent against six baselines—Flat BM25 (top-BB lexical candidates + rerank), BAGEL-GP (Comp256) (Kim et al., [9]) (RBF Gaussian process active search over supplied Oct 13 256-d embeddings on public_113), Oct13-Undir (score propagation on supplied Oct 13 call graphs), Static Dir-PPR (RepoAtlas-style Zhang et al., [24]) BM25-personalized directed PageRank top-BB + rerank), Undir-AST (symmetric positive propagation across all Typed-AST edges), and Fixed-Dir (uncalibrated directional search propagating fixed weight 0.50.5 (s/3s/3) strictly along parent →\to child and caller →\to callee)—plus five single-component ablations (Raw-Score, No-Gate, Rev-Dir, No-Damp, No-2Hop). We track the 3-stage funnel Found@24 →\to Top6@24 →\to PW@1 / LW Commit@1 on all 211 tasks, on BM25-Hard (best gold

BM25 rank >10> 10, n=94n = 94, and on Graph Hop ≥2\ge2 (shortest undirected Typed-AST path from BM25 top-5 to V∗V^* is ≥2\ge2 hops, n=65n = 65).

Main Localization Findings and Mechanism Decomposition

Table 5 and Figure 4 clarify what each component contributes across scales.

ScaleMethod (B=24B = 24)FoundTop6PW@1LW@1 (211)Pub / PostBM25>10 (94)Hop≥2 (65)
E4BFlat BM2569.2%57.8%29.4%39.3%39.8/38.8%3.2%12.3%
E4BStatic Dir-PPR70.1%58.3%28.4%38.9%38.1/39.8%5.3%10.8%
E4BUndir-AST70.6%58.8%29.4%35.5%33.6/37.8%4.3%9.2%
E4BFixed-Dir (uncal.)66.8%57.8%30.3%37.4%36.3/38.8%6.4%6.2%
E4BAblate: Raw-Score66.8%54.5%23.7%37.4%31.0/44.9%13.8%13.8%
E4BAblate: Rev-Dir64.0%57.3%29.9%37.0%34.5/39.8%3.2%9.2%
E4BGraphScent70.6%58.8%28.9%41.2%39.8/42.9%10.6%13.8%
12BFlat BM2569.2%63.0%35.5%39.3%37.2/41.8%9.6%16.9%
12BStatic Dir-PPR70.1%64.0%32.7%39.8%37.2/42.9%10.6%16.9%
12BUndir-AST71.6%65.4%35.1%41.7%39.8/43.9%17.0%20.0%
12BFixed-Dir (uncal.)70.1%64.9%35.1%44.1%43.4/44.9%20.2%20.0%
12BAblate: Raw-Score72.0%65.9%30.8%41.7%37.2/46.9%16.0%15.4%
12BAblate: Rev-Dir69.2%63.5%35.5%39.3%38.1/40.8%7.4%15.4%
12BGraphScent71.1%65.4%29.9%41.7%37.2/46.9%17.0%15.4%
31BFlat BM2569.2%64.5%36.0%41.7%38.9/44.9%12.8%18.5%
31BStatic Dir-PPR70.1%64.9%35.1%42.2%38.9/45.9%13.8%18.5%
31BUndir-AST74.9%68.2%36.0%41.7%39.8/43.9%17.0%15.4%
31BFixed-Dir (uncal.)74.4%67.8%35.5%43.6%42.5/44.9%20.2%20.0%
31BAblate: No-Gate75.4%69.2%36.0%44.5%46.9/41.8%24.5%23.1%
31BAblate: Rev-Dir72.0%66.4%37.0%43.1%40.7/45.9%14.9%20.0%
31BGraphScent74.9%68.7%36.0%43.6%45.1/41.8%23.4%21.5%

Table 5. Live T=0T = 0 localization funnel at budget B=24B = 24 (pooled_211: 113 public + 98 post-2025 tasks), plus panel split (Pub / Post LW@1), BM25-Hard (rank >10> 10, n=94n = 94), and Graph Hop ≥2\ge2 (dundirAST≥2d_{\mathrm{undir}}^{\mathrm{AST}} \ge2, n=65n = 65). On public_113 (E4B/12B/31B), BAGEL-GP (Comp256) achieves 34.5%/38.1%/38.9% LW@1 and Oct13-Undir achieves 31.9%/38.1%/37.2% vs. GraphScent 39.8%/37.2%/45.1%. Complete 12-mode tables for B∈{15,24}B \in\{15, 24\} appear in Appendix § 11.

Forward orientation drives non-lexical target recovery. Reversing propagation direction (Ablate: Rev-Dir: callee →\to caller, child →\to parent) lowers Found@24 at every scale (70.6% →\to 64.0% on E4B, 71.1% →\to 69.2% on 12B, 74.9% →\to 72.0% on 31B) and sharply reduces BM25-Hard LW@1 (10.6% →\to 3.2% on E4B, 17.0% →\to 7.4% on 12B, 23.4% →\to 14.9% on 31B). At 31B, GraphScent improves BM25-Hard LW@1 by +10.6 pp over Flat BM25 (23.4% vs. 12.8%, paired bootstrap 95% CI [+2.1, +19.1 pp], p=0.015p = 0.015, 14 wins vs. 4 losses) and improves Graph Hop ≥2\ge2 LW@1 to 21.5% vs. 18.5% (Flat BM25) and 15.4% (Undir-AST); reaching 26.2% under 1-hop Ablate: No-2Hop). Across all 211 tasks—where 55.5% already contain a gold node inside BM25 top-10—overall gains over Flat BM25 are naturally more modest (+1.9 to +2.4 pp).

When out-of-repository LLR calibration matters over Fixed-Dir. Comparing GraphScent against uncalibrated Fixed-Dir reveals a clear scale interaction. On E4B, where 50.9% of public_113 distractors receive S=3S = 3, uncalibrated Fixed-Dir (66.8% Found@24, 37.4% LW@1) and Ablate: Raw-Score (66.8% Found@24, 37.4% LW@1) chase false-positive callers; out-of-repository LLR calibration lifts E4B to 70.6% Found@24 and 41.2% LW@1 (+3.8 pp over Fixed-Dir; +5.7 pp over Undir-AST, 95% CI [+0.5, +10.4 pp], p=0.037p = 0.037; and +7.4 pp over Flat BM25 on BM25-Hard, p=0.033p = 0.033). Conversely, at 12B and 31B, where distractor S=3S = 3 rates fall below 18% and 10%, simple Fixed-Dir already captures most overall directional gains (44.1% on 12B, 43.6% on 31B), while GraphScent retains a +3.2 pp advantage on 31B BM25-Hard (23.4% vs. 20.2%). Similarly, Ablate: No-Gate (44.5% on 31B) indicates that once 31B’s fitted LLRs automatically assign near-zero weight to calls (ℓcalls(3)=−0.07\ell_{\mathrm{calls}}(3) = -0.07), soft LLR weighting can exploit occasional sub-threshold mirror edges without hard τ=0.55\tau= 0.55 pruning.

Candidate-pool hygiene, listwise tie-breaking, and token footprint. Tracking Found@24 → Top6@24 → LW@1 explains why symmetric Undir-AST stalls at commitment despite matching discovery (Found@24 = 70.6% on E4B, 74.9% on 31B): boosting 2.4× downstream callees inflates non-target posterior scores, dropping Undir-AST LW@1 to 35.5% (E4B) and 41.7% (31B), and 4.3% and 17.0% on BM25-Hard. Over GraphScent’s cleaner Top6@24 shortlist (40.4% vs. 24.5% Flat BM25 on 31B BM25-Hard), the single stateless listwise call improves LW@1 over pointwise PW@1 by +12.3 pp (E4B, p<0.001p < 0.001), +11.8 pp (12B, p<0.001p < 0.001), and +7.6 pp (31B, p=0.004p = 0.004). Stateless node-scoring prompts average a median of 657–691 input tokens (P90 1,266–1,323) and the top-6 listwise prompt uses a median of 2,050–2,197 tokens (P90 3,086–3,147), totaling a median of 15.2K–18.9K cumulative input tokens (∼ 225 output tokens) across 25 calls per task while keeping single-GPU VRAM at 10.42, 8.51, and 20.28 GiB.

Supporting Post-Edit Evaluation: AST Ripple Reference-File Recall

We evaluate AST Ripple retrospectively across three single-trajectory agent runs: two independent non-zero-temperature Gemma 4 31B runs on post2025_102 (Run A: 35/72 = 48.6% single-file vs. 4/30 = 13.3% multi-file resolved; Run B: 31/72 = 43.1% single-file vs. 3/30 = 10.0% multi-file) and a 42-task Gemma 4 E4B panel (35/162 = 21.6% single-file vs. 9/86 = 10.5% multi-file). On unresolved multi-file tasks where the agent’s patch missed at least one reference-patch file, AST Ripple (median 618–678 chars on 31B, 365 on E4B) surfaces a missed reference file in 50.0% (11/22) of tasks in both 31B runs and 29.6% (21/71) on E4B. A zero-shot Gemma 4 ripple judge (33 missed reference targets vs. 82 unedited neighbors across 31 tasks) ranks missed reference files at AUROC 0.647 [.56, .74] (E4B), 0.659 [.53, .77] (12B), and 0.582 [.51, .65] (31B). These measurements establish compact missed-reference-file recall rather than closed-loop test-suite improvement, which remains future work.

Related Work

Graph-guided code localization and search agents. LocAgent [1], CoSIL [6], and OrcaLoca [22] construct directed heterogeneous repository graphs (contain, invoke, inherit) navigated by multi-turn LLM agents, while LogicLoc [19], LARGER [4], SweRank [14], GREPO [17], and SWE-Explore [23] investigate neurosymbolic localization, lexical-graph retrieval, code reranking, GNN benchmarks, and exploration dynamics. Most closely related on the static-graph side, RepoAtlas [24] builds directed call and inheritance views ranked via Personalized PageRank. On the policy-learning side, A2^2 Agent [8], RepoNavigator [25], CodeScout [15], and ToolTrain [11] train multi-step search policies via reinforcement learning on corpora such as SWE-Gym [12] and SWE-smith [21], complementing workflow scaffolds like Agentless [18]. Rather than proposing directed code graphs or policy training, our work isolates which structural directions make unedited LLM relevance judgments diagnostic (parent and called_by vs. calls), evaluates Static Dir-PPR and Fixed-Dir controls directly, and demonstrates how out-of-repository calibration stabilizes small-model bounded-context search.

Bayesian active retrieval and graph belief propagation. Classical Bayesian optimal active search ([2]) and information foraging theory ([13]) formalize sequential target discovery from proximal cues. Recently, BAGEL ([9]) and ReBOL ([10]) guide dense passage retrieval by fitting query-specific Gaussian processes to sparse LLM relevance scores, while ALPER ([16]) and EoG ([5]) pair local LLM judgments with graph label or belief propagation for entity resolution and root-cause analysis. GraphScent adapts active observation to typed AST multigraphs: rather than smoothing isotropically in embedding space—where supplied 256-d competition neighbors score Scent = 0.436–0.470—it propagates empirically calibrated log-likelihood ratios selectively along positive-scent directed relations.

Discussion, Limitations, and Reproducibility

Scope and limitations. Our study has four explicit boundaries. First, all experiments cover Python repositories (211 tasks across 86 repos, excluding 20 tasks whose reference patches modify only module-level code, new symbols, or non-Python files); statically typed languages with explicit type signatures may exhibit different caller-versus-callee asymmetries. Second, we evaluate three parameter scales (E4B, 12B, 31B) of a single model family (Gemma 4) under ≤60\le60-line folded views and a fixed T=0T = 0 rubric. Third, while post2025_98 (2025–2026) has zero repository overlap with public_113, timestamps alone cannot guarantee pretraining non-exposure. Fourth, AST Ripple is evaluated on missed reference-patch file recall rather than end-to-end test-suite resolution. Appendix E also documents negative results, including rank-16 commit-patch LoRA fine-tuning—which degraded 1-hop neighbor scent (AUROC 0.570 →\to 0.536) by teaching binary rejection of unedited callers—and thinking=on, which lowered JSON parse reliability (100.0% →\to 96.0%) under bounded output budgets without improving neighbor scent.

Reproducibility and open resource. All artifacts are publicly released under Apache-2.0:

AI-assistance disclosure. In accordance with the Gemma 4 Paper Track rules, AI coding and writing assistants were used to help prototype evaluation scripts, run automated statistical verification checks, format figures and LaTeX tables, and polish prose clarity. All experimental designs, hypotheses, live model evaluations, control experiments, and scientific claims were conceived, inspected, and verified against raw experimental logs by the author.

Algorithmic Details and Folded View Construction

Runtime Typed-AST multigraph construction. For a repository snapshot, graphscent.ast_graph walks all non-test .py files (excluding tests/, test_*.py, docs/, and virtual-environment directories) via Python’s standard ast module. Every module, class, function, and async function becomes a node v∈Vv \in V keyed by relpath::QualName. Four directed edge families are extracted in O(∣V∣+∣E∣)O(|V| + |E|) time: (1) lexical containment (parent/child and induced peer sibling relations within a class); (2) resolved intra-repository calls (calls/called_by), resolving self.m() and cls.m() within uu’s class MRO, imported module/symbol aliases, and unambiguous repository-wide symbol names; (3) class inheritance (inherits) between in-repository base and derived classes; and (4) parallel method overrides (mirror) linking non-dunder methods sharing an identical name across classes related by inheritance or shared protocol interfaces.

Deterministic ≤60\le60-line folded code views. To bound per-call prompt tokens regardless of entity length, each node uu is rendered into at most 60 lines: functions/methods ≤60\le60 lines are rendered verbatim with 1-based line numbers; functions/methods >60> 60 lines retain decorators, signature, docstring, control-flow headers (if/for/while/try/except), call statements, and return/raise lines up to 60 lines; and classes >60> 60 lines (n=114n = 114 of 187 sampled parent nodes) are rendered as class skeletons preserving the class signature, class docstring, class-level attributes, and 1-line def headers of child methods.

Active search update rules. Given budget B=24B = 24, lexical scaling α=3.0\alpha= 3.0 on min-max normalized BM25 scores, exploration constant c=0.35c = 0.35, gate τ=0.55\tau= 0.55, and out-of-repository log-likelihood ratio table {ℓr(s)}\{\ell_r(s)\}:

  1. Initialize b0(v)=α BM25(q^,v)b_0(v) = \alpha\,\mathrm{BM25}(\hat q, v) for all candidate functions and classes v∈Vv \in V, visited set V0=∅\mathcal{V}_0 = \varnothing, and neighbor-visit count nvis(v)=0n_{\mathrm{vis}}(v) = 0.

  2. For t=1,…,Bt = 1, \ldots, B: select ut=arg⁡max⁡v∈V∖Vt−1[bt−1(v)+c/1+nvis(v)]u_t = \arg\max_{v \in V \setminus\mathcal{V}_{t-1}} [b_{t-1}(v) + c/\sqrt{1+n_{\mathrm{vis}}(v)}] (guarding the top-3 raw BM25 seeds within the first three probes); query the frozen local LLM at T=0T = 0 (thinking=off) on the folded view of utu_t to obtain st=S(ut)∈{0,1,2,3}s_t = S(u_t) \in\{0,1,2,3\}; add self-evidence ℓself(st)\ell_{\mathrm{self}}(s_t) to bt(ut)b_t(u_t); and for each gated relation r∈R+r \in\mathcal{R}_+ and target candidate vv standing in diagnostic relation ut→rvu_t \xrightarrow{r} v (parent →\to child, caller →\to callee, inherits, mirror, plus 0.5-weighted 2-hop class-entry edges from callers of class cc to methods m∈child⁡(c)m \in\operatorname{child}(c)), increment bt(v)b_t(v) by wr(ut→v)ℓr(st)/max⁡(1,deg⁡r(v))w_r(u_t \to v)\ell_r(s_t)/\sqrt{\max(1,\deg_r(v))} and increment nvis(v)n_{\mathrm{vis}}(v).

  3. Rank visited nodes v∈VBv \in\mathcal{V}_B by (bB(v),S(v),BM25(q,v))(b_B(v), S(v), \mathrm{BM25}(q,v)); pass the top-6 folded candidates to one stateless listwise T=0T = 0 prompt to output y^LW\hat{y}_{\mathrm{LW}} (LW Commit@1).

Out-of-Repository LLR Calibration and Threshold Sensitivity

Table 6 lists the exact Laplace-smoothed out-of-repository log-likelihood ratios ℓr(s)=log⁡[P^(S=s∣r)/P^(S=s∣far)]\ell_r(s) = \log[\widehat{P}(S = s \mid r)/\widehat{P}(S = s \mid\text{far})] fitted on public_113 (transferred zero-shot without modification to all 82 repositories in post2025_04) alongside raw distractor score histograms. On E4B, because 50.9% of far distractors receive S=3S = 3, an S=3S = 3 score on a caller receives a tempered update (+0.26), whereas S=2S = 2 (+0.69) and the absence of S=0S = 0 (−1.39-1.39) carry sharp discriminative leverage. On 12B and 31B, where far distractors receive S=0S = 0 at 64.0% and 82.7%, intermediate execution-path scores S=1S = 1 and S=2S = 2 on callers carry strong positive log-likelihood ratios (+0.70 to +1.35), while a call receives near-zero weight (−0.04-0.04 and −0.07-0.07 at S=3S = 3). Across leave-one-repository-out folds on public_113 and across gate thresholds τ∈{0.52,0.55,0.58}\tau\in\{0.52, 0.55, 0.58\}, parent and called_by are selected into R+\mathcal{R}_+ in 14/15 scale-threshold combinations (100% at default τ=0.55\tau= 0.55), whereas calls and knear_comp256 are excluded in 15/15 combinations.

ScaleRelation / DistributionScentpub\mathrm{Scent}_{\mathrm{pub}}s=0s=0s=1s=1s=2s=2s=3s=3
E4BP^(S=s∣far) (n=678)\widehat{P}(S=s\mid\mathrm{far})\ (n=678)0.50028.2%17.6%3.4%50.9%
E4Bparent ℓparent(s)\ell_{\mathrm{parent}}(s)0.598−0.46-0.46−0.77-0.77+0.39+0.39+0.31+0.31
E4Bcalled_by ℓcalled_by(s)\ell_{\mathrm{called\_by}}(s)0.613−1.39-1.39+0.13+0.13+0.69+0.69+0.26+0.26
E4Binherits ℓinherits(s)\ell_{\mathrm{inherits}}(s)0.600−0.34-0.34−0.57-0.57+1.74+1.74−0.01-0.01
E4Bcalls ℓcalls(s)\ell_{\mathrm{calls}}(s) (excluded)0.462−0.04-0.04+0.49+0.49+0.25+0.25−0.24-0.24
12BP^(S=s∣far) (n=678)\widehat{P}(S=s\mid\mathrm{far})\ (n=678)0.50064.0%15.5%3.1%17.4%
12Bparent ℓparent(s)\ell_{\mathrm{parent}}(s)0.684−0.65-0.65−0.27-0.27+0.83+0.83+1.00+1.00
12Bcalled_by ℓcalled_by(s)\ell_{\mathrm{called\_by}}(s)0.683−0.86-0.86+0.70+0.70+0.92+0.92+0.65+0.65
12Bmirror ℓmirror(s)\ell_{\mathrm{mirror}}(s)0.582−0.37-0.37+0.55+0.55+0.82+0.82+0.23+0.23
12Bcalls ℓcalls(s)\ell_{\mathrm{calls}}(s) (excluded)0.478+0.07+0.07−0.34-0.34+0.13+0.13−0.04-0.04
31BP^(S=s∣far) (n=678)\widehat{P}(S=s\mid\mathrm{far})\ (n=678)0.50082.7%6.5%1.2%9.6%
31Bparent ℓparent(s)\ell_{\mathrm{parent}}(s)0.696−0.58-0.58−0.80-0.80+1.50+1.50+1.54+1.54
31Bcalled_by ℓcalled_by(s)\ell_{\mathrm{called\_by}}(s)0.651−0.48-0.48+1.35+1.35+0.72+0.72+0.78+0.78
31Binherits ℓinherits(s)\ell_{\mathrm{inherits}}(s)0.652−0.72-0.72+1.51+1.51+2.03+2.03+0.73+0.73
31Bcalls ℓcalls(s)\ell_{\mathrm{calls}}(s) (excluded)0.478+0.05+0.05−0.70-0.70−0.07-0.07−0.07-0.07

Table 6. Fitted Laplace-smoothed log-likelihood ratios ℓr(s)\ell_r(s) for s∈{0,1,2,3}s\in\{0,1,2,3\} on public_113 (used zero-shot on post2025_98) and empirical far-distractor score distributions across Gemma 4 scales.

Detailed Confound, Masked-Parent, and Lexical-Stratum Controls

Table 7 breaks down the zero-leakage and lexical-overlap controls across public_113 and post2025_98 and across three BM25 lexical-similarity strata (BM25 <0.20<0.20, [0.20, 0.45), and $\ge 0.45). Across every panel and every BM25 band, called_by outranks calls (AUROC >0.55>0.55 in all nine scale-by-stratum cells) and outranks far distractors within matched BM25 bands (AUROC 0.650–0.756). Because far distractors are drawn from top-BM25 candidates (mean BM25 = 0.634 vs. 0.308 for called_by), the unstratified Scent(called_by) = 0.600–0.641 in Table 3 is a conservative lower bound.

Control Subset / StratumCountsE4B12B31B
public_113: Original parent vs. far131 vs. 6780.598 [0.55, 0.65]0.684 [0.63, 0.75]0.696 [0.64, 0.75]
public_113: parent_gold_masked vs. far131 vs. 6780.612 [0.55, 0.66]0.673 [0.62, 0.73]0.675 [0.62, 0.73]
public_113: parent_header_doc vs. far131 vs. 6780.613 [0.56, 0.67]0.685 [0.62, 0.75]0.714 [0.66, 0.77]
post2025_98: Original parent vs. far56 vs. 5880.688 [0.61, 0.77]0.768 [0.69, 0.85]0.775 [0.70, 0.85]
post2025_98: parent_gold_masked vs. far56 vs. 5880.688 [0.60, 0.78]0.753 [0.67, 0.84]0.764 [0.69, 0.84]
post2025_98: parent_header_doc vs. far56 vs. 5880.689 [0.61, 0.78]0.776 [0.70, 0.86]0.764 [0.69, 0.84]
Low BM25 (<0.20<0.20): called_by vs. calls119 vs. 2620.633 [0.57, 0.69]0.625 [0.57, 0.68]0.597 [0.55, 0.64]
Mid BM25 ([0.20, 0.45)): called_by vs. calls120 vs. 700.606 [0.53, 0.68]0.599 [0.52, 0.68]0.569 [0.49, 0.65]
High BM25 (≥0.45\ge0.45): called_by vs. calls58 vs. 400.554 [0.45, 0.65]0.566 [0.47, 0.66]0.563 [0.44, 0.67]
Mid BM25 ([0.20, 0.45)): called_by vs. far120 vs. 2910.679 [0.62, 0.74]0.722 [0.66, 0.78]0.703 [0.64, 0.76]
High BM25 (≥0.45\ge0.45): called_by vs. far58 vs. 9640.650 [0.60, 0.70]0.756 [0.70, 0.81]0.756 [0.69, 0.82]
OLS β^BM25/β^len0 (n=669)\hat{\beta}_{\mathrm{BM25}}/\hat{\beta}_{\mathrm{len0}}\ (n=669)—+1.07/−0.13+1.07/-0.13+1.57/+0.10+1.57/+0.10+1.53/+0.03+1.53/+0.03

Table 7. Panel-by-panel zero-leakage masked-parent controls and BM25-stratified span-disjoint called_by controls across E4B, 12B, and 31B.

Complete 12-Method Localization Funnel, Budgets, and Per-Repository Breakdown

Table 8 reports all 10 pooled methods (12 on public_113 including BAGEL-GP and Oct13–Undir) across E4B, 12B, and 31B at both B=24B=24 and B=15B=15, including loose file/enclosing-scope commitment (LW-Loose), undirected graph multi-hop (dASTundir≥2d_{\mathrm{AST}}^{\mathrm{undir}}\ge2, n=65n=65), and directed positive-scent multi-hop (dASTdir≥2d_{\mathrm{AST}}^{\mathrm{dir}}\ge2, n=72n=72). Table 9 reports paired bootstrap differences, 95% CIs, and task-level Win/Loss/Tie counts, and Table 10 breaks down public_113 by repository at natural column widths.

Repository (nn)ScaleFlat BM25BAGEL-GPUndir-ASTFixed-DirGraphScent
fastapi/fastapi (56)E4B35.7%32.1%33.9%30.4%35.7%
12B30.4%33.9%35.7%35.7%37.5%
31B32.1%32.1%33.9%33.9%37.5%
Textualize/rich (44)E4B40.9%31.8%27.3%36.4%38.6%
12B40.9%38.6%38.6%47.7%29.5%
31B40.9%38.6%40.9%47.7%50.0%
psf/requests (12)E4B50.0%50.0%50.0%58.3%58.3%
12B50.0%50.0%58.3%58.3%58.3%
31B58.3%66.7%58.3%58.3%58.3%

Table 10. Per-repository LW Commit@1 (B=24B = 24) across the four repositories in public_113 (encode/httpx, n=1n = 1, is solved at 100.0% by every method across all three scales).

ScaleMethodF@24T6@24PW@24LW@24LW-LooseF@15LW@15BM25>10HopU / HopD
E4BFlat BM2569.2%57.8%29.4%39.3%46.9%63.5%38.4%3.2%12.3/9.7%
E4BStatic Dir-PPR70.1%58.3%28.4%38.9%45.5%62.6%37.4%5.3%10.8/8.3%
E4BUndir-AST70.6%58.8%29.4%35.5%41.7%61.1%34.6%4.3%9.2/8.3%
E4BFixed-Dir66.8%57.8%30.3%37.4%42.2%64.0%38.4%6.4%6.2/5.6%
E4BAblate: Raw-Score66.8%54.5%23.7%37.4%39.8%62.6%40.8%13.8%13.8/12.5%
E4BAblate: No-Gate70.6%58.3%25.6%40.8%43.6%62.6%38.9%10.6%15.4/12.5%
E4BAblate: Rev-Dir64.0%57.3%29.9%37.0%44.1%58.8%35.1%3.2%9.2/6.9%
E4BAblate: No-Damp71.1%59.2%28.0%42.2%44.6%64.5%38.9%13.8%13.8/11.1%
E4BAblate: No-2Hop70.6%58.3%28.0%40.8%44.1%64.9%39.3%10.6%13.8/11.1%
E4BGraphScent70.6%58.8%28.9%41.2%44.6%64.9%38.9%10.6%13.8/11.1%
12BFlat BM2569.2%63.0%35.5%39.3%48.3%63.5%37.9%9.6%16.9/15.3%
12BStatic Dir-PPR70.1%64.0%32.7%39.8%47.9%62.6%36.0%10.6%16.9/13.9%
12BUndir-AST71.6%65.4%35.1%41.7%47.4%65.9%40.3%17.0%20.0/20.8%
12BFixed-Dir70.1%64.9%35.1%44.1%47.9%65.4%41.2%20.2%20.0/16.7%
12BAblate: Raw-Score72.0%65.9%30.8%41.7%46.0%65.4%40.3%16.0%15.4/15.3%
12BAblate: No-Gate70.6%65.4%29.9%43.1%46.9%64.5%41.2%19.1%20.0/19.4%
12BAblate: Rev-Dir69.2%63.5%35.5%39.3%46.9%63.0%38.9%7.4%15.4/16.7%
12BAblate: No-Damp71.1%63.5%30.8%40.8%44.1%66.4%42.7%13.8%13.8/13.9%
12BAblate: No-2Hop72.0%64.9%29.4%42.2%45.5%66.4%41.7%16.0%15.4/13.9%
12BGraphScent71.1%65.4%29.9%41.7%44.6%65.9%40.8%17.0%15.4/15.3%
31BFlat BM2569.2%64.5%36.0%41.7%52.1%63.5%40.3%12.8%18.5/18.1%
31BStatic Dir-PPR70.1%64.9%35.1%42.2%52.6%62.6%40.8%13.8%18.5/18.1%
31BUndir-AST74.9%68.2%36.0%41.7%48.8%69.7%44.1%17.0%15.4/16.7%
31BFixed-Dir74.4%67.8%35.5%43.6%48.8%68.7%44.1%20.2%20.0/19.4%
31BAblate: Raw-Score74.9%67.3%38.4%44.1%48.8%68.7%43.1%22.3%21.5/20.8%
31BAblate: No-Gate75.4%69.2%36.0%44.5%49.8%66.4%42.2%24.5%23.1/20.8%
31BAblate: Rev-Dir72.0%66.4%37.0%43.1%53.1%63.5%41.2%14.9%20.0/22.2%
31BAblate: No-Damp73.0%67.3%35.1%44.1%48.3%66.4%41.7%25.5%21.5/19.4%
31BAblate: No-2Hop75.4%68.2%36.0%44.5%49.8%66.8%43.6%25.5%26.2/23.6%
31BGraphScent74.9%68.7%36.0%43.6%48.3%66.8%42.7%23.4%21.5/19.4%

Table 8. Complete live T=0T = 0 localization results across all methods and single-component ablations on pooled_211 at B=24B = 24 and B=15B = 15.

ScalePaired Comparison (B=24B = 24)Subset (nn)Δ\Delta (pp) [95% CI]W / L / Tpp-val
E4BGraphScent LW vs. Undir-AST LWAll (211)+5.7 [+0.5, +10.4]22/10/1790.037
E4BGraphScent LW vs. Fixed-Dir LWAll (211)+3.8 [−0.9, +8.5]17/9/1850.126
E4BGraphScent LW vs. Rev-Dir LWAll (211)+4.3 [+0.0, +8.5]16/7/1880.073
E4BGraphScent LW vs. Flat BM25 LWBM25>10 (94)+7.4 [+1.1, +13.8]9/2/830.033
E4BGraphScent LW vs. GraphScent PWAll (211)+12.3 [+6.2, +18.5]37/11/163< 0.001
12BGraphScent LW vs. Flat BM25 LWBM25>10 (94)+7.4 [−1.1, +16.0]13/6/750.119
12BGraphScent LW vs. Fixed-Dir LWAll (211)−2.4 [−6.6, +1.9]8/13/1900.346
12BGraphScent LW vs. GraphScent PWAll (211)+11.8 [+6.2, +17.5]32/7/172< 0.001
31BGraphScent LW vs. Flat BM25 LWBM25>10 (94)+10.6 [+2.1, +19.1]14/4/760.015
31BGraphScent LW vs. Undir-AST LWBM25>10 (94)+6.4 [−2.1, +14.9]12/6/760.182
31BGraphScent LW vs. Fixed-Dir LWBM25>10 (94)+3.2 [−4.3, +10.6]8/5/810.475
31BGraphScent LW vs. GraphScent PWAll (211)+7.6 [+2.4, +13.3]24/8/1790.004

Table 9. Key paired bootstrap comparisons (2,000 resamples) for GraphScent at B=24B = 24 on pooled_211, reporting exact task-level Wins / Losses / Ties and two-sided bootstrap pp-values.

Negative Results and Design Explorations

Several plausible hypotheses failed during our investigation; reporting them clarifies why GraphScent adopts frozen T=0T = 0 (thinking=off) scoring over typed AST relations.

Supervised LoRA fine-tuning on commit patches suppresses neighbor scent. We trained a rank-16 LoRA adapter on Gemma 4 31B using historical issue-to-patch relevance labels (S=3S = 3 strictly for edited functions and S=0S = 0 for unedited functions). Evaluating 1,540 nodes on public_113 (Table 11), LoRA slightly lowered direct gold vs. far AUROC (0.713 → 0.704) and significantly degraded 1-hop structural neighbor scent (AUROC(near vs. far) fell from 0.570 [.53, .61] to 0.536 [.51, .56], and embedding-neighbor scent fell from 0.497 to 0.465). Training binary target classifiers teaches the LLM to suppress high scores on unedited callers, eroding the proximal cue required for multi-hop navigation.

31B Judge VariantJSON Parsegold vs. far1-Hop AST vs. farknear vs. far
Frozen 31B (thinking=off)100.0%0.713 [.66, .76]0.570 [.53, .61]0.497 [.46, .53]
Frozen 31B (thinking=on)96.0%0.731 [.68, .78]0.567 [.53, .61]0.522 [.48, .56]
Patch-LoRA (thinking=off)100.0%0.704 [.66, .75]0.536 [.51, .56]0.465 [.44, .49]

Table 11. Controlled comparison on 1,540 public_113 nodes across frozen Gemma 4 31B (thinking=off), thinking=on, and rank-16 commit-patch LoRA fine-tuning.

Chain-of-thought (thinking=on) vs. direct scoring (thinking=off). Enabling thinking=on on 31B modestly increased direct gold vs. far AUROC (0.713 → 0.731), left 1-hop structural neighbor scent unchanged (0.570 → 0.567), lowered strict JSON parse completion from 100.0% (1540/1540) to 96.0% (1479/1540) under bounded output caps, and increased output-token latency by > 6×. Direct T=0T = 0 scoring (thinking=off) is therefore strictly preferable for inner-loop node probing.

Historical git cochange and supplied 256-d embeddings. Neither mining commit history for frequently co-edited entities (cochange: Scent = 0.463–0.498) nor propagating Gaussian-process beliefs over the benchmark’s 256-d embeddings (knear_comp256: Scent = 0.436–0.470; BAGEL-GP 38.9% vs. 45.1% GraphScent at 31B) improved over Flat BM25 (38.9%).

Token Accounting, Hardware Footprint, and Prompt Templates

Table 12: Exact prompt-token distributions and single-GPU VRAM footprints across Gemma 4 scales (B=24B = 24, 25 stateless calls per task, max_tokens=32 output cap per call).

Model (w4a16)VRAMNode Med / P90LW Med / P90Cum. In (Med / Mean / P90)Cum. Out
Gemma 4 E4B10.42 GiB657/1,2662,197/3,14218,886/22,404/35,603∼225\sim225
Gemma 4 12B8.51 GiB669/1,2952,116/3,08618,309/21,682/35,119∼225\sim225
Gemma 4 31B20.28 GiB691/1,3232,050/3,14715,211/18,162/32,867∼225\sim225

Table 12. Exact prompt-token distributions and single-GPU VRAM footprints across Gemma 4 scales (B=24B = 24, 25 stateless calls per task, max_tokens=32 output cap per call).

Verbatim stateless node-scoring prompt (T=0T = 0, thinking=off, max_tokens=32).

You are a software bug localization judge. Given a GitHub issue and a folded view
of ONE Python entity from the repository, rate bug relevance on {0,1,2,3}:
3 = Root-cause defect requiring modification is directly in this node.
2 = Strongly involved or an immediate caller/enclosing scope of the defect.
1 = On the broader execution path or loosely related module, unlikely edited.
0 = Unrelated to the issue.
Respond ONLY with JSON: {"score": <0|1|2|3>}

Verbatim top-6 listwise commitment prompt (T=0T = 0, thinking=off, max_tokens=32).

You are selecting the single primary code entity that must be edited to resolve the
GitHub issue below. Six candidate entities [0..5] found by repo search
are shown with their folded code views. Respond ONLY with JSON: {"best_idx": <0..5>}

References

  1. [1]Zhaoling Chen, Xiangru Tang, Gangda Deng, Fang Wu, Jialong Wu, Zhiwei Jiang, Viktor Prasanna, Arman Cohan, and Xingyao Wang. LocAgent: Graph-guided LLM agents for code localization. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (ACL), 2025. arXiv:2503.09089.arxiv.org/abs/2503.09089
  2. [2]Roman Garnett, Yamuna Krishnamurthy, Yuehan Xiong, Jeff Schneider, and Richard Mann. Bayesian optimal active search and surveying. In Proceedings of the 29th International Conference on Machine Learning (ICML), 2012.arxiv.org/abs/1206.6406
  3. [3]Gemma Team. Gemma 4 technical report. arXiv preprint arXiv:2607.02770, 2026.
  4. [4]Yuntong Hu, Tongli Su, Liang Zhao, Bowen Zhu, and Hasibul Haque. LARGER: Lexically anchored repository graph exploration and retrieval. arXiv preprint arXiv:2605.16352, 2026.arxiv.org/abs/2605.16352
  5. [5]Saurabh Jha, Rohan Arora, Bhavya, Noah Zheutlin, Paulina Toro Isaza, Laura Shwartz, Yu Deng, Daby Sow, Ruchi Mahindru, and Ruchir Puri. Think locally, explain globally: Graph-guided LLM investigations via local reasoning and belief propagation. arXiv preprint arXiv:2601.17915, 2026.arxiv.org/abs/2601.17915
  6. [6]Zhonghao Jiang, Xiaoxue Ren, Meng Yan, Wei Jiang, Yong Li, and Zhongxin Liu. CoSIL: Software issue localization via LLM-driven code repository graph searching. arXiv preprint arXiv:2503.22424, 2025.arxiv.org/abs/2503.22424
  7. [7]Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations (ICLR), 2024. arXiv:2310.06770.arxiv.org/abs/2310.06770
  8. [8]Doyeon Kim, Suyoung Bae, Yumin Lee, and Jee-Hyong Lee. A² Agent: Action-aware reinforcement learning for repository-level code localization agents. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2026a. arXiv:2608.29831.arxiv.org/abs/2608.29831
  9. [9]Junyoung Kim, Anton Korikov, Jiazhou Liang, Justin Cui, Yifan Simon Liu, Qianfeng Wen, Mark Zhao, and Scott Samner. BAGEL: Bayesian active learning with gaussian processes guided by LLM relevance scoring for dense passage retrieval. In Findings of the Association for Computational Linguistics: ACL 2026, 2026b. arXiv:2604.17906.DOI
  10. [10]Anton Korikov and Scott Sanner. ReBOL: Retrieval via bayesian optimization with batched LLM relevance observations and query reformulation. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2026. arXiv:2603.20513.arxiv.org/abs/2603.20513
  11. [11]Zexiong Ma, Chao Peng, Qunhong Zeng, Pengfei Gao, Yanzhen Zou, and Bing Xie. Tool-integrated reinforcement learning for repo deep search. arXiv preprint arXiv:2508.03012, 2025.arxiv.org/abs/2508.03012
  12. [12]Jiayi Pan, Xingyao Wang, Graham Neubig, Navdeep Jaitly, Heng Ji, Alane Suhr, and Yizhe Zhang. Training software engineering agents and verifiers with SWE-Gym. In Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025. arXiv:2412.21139.arxiv.org/abs/2412.21139
  13. [13]Peter Pirolli and Stuart Card. Information foraging. Psychological Review, 106(4):643–675, 1999.
  14. [14]Revanth Gangi Reddy, Tarun Suresh, JaeHyeok Doo, Ye Liu, Xuan Phi Nguyen, Yingbo Zhou, Semih Yavuz, Caiming Xiong, Heng Ji, and Shafiq Joty. SweRank: Software issue localization with code ranking. In International Conference on Learning Representations (ICLR), 2026. arXiv:2505.07849.arxiv.org/abs/2505.07849
  15. [15]Lintang Sutawika, others, and Graham Neubig. CodeScout: An effective recipe for reinforcement learning of code search agents. arXiv preprint arXiv:2603.17829, 2026.arxiv.org/abs/2603.17829
  16. [16]Hongtao Wang, Renchi Yang, Haoran Zheng, and Xiangyu Ke. Adaptive graph refinement and label propagation with LLMs for cost-effective entity resolution. In Proceedings of the ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), 2026a. arXiv:2605.25814.arxiv.org/abs/2605.25814
  17. [17]Juntong Wang, Libin Chen, Xiyuan Wang, Shijia Kang, Haotong Yang, Da Zheng, and Muhan Zhang. GREPO: A benchmark for graph neural networks on repository-level bug localization. arXiv preprint arXiv:2602.13921, 2026b.arxiv.org/abs/2602.13921
  18. [18]Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. Agentless: Demystifying LLM-based software engineering agents. arXiv preprint arXiv:2407.01489, 2024.arxiv.org/abs/2407.01489
  19. [19]Xiufeng Xu, Xiuheng Wu, Zejun Zhang, and Yi Li. LogicLoc: Neurosymbolic repo-level code localization. arXiv preprint arXiv:2604.16021, 2026.arxiv.org/abs/2604.16021
  20. [20]John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. SWE-agent: Agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems (NeurIPS), 2024. arXiv:2405.15793.arxiv.org/abs/2405.15793
  21. [21]John Yang, Kilian Lieret, Carlos E. Jimenez, Alexander Wettig, Kabir Khandpur, Yanzhe Zhang, Binyuan Hui, Ofir Press, Ludwig Schmidt, and Diyi Yang. SWE-smith: Scaling data for software engineering agents. In Advances in Neural Information Processing Systems (NeurIPS) Datasets and Benchmarks Track, 2025. arXiv:2504.21798.arxiv.org/abs/2504.21798
  22. [22]Zhongming Yu, Hejia Zhang, Yujie Zhao, Hanxian Huang, Matrix Yao, Ke Ding, and Jishen Zhao. OrcaLoca: An LLM agent framework for software issue localization. In Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025. arXiv:2502.00350.arxiv.org/abs/2502.00350
  23. [23]Shaoqiu Zhang, Yuhang Wang, Jialiang Liang, Yuling Shi, Wenhao Zeng, Maoquan Wang, Shilin He, Ningyuan Xu, Siyu Ye, Kai Cai, and Xiaodong Gu. SWE-Explore: Benchmarking how coding agents explore repositories. arXiv preprint arXiv:2606.07297, 2026a.arxiv.org/abs/2606.07297
  24. [24]Yunxiang Zhang, Haiquan Wang, Jiawei Guo, Hanyang Xia, Yan Chen, Tong Chen, Zhiwei Zhang, and Junchen Ye. RepoAtlas: Guiding coding agents via evolving multimodal repository views. arXiv preprint arXiv:2609.16936, 2026b.arxiv.org/abs/2609.16936
  25. [25]Zhaoxi Zhang et al. One tool is enough: Reinforcement learning for repository-level LLM agents. arXiv preprint arXiv:2512.20957, 2025.arxiv.org/abs/2512.20957

Paper details

vlnc:W_mxfqq9hj
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents