A system that divides up code, follows links between methods and reviews its own rankings found more faults at the top of the list than earlier AI approaches.
LLM4FL uses three AI agents to investigate a software failure. One divides and prioritizes methods so they fit within the model's context, another follows the program's interprocedural call graph—the links between methods—to retrieve relevant code and explain the failure, and a third reviews and re-ranks the candidates through repeated reasoning.
In tests on the Defects4J V2.0.0 benchmark, LLM4FL reported a 14.5% higher Top-1 accuracy than AutoFL and a 4.58% higher accuracy than SoapFL. Top-1 accuracy measures how often the actual faulty method appears first in the ranking.
How the AI ranked bugs
LLM4FL combines order-aware division of covered methods, graph-guided code navigation, failure-reason generation and iterative self-review. On Defects4J, it outperformed the earlier LLM-based approaches AutoFL and SoapFL in Top-1 accuracy by 14.5% and 4.58%, respectively, and remained competitive with the learning-based techniques assessed by the researchers.
The component tests showed that removing order-aware division reduced Top-1 performance by 18.07%, removing graph-based navigation reduced it by 13.49%, removing failure-reason generation reduced it by 12.5%, and removing iterative self-refinement reduced it by 8.4%. The researchers also found that changing the initial ordering of methods could alter Top-1 accuracy by as much as 29%, even when the AI system eventually examined all the methods.
Why code order matters
Finding the faulty part of a large software project can require reasoning across many files and methods. LLM4FL is designed to address this problem by combining conventional test-based suspicion scores with an AI system that can follow the code's structure, explain possible failure causes and revisit its ranking.
The results also show that the order in which code is presented can strongly affect which method the system ranks first. That finding suggests that how traditional software-testing information is combined with AI reasoning is an important part of fault localization, rather than a minor setup detail.