ArXiv

SHERLOC: Structured Diagnostic Localization for Code Repair Agents

Authors
Hovhannes Tamoyan, Sean Narenthiran, Erik Arakelyan...
Categories
cs.CL
arXiv
https://arxiv.org/abs/2606.24820v1
PDF
https://arxiv.org/pdf/2606.24820v1

Brief

SHERLOC (Structured Hypothesis-driven Exploration and Reasoning for Localization) tackles costly fault localization in repository-level code repair by combining a reasoning LLM with compact repo tools and self-recovery—without fine-tuning or multi-agent orchestration. It supplies actionable diagnostic context (not just file hits) and achieves 84.33% accuracy@1 (SWE-Bench Lite) and 81.27% recall@1 (SWE-Bench Verified), improving repair-agent resolve rates and cutting token use substantially.

Why it matters

SHERLOC achieves state-of-the-art localization: 84.33% accuracy@1 on SWE-Bench Lite and 81.27% recall@1 on SWE-Bench Verified; at ~30B parameters it matches or outperforms other agentic methods.

Key details

  • The framework is training-free and pairs a reasoning LLM with compact repository tools plus self-recovery, requiring no fine-tuning or multi-agent orchestration while producing diagnostic context (not just file locations).
  • Feeding SHERLOC’s locations and diagnostic findings to repair agents raises resolve rate by +5.95 percentage points on SWE-Bench Verified and reduces localization and total tokens by 36.7% and 23.1%, respectively.
Source evidence

Abstract

LLM agents solve repository-level coding tasks through multi-turn tool use, but utilize half their budget on locating faults before editing. Dedicated localization frameworks have emerged, yet are still evaluated as file retrieval rather than actionable diagnosis, producing locations without the diagnostic context a repair agent needs. We introduce SHERLOC (Structured Hypothesis-driven Exploration and Reasoning for Localization), a training-free framework pairing a reasoning LLM with compact repository tools and self-recovery, without fine-tuning or multi-agent orchestration. SHERLOC reaches state-of-the-art localization across model scales: 84.33% accuracy@1 on SWE-Bench Lite and 81.27% recall@1 on SWE-Bench Verified; at ~30B parameters, it matches or outperforms other agentic methods. Injecting our locations and diagnostic findings into repair agents yields, on average, +5.95 pp resolve rate on SWE-Bench Verified while cutting localization and total tokens by 36.7% and 23.1%.