AI
New Framework Uses AI and Reinforcement Learning to Pinpoint Bugs in Code
Researchers propose a hierarchical approach that narrows the debugging search space across files, functions, and individual lines.
A team of computer science researchers has developed a novel framework called C2C (From Codebase to Culprit) that helps developers locate software bugs more efficiently by systematically reducing the problem space.
How It Works#
Rather than scanning an entire codebase for issues, the framework operates in a structured, top-down manner that mirrors how experienced developers actually debug code. The approach breaks the task into multiple levels of granularity: it first identifies problematic files, then narrows focus to specific functions, and finally pinpoints exact lines of code.
The system combines two key technologies:
- Semantic retrieval: The framework analyzes bug-report text and stack-trace information using a machine-learning model fine-tuned through contrastive learning with CodeBERT. It converts these descriptions into numerical embeddings and compares them against a database to retrieve the most likely buggy code candidates.
- Hierarchical Reinforcement Learning (HRL): Once the search space is reduced, an AI system trained through reinforcement learning takes over to incrementally narrow down the bug's exact location across the file, function, and line levels.
What Makes It Different#
Earlier bug-localization approaches typically work at just one level of granularity, which can miss important context. C2C maintains consistency across decisions at all levels, enabling what the researchers call "multi-resolution localization."
Testing and Results#
The framework was evaluated on real-world codebases in Java and Python. According to the researchers, C2C improves both retrieval precision—how many relevant results appear in the initial candidate list—and overall localization accuracy. Ablation studies (which systematically disable components to measure their contribution) confirmed that the hierarchical decomposition, structured learning signals, and reward shaping all meaningfully advance the system's performance.

