Finding logic bugs without general-purpose bug oracles
Marius Fleischer, Alex Matrosov, Nicholas Carlini, Milad Nasr
Logic bugs occur when software behaves in conflict with the implicit rules that govern how it should work (i.e., its invariants). These bugs are harder than usual to discover because developers are limited in the tools they can use to find them. Most general-purpose detection tools rely on general-purpose “bug oracles”—automated checks that recognize incorrect program behavior, like a program crashing or accessing memory incorrectly. Logic bugs, however, do not usually cause these kinds of failures, which means they require different methods. In this post, we describe and evaluate several ways of using LLMs to identify logic bugs. We developed a benchmark of 21 historical (i.e., since-patched) logic bugs that we collected from the change history of open-source codebases, and then tested out several new methods. Across our testing, simpler techniques—such as using LLMs to perform agentic code reviews—achieved the best results. Our results suggest that recent LLMs are capable of identifying logic bugs without human guidance or specialized tooling.



