Abstract
We introduce C2C (From Codebase to Culprit), a framework for precise bug localization that progressively reduces the debugging search space across multiple levels of granularity: files, functions, and lines of code. To mirror developer's natural top-down debugging workflows, C2C integrates semantic retrieval and Hierarchical Reinforcement Learning (HRL) in a two-stage process. First, it performs recall-oriented retrieval of buggy candidates via semantic vector similarity search using bug-report text, including available stack-trace information, against a database of embeddings, where the embeddings are fine-tuned via contrastive learning with CodeBERT. Building on this reduced search space, the HRL framework incrementally localizes bugs, reasoning from files to functions and ultimately to individual lines of code. Unlike prior approaches which operate at a single granularity, C2C enables multi-resolution localization while maintaining contextual consistency across decisions. Experiments on real-world Java and Python datasets demonstrate that C2C improves retrieval precision and localization accuracy. Ablation studies further highlight the contributions of hierarchical decomposition, structured learning signals, and reward shaping in advancing multi-level bug localization.
Keywords
Subject
Publication details
- Journal
- Not available
- Open access
- Green open access
Cite this article
APA 7
Garg, A., Yang-Smith, C., Rishav, R., Abdellatif, A., & Kahou, S. E. (2026). From Codebase to Culprit (C2C): Reducing the Search Space for Bugs with Semantic Retrieval and Hierarchical Reinforcement Learning. https://omanscience.com/en/articles/from-codebase-to-culprit-c2c-reducing-the-search-space-for-bugs-with-semantic-retrieval-and-hierarchical-reinforcement-learning
MLA 9
Garg, Ankur, et al. "From Codebase to Culprit (C2C): Reducing the Search Space for Bugs with Semantic Retrieval and Hierarchical Reinforcement Learning." https://omanscience.com/en/articles/from-codebase-to-culprit-c2c-reducing-the-search-space-for-bugs-with-semantic-retrieval-and-hierarchical-reinforcement-learning.
Chicago (author–date)
Garg, Ankur, Corey Yang-Smith, Rishav Rishav, Ahmad Abdellatif, and Samira Ebrahimi Kahou. 2026. "From Codebase to Culprit (C2C): Reducing the Search Space for Bugs with Semantic Retrieval and Hierarchical Reinforcement Learning." https://omanscience.com/en/articles/from-codebase-to-culprit-c2c-reducing-the-search-space-for-bugs-with-semantic-retrieval-and-hierarchical-reinforcement-learning.
Harvard
Garg, A., Yang-Smith, C., Rishav, R., Abdellatif, A. and Kahou, S. E. (2026) 'From Codebase to Culprit (C2C): Reducing the Search Space for Bugs with Semantic Retrieval and Hierarchical Reinforcement Learning', Available at: https://omanscience.com/en/articles/from-codebase-to-culprit-c2c-reducing-the-search-space-for-bugs-with-semantic-retrieval-and-hierarchical-reinforcement-learning.
Vancouver
Garg A, Yang-Smith C, Rishav R, Abdellatif A, Kahou SE. From Codebase to Culprit (C2C): Reducing the Search Space for Bugs with Semantic Retrieval and Hierarchical Reinforcement Learning. https://omanscience.com/en/articles/from-codebase-to-culprit-c2c-reducing-the-search-space-for-bugs-with-semantic-retrieval-and-hierarchical-reinforcement-learning
IEEE
A. Garg, C. Yang-Smith, R. Rishav, A. Abdellatif, and S. E. Kahou, "From Codebase to Culprit (C2C): Reducing the Search Space for Bugs with Semantic Retrieval and Hierarchical Reinforcement Learning," https://omanscience.com/en/articles/from-codebase-to-culprit-c2c-reducing-the-search-space-for-bugs-with-semantic-retrieval-and-hierarchical-reinforcement-learning.