GraphScent: Calibrating Directional Relevance Signals for Bounded-Context Code Localization
Organizations: Department of Electrical Engineering and Information Technology, Chemnitz University of Technology
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.
Figures & tables
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Scale | Relation / Distribution | |||||
|---|---|---|---|---|---|---|
| E4B | ( ) | |||||
| parent | ||||||
| called_by | ||||||
| inherits | ||||||
| calls (excluded) | ||||||
| 12B | ( ) |
| Scale | Paired Comparison ( ) | Subset ( ) | (pp) | W / L / T | -val |
|---|---|---|---|---|---|
| E4B | GraphScent LW vs. Undir-AST LW | All ( ) | |||
| E4B | GraphScent LW vs. Fixed-Dir LW | All ( ) | |||
| E4B | GraphScent LW vs. Rev-Dir LW | All ( ) | |||
| E4B | GraphScent LW vs. Flat BM25 LW | BM25>10 ( ) | |||
| E4B | GraphScent LW vs. GraphScent PW | All ( ) | |||
| 12B | GraphScent LW vs. Flat BM25 LW | BM25>10 ( ) |
| Repository ( ) | Scale | Flat BM25 | BAGEL-GP | Undir-AST | Fixed-Dir | GraphScent |
|---|---|---|---|---|---|---|
| fastapi/fastapi ( ) | E4B | |||||
| 12B | ||||||
| 31B | ||||||
| Textualize/rich ( ) | E4B | |||||
| 12B | ||||||
| 31B |
| 31B Judge Variant | JSON Parse | gold vs. far | 1-Hop AST vs. far | knear vs. far |
|---|---|---|---|---|
| Frozen 31B ( thinking=off ) | ||||
| Frozen 31B ( thinking=on ) | ||||
| Patch-LoRA ( thinking=off ) |
| Model ( w4a16 ) | VRAM | Node Med / P90 | LW Med / P90 | Cum. In (Med / Mean / P90) | Cum. Out |
|---|---|---|---|---|---|
| Gemma 4 E4B | |||||
| Gemma 4 12B | |||||
| Gemma 4 31B |
Software Engineering
Software engineering studies how to design, build, test, deploy, and maintain reliable software systems and the processes behind them.
See all 290 papers