Paper commentary
GraphScent: Calibrating Directional Relevance Signals for Bounded-Context Code Localization
- Problem A frozen local judge scores one candidate at a time from a 60-line view, so the open question is which graph neighbours make its score informative about a repair target that the judge has not read.
- Method Calibrated log-likelihood ratios from other repositories are propagated only along parent-to-child and caller-to-callee edges of a Typed-AST multigraph, and a single listwise call picks the final edit target.
- Results At budget 24 on the 31B model, BM25-Hard LW@1 rises to 23.4% against 12.8% for Flat BM25.

Figure 3 :System architecture of GraphScent and AST Ripple.Stage 0 parses repository Python files into a directed Typed-AST multigraph (median 0.17s on CPU) and initializes lexical BM25 log-beliefs. Offline out-of-repository calibration fits ordinal log-likelihood ratios ℓr(s) and gates propagation to R+ ={r: Scent cal(r)≥0.55} (parent→child , caller→callee ). Stage 1 executes B= 24 stateless T= 0 folded-view probes (<21.5GiB 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(∼160tokens) to surface unedited callers and overrides.
Original paper · CC BY 4.0 · Ramesh Arvind Naagarajan · GraphScent: Calibrating Directional Relevance Signals for Bounded-Context Code Localization · Original paper figure · Extracted the figure area from page 8 of the original PDF.Why bounded context changes the search problem
Local software-engineering agents are limited by GPU memory, and the context length of each call decides whether the model fits on a single 24 GB card. Gemma 4 E4B, 12B and 31B, quantized to 4-bit with quantization-aware training, occupy 10.42GiB, 8.51GiB and 20.28GiB including captured CUDA graphs, and they fit as long as each call stays under 4.5K prompt tokens.
Multi-turn scaffolds keep appending file reads and search output to one growing history, which consumes VRAM and lets early navigation errors carry into later steps.
The study moves the exploration burden to an external controller that picks one candidate function or class per step. Each candidate is shown as a folded view of at most 60 lines, and a frozen local model returns an ordinal judgment S(u) in {0,1,2,3}. The central question is which structure connects an entity that is not itself the repair target to a nearby target, so that reading the entity says something about that target.
Graph-based agents navigate directed heterogeneous code graphs, and RepoAtlas ranks directed call and inheritance views with Personalized PageRank. Active retrieval methods such as BAGEL and ReBOL instead spread sparse LLM scores through Gaussian processes over dense passage embeddings. The authors argue that static centrality ignores what the model reads, and that symmetric propagation treats evidence as decaying equally in every direction.
Two disjoint repository panels
The evaluation pools a public panel of 113 entity-localized tasks with a temporally held-out panel of 98 tasks, giving 211 tasks across 86 repositories. The public panel comes from a competition release of 129 issues in four repositories: fastapi/fastapi with 56 localized tasks, Textualize/rich with 44, psf/requests with 12 and encode/httpx with 1.
Sixteen of those 129 tasks were dropped, because their reference patches touch only module-top-level code, add new top-level symbols, or change only documentation, tests or non-Python files.
The held-out panel collects 102 issues from 84 repositories that share no repository with the public panel. The same entity-mapping rule leaves 98 tasks across 82 repositories, because four tasks modify only module-level statements or add symbols outside existing definitions. Every timestamp falls between 2025-01-02 and 2026-05-11, and the authors decline to call this guaranteed exclusion from pretraining, since model documentation gives no per-commit cutoffs.
A zero-context probe asked each model for up to five buggy file paths from the repository name and issue text alone. On unnamed issues in the held-out panel, the three scales recovered a gold path in 3.2%, 9.5% and 11.1% of tasks, which the authors read as evidence that active repository search is needed.
Why static graph structure is not enough
The supplied Oct 13 call graphs hold 460,018 edge records. After removing 2,598 self-loops and 96 duplicate records, every remaining non-self pair appears in both directions under a single calls label, so the direction of a call is lost.
27.3% of candidate entities have degree zero, and the share reaches 44.3% in fastapi, where decorator-registered route handlers have no explicit Python callers. Personalized PageRank seeded by BM25 over these graphs lowers MRR from 0.174 to 0.083.
The authors rebuild the graph from the repository files with Python's ast module, which takes a median of 0.17s per repository on CPU and a P90 of 1.48s. The rebuilt graph connects 100.0% of candidates, and 83.42% and 83.74% of candidates on the two panels connect through non-containment edges alone. Within 2 undirected hops of BM25 top-5 lie 81.4% (92/113) of the public gold targets.
Even on the rebuilt graph, Personalized PageRank does not beat BM25 without LLM calls: the undirected variant reaches MRR 0.268 and the directed variant 0.205, against 0.357 for BM25 on pooled_211. The authors conclude that repository topology helps localization only when it is paired with live semantic judgments.
Measuring how a neighbour's score separates from distractors
The judge receives the issue text and the folded view of one entity at temperature zero with thinking turned off. Its four levels are 3 when the defect lies inside the entity, 2 when the entity is likely involved or directly adjacent, 1 when it lies on the execution path, and 0 when it is unrelated.
To judge a relation, the authors compare scores on unedited neighbours of the ground-truth edit set with scores on hard distractors, which are top BM25 non-gold candidates at undirected AST distance of 3 or more from that set. The scent is an AUROC-style probability with ties counted as one half, written as \[ \mathrm{Scent}(r)=\Pr\!\left[S(u_r)>S(u_{\mathrm{far}})\right]+\tfrac{1}{2}\Pr\!\left[S(u_r)=S(u_{\mathrm{far}})\right] \] A value of 0.50 means no discrimination beyond lexical similarity, values above 0.50 mean the neighbour points toward the edit set, and values below 0.50 mean the neighbour is ranked under the distractors.
The relation called_by holds when an unedited entity calls some ground-truth target, while calls holds when a ground-truth target calls the unedited entity. The parent relation links an entity to its enclosing scope. On public_113 the authors also score git co-modification history, nearest neighbours in the 256-d competition embeddings and nearest neighbours in Qwen3-Embedding-0.6B, with 1,000-resample task-cluster bootstrap intervals.
Where the directional signal appears
On pooled_211, parent scores 0.643, 0.713 and 0.719 for E4B, 12B and 31B, and called_by scores 0.600, 0.641 and 0.623, with every called_by confidence interval strictly above 0.56. Table 3 lists the per-scale confidence intervals for each relation and the panel split.
The downstream calls relation sits at 0.477, 0.483 and 0.487, at or just below the distractor baseline, even though its per-target multiplicity is 2.4 times that of callers. Peer methods, cochange history and the supplied 256-d embeddings also stay near chance, while Qwen3-Embedding-0.6B neighbours reach 0.541 to 0.565.
The score histograms show E4B giving S=3 to 50.9% of public distractors and 26.5% of held-out distractors, against 17.4% and 9.9% for 12B and 9.6% and 7.5% for 31B. Even with that false-positive rate, E4B separates called_by from far at AUROC 0.600, because it gives S=0 to true callers much less often, at 6.6% against 28.2% for distractors on public_113.
The authors use this to motivate full ordinal likelihood calibration in place of raw-score propagation.
Ruling out leakage and lexical overlap
Short enclosing classes can display the body of an edited child method, so the authors re-score 187 parent nodes under two masking schemes. Masking gold child lines gives parent AUROC of 0.654, 0.700 and 0.700, and stripping all method bodies gives 0.654, 0.716 and 0.728 across the three scales.
Far distractors have a mean normalized BM25 of 0.634, against 0.308 for called_by, while their folded lengths are nearly the same, 38.5 and 38.7 lines. Restricting to zero-span-overlap nodes, 297 callers against 372 callees, the called_by versus calls AUROC is 0.630, 0.652 and 0.629.
An OLS regression of S(u) on a caller indicator, controlling for BM25 similarity and snippet length on n=669 entities, gives positive caller slopes of +0.471, +0.344 and +0.221 across the three scales. The authors attribute the caller advantage to callers acting as user-facing entrypoints that delegate to defective routines, while downstream utilities look self-contained when read alone.
How GraphScent builds and updates beliefs
GraphScent first builds a runtime graph whose nodes are modules, classes, functions and methods, each keyed by file path and qualified name. Four edge families connect the nodes: lexical containment, resolved intra-repository calls, class inheritance and same-name method overrides, with calls resolved through the class MRO and import aliases.
The pipeline is shown in the system diagram.
Each candidate starts with a log-belief set from its normalized BM25 score scaled by alpha equal to 3.0, and the exploration constant c is 0.35 over a budget of 24 probes. The first three probes are guarded so that the top three raw BM25 seeds are visited. At each step the unvisited candidate with the highest belief plus an exploration bonus is queried, written as \[ u_t=\arg\max_{v\in V\setminus V_{t-1}}\left[b_{t-1}(v)+\frac{c}{\sqrt{1+n_{\mathrm{vis}}(v)}}\right] \]
Ordinal likelihoods are estimated with Laplace smoothing from public_113 under leave-one-repository-out folds, and one table is then applied zero-shot to the held-out panel. The log-likelihood ratio for each relation is \[ \ell_r(s)=\log\frac{\hat P_{\mathrm{cal}}(S=s\mid \mathrm{rel}=r)}{\hat P_{\mathrm{cal}}(S=s\mid \mathrm{rel}=\mathrm{far})} \] so each score level adds evidence in proportion to how much more often a true neighbour produces it than a distractor does.
A gate keeps relations whose calibrated scent reaches 0.55, which selects parent and called_by in every fold and rejects calls and sibling at thresholds of 0.52, 0.55 and 0.58.
After a probe on node u_t returns s_t, the belief update is \[ b_t(v)=b_{t-1}(v)+\ell_{\mathrm{self}}(s_t)\,\mathbb{I}[v=u_t]+\sum_{r\in R_+}\frac{w_r(u_t\to v)\,\ell_r(s_t)}{\sqrt{\max(1,\deg_r(v))}} \] The self term touches only the probed node, while each gated neighbour receives a term divided by the square root of its degree, so high-degree neighbours receive smaller updates.
Propagation runs only in the parent-to-child and caller-to-callee directions, and the cache is reset after every call.
The judge stays frozen and is not trained; the calibration table is fitted offline, and each probe is a stateless call on a single GPU under 21.5 GiB.
Committing to one target and checking co-edits
Four-level ordinal scores tie often, so a pointwise argmax breaks ties arbitrarily. After the probes, the six highest-ranked visited candidates go into one stateless listwise prompt, which has a median of 2.1K and a P90 of 3.1K input tokens.
AST Ripple runs after a draft patch: it extracts the modified function and class signatures, queries the graph for unedited direct callers and overrides in other files, and formats an alert of at most 900 characters, about 160 tokens.
Localization funnel at budget 24
Overall gains over Flat BM25 are modest, between +1.9 and +2.4pp, because 55.5% of tasks already have a gold node in the BM25 top-10.
On BM25-Hard, which keeps tasks whose gold ranks beyond 10 in BM25, the 31B GraphScent reaches 23.4% LW@1 against 12.8% for Flat BM25. The paired bootstrap gives a 95% interval of +2.1 to +19.1pp, p=0.015, with 14 wins against 4 losses. Against Fixed-Dir on the same subset, 31B leads by 3.2pp, 23.4% against 20.2%, and the authors note that Fixed-Dir already captures most of the overall directional gain at 12B and 31B.
The calibration matters most for E4B, where GraphScent lifts overall LW@1 by 5.7pp over Undir-AST, with a 95% interval of +0.5 to +10.4pp and p=0.037. Undir-AST reaches about the same discovery rate but stalls at commitment, with E4B LW@1 at 35.5%, because boosting downstream callees inflates scores on non-targets.
The listwise commit raises LW@1 over pointwise PW@1 by +12.3pp for E4B (p<0.001), +11.8pp for 12B (p<0.001) and +7.6pp for 31B (p=0.004).
Reversing the edge direction lowers Found@24 at every scale and cuts BM25-Hard LW@1 from 10.6% to 3.2% on E4B, from 17.0% to 7.4% on 12B and from 23.4% to 14.9% on 31B.
Evidence for AST Ripple
A zero-shot Gemma 4 ripple judge ranked missed reference files at AUROC 0.647 for E4B, 0.659 for 12B and 0.582 for 31B. The authors frame this as recall of missed reference-patch files, not as closed-loop test-suite resolution.
Fine-tuning and thinking mode trade-offs
A rank-16 LoRA adapter trained on historical issue-to-patch labels slightly lowered gold-versus-far AUROC for 31B, from 0.713 to 0.704. The more consequential drop is in 1-hop neighbour scent, which fell from 0.570 to 0.536, and in embedding-neighbour scent, which fell from 0.497 to 0.465. The authors explain this as training that teaches the model to reject unedited callers, which removes the cue that multi-hop navigation relies on.
It also cut strict JSON parse completion from 100.0% to 96.0% under bounded output caps and raised output-token latency by more than six times. The authors therefore keep thinking off for inner-loop node probing.
Limits of the evidence
All experiments cover Python repositories, and the authors note that statically typed languages with explicit signatures may show different caller-versus-callee asymmetries. The evidence comes from three parameter scales of one model family, Gemma 4, under views of at most 60 lines and a fixed rubric.
Timestamps alone do not guarantee that the held-out panel was absent from pretraining.
Paper info
- Authors
- Ramesh Arvind Naagarajan
- Venue
- arXiv · Preprint
- First published
- 2026-11-12
- Added
- 2026-11-16
- Updated
- 2026-11-12
- Version
- v1
- arXiv
- 2611.17527
- Category
- cs.SE · cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
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.
Quote from the paper
Ramesh Arvind Naagarajan (2026). GraphScent: Calibrating Directional Relevance Signals for Bounded-Context Code Localization. arXiv:2611.17527v1. https://arxiv.org/abs/2611.17527v1
BibTeX
@misc{naagarajan2026graphscent,
title = {{GraphScent: Calibrating Directional Relevance Signals for Bounded-Context Code Localization}},
author = {Ramesh Arvind Naagarajan},
year = {2026},
eprint = {2611.17527},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.17527v1}
}