Reducing False Positives in Static Bug Detection with LLMs: An Empirical Study in Industry
This paper presents the first comprehensive empirical study at Tencent demonstrating that hybrid techniques combining large language models with static analysis can effectively reduce false positives in industrial bug detection by 94–98% while offering significant cost and time savings compared to manual review.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a quality inspector at a massive, high-tech factory (like Tencent) that builds complex software machines. Your job is to find defects before the machines go out the door.
To help you, the factory installed a super-fast, automated metal detector called a Static Analysis Tool (SAT). This tool scans every single screw and wire in the machine. The problem? The metal detector is too sensitive. It beeps at everything: actual broken screws, but also harmless dust, shadows, and even the reflection of a light bulb.
In the industry, this is called a False Positive. It's a "false alarm."
The Problem: The "Boy Who Cried Wolf"
The paper explains that in big companies, these tools are so cautious (to make sure they don't miss a real broken screw) that they scream "ALARM!" about 90% of the time for things that are actually fine.
Because the factory is so huge, the detector rings thousands of times a day. Human inspectors have to stop, pick up the machine, and look at every single beep to see if it's real.
- The Cost: It takes a human about 10 to 20 minutes to check just one alarm.
- The Waste: Since most alarms are fake, the factory is wasting huge amounts of time and money checking things that don't need fixing.
The New Solution: The "AI Assistant"
The researchers asked: Can we use a smart AI (a Large Language Model or LLM) to help us ignore the fake alarms so humans only check the real ones?
They tested this idea using real data from Tencent's advertising software. They gathered 433 real-world alarms (328 were fake, 105 were real bugs) and asked different types of AI to sort them out.
Here is what they found, using simple analogies:
1. The AI is a Great "Filter"
Think of the AI as a very smart intern.
- The Old Way: You ask the intern, "Is this broken?" and they just guess. They get it wrong often.
- The New Way: You give the intern a cheat sheet (a prompt) and tell them, "Look at the whole picture, not just the screw."
- The Result: When the AI was given the right instructions (specifically, a "hybrid" method where the AI looks at the code and the detector's notes), it became incredibly good. It successfully filtered out 94% to 98% of the fake alarms. It told the humans, "Ignore this one, it's just a shadow," with high confidence.
2. It's Cheaper and Faster Than a Human
- Human Cost: Checking one alarm takes 10–20 minutes.
- AI Cost: The AI checks an alarm in 2 to 110 seconds (depending on which AI model you use).
- Money Cost: It costs the company between $0.001 and $0.12 per check.
- The Metaphor: It's like hiring a robot that costs a fraction of a penny to do a job that used to take a human a whole coffee break.
3. The AI Isn't Perfect (Yet)
The researchers also looked at where the AI failed, and they found three specific "blind spots":
- The "Long Story" Problem: If the code is very long and complex (like a novel with 100 chapters), the AI sometimes loses the plot and can't tell if the end connects to the beginning.
- The "Rube Goldberg" Problem: If the code has a chain of 20 different "if-then" rules (like a Rube Goldberg machine), the AI gets confused about which path the machine actually takes.
- The "Strange Language" Problem: If the code uses very weird, custom-made structures that the AI hasn't seen before in its training, it might misinterpret them.
The Bottom Line
The paper concludes that while we can't replace human inspectors entirely yet (because the AI still misses a few tricky cases), we can use the AI as a first line of defense.
Instead of a human checking 100 alarms, the AI checks them first, filters out the 95 obvious fakes, and only passes the 5 suspicious ones to the human. This saves the factory massive amounts of time and money, turning a chaotic, noisy process into a smooth, efficient one.
In short: The AI isn't a magic wand that fixes everything, but it's a brilliant "noise-canceling headphone" that lets human experts hear the real problems clearly.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.