Anthropic details methods for using LLMs to identify logic bugs, saying agentic code reviews work best and LLMs can find bugs without human guidance or tools

By techmeme · · Agents

Anthropic details methods for using LLMs to identify logic bugs, saying agentic code reviews work best and LLMs can find bugs without human guidance or tools

Anthropic : Anthropic details methods for using LLMs to identify logic bugs, saying agentic code reviews work best and LLMs can find bugs without human guidance or tools — Logic bugs occur when software behaves in conflict with the implicit rules that govern how it should work (i.e., its invariants).

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.

Introduction

The discovery of memory safety bugs relies heavily on robust bug oracles (e.g., sanitizers), combined with automated tools such as fuzzers or static analysis. But a lack of such tooling makes automated discovery for other bug classes, especially logic bugs, much more difficult—or sometimes even impossible. Sanitizers can detect memory safety bugs without any understanding of program logic, since an invalid memory access is a bug in any program.

What Hacker News is saying

  • “Anthropic proves rust is NOT memory safe…”
  • “> Across our testing, simpler techniques—such as using LLMs to perform agentic code reviews—achieved the best results.”

Read the full discussion on Hacker News →

Source: https://www.anthropic.com/research/finding-logic-bugs

More stories