GraphScent:为有界上下文代码定位校准方向性相关信号
GraphScent: Calibrating Directional Relevance Signals for Bounded-Context Code Localization
GraphScent 是一种免训练搜索控制器,在运行时 Typed-AST 多重图上传播关系条件对数似然比,再用一次列表式比较消解平局。研究基于 Gemma 4 模型分析 86 个仓库的 211 个真实 Python 问题,发现外层作用域与上游调用者的相关性得分能稳定区分真实结构邻居与词汇干扰项,而下游被调用者等得分接近随机。
arXiv:2611.17527v1 Announce Type: cross 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.
来源:arXiv (AI + Vision + Imaging) · arxiv.org