paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Assisting Static Analysis with Large Language Models: A ChatGPT Experiment

用大语言模型辅助静态分析:一项 ChatGPT 实验
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 7/10 · 该论文用 LLM(ChatGPT)辅助静态分析,通过构造函数行为/函数摘要提问来剔除静态分析误报,正好对应画像中“AI→PL:利用 LLM/Agent 改进静态分析”的核心方向,属问题驱动的误报剪枝研究。但实验仅基于 20 个误报的小规模 pilot study,且主要依赖 GPT-3.5/GPT-4(按当前标准已偏旧),缺少理论形式化与工业落地验证,因此未达到正中核心的 8-10 分。引用 79 inbox
Haonan Li, Yu Hao, Yizhuo Zhai, Zhiyun Qian
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:通过精心设计的函数行为与函数摘要提问,用 LLM 有效剔除静态分析工具产生的误报。

静态分析工具在缺陷检测中常产生大量误报,人工排查成本高昂。本文探讨大语言模型能在何处、以何种方式辅助静态分析,并针对一个具体的缺陷查找工具,围绕函数级行为或函数摘要构造提问,让 GPT 模型判断被报告的告警是否真实成立。作者先以 20 个误报做试点研究:基于 GPT-3.5 可成功剔除其中 8 个,而 GPT-4 近乎完美,剔除了 16 个,剩余 4 个失败案例涉及并发等当前提问方式未覆盖或不予支持的情形。此外,实验还识别出 1 个漏报(被静态分析遗漏的缺陷)。结果表明,LLM 是有前景的工具,可支撑更有效、更高效的程序分析流程。

问题
静态分析工具在缺陷查找中会输出大量误报,人工复核代价高;本文研究 LLM 能否以及在哪些环节辅助静态分析以减少这类误报。
方法
针对一个具体的缺陷查找静态分析工具,构造关于函数级行为或函数摘要的针对性问题,交由 GPT-3.5 与 GPT-4 判断告警是否为误报,并据此修剪分析结果。
评估
以 20 个静态分析误报开展试点实验:GPT-3.5 剔除 8/20,GPT-4 剔除 16/20,其余 4 例涉及并发等提问未覆盖的情形;另发现 1 个漏报。
原文摘要(Abstract)

Recent advances of Large Language Models (LLMs), e.g., ChatGPT, exhibited strong capabilities of comprehending and responding to questions across a variety of domains. Surprisingly, ChatGPT even possesses a strong understanding of program code. In this paper, we investigate where and how LLMs can assist static analysis by asking appropriate questions. In particular, we target a specific bug-finding tool, which produces many false positives from the static analysis. In our evaluation, we find that these false positives can be effectively pruned by asking carefully constructed questions about function-level behaviors or function summaries. Specifically, with a pilot study of 20 false positives, we can successfully prune 8 out of 20 based on GPT-3.5, whereas GPT-4 had a near-perfect result of 16 out of 20, where the four failed ones are not currently considered/supported by our questions, e.g., involving concurrency. Additionally, it also identified one false negative case (a missed bug). We find LLMs a promising tool that can enable a more effective and efficient program analysis.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{Li0ZQ23,
  title = {Assisting Static Analysis with Large Language Models: A ChatGPT Experiment},
  author = {Haonan Li and Yu Hao and Yizhuo Zhai and Zhiyun Qian},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3613078}
}