arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.11209cs.SEcs.CR
收藏

SAFuzz:基于语义的自适应模糊测试用于大语言模型生成的代码

SAFuzz: Semantic-Guided Adaptive Fuzzing for LLM-Generated Code

Georgia Institute of Technology(佐治亚理工学院)

Ziyi Yang, Kalit Inani, Keshav Kabra, Vima Gupta, Anand Padmanabha Iyer

AI总结:

SAFuzz通过结合LLM引导的自适应模糊测试,提升算法漏洞检测精度和效率,减少测试时间成本。

摘要:

尽管AI编码助手加速了软件开发,但当前的测试框架难以跟上由此产生的AI生成代码的体积。传统模糊测试技术往往均匀分配资源,缺乏对算法漏洞模式的语义意识,导致资源使用效率低下和遗漏漏洞。为了解决这些限制,我们提出了一种混合测试框架,利用LLM引导的自适应模糊测试来高效检测算法漏洞。我们的系统SAFuzz集成了基于提示的行为多样化、结合问题特定或acles的生成器以及基于LLM的预测器,以实现自适应资源分配和动态早期停止。在CSES算法问题上评估SAFuzz,我们提高了漏洞识别精度从77.9%到85.7%,并且在与SOTA GreenFuzz相比,时间成本减少了1.71倍,同时保持了可比的召回率。我们进一步发现,将我们的方法与现有单元测试生成方法结合,会产生互补的收益,使漏洞检测召回率从67.3%提高到79.5%。

英文摘要:

While AI-coding assistants accelerate software development, current testing frameworks struggle to keep pace with the resulting volume of AI-generated code. Traditional fuzzing techniques often allocate resources uniformly and lack semantic awareness of algorithmic vulnerability patterns, leading to inefficient resource usage and missed vulnerabilities. To address these limitations, we present a hybrid testing framework that leverages LLM-guided adaptive fuzzing to detect algorithmic vulnerabilities efficiently. Our system SAFuzz integrates prompt-based behavioral diversification, harness generation with problem-specific oracles, and an LLM-based predictor to enable adaptive resource allocation and dynamic early stopping. Evaluating SAFuzz on CSES algorithmic problems, we improve vulnerability discrimination precision from 77.9% to 85.7% and achieve a 1.71x reduction in time cost compared to SOTA GreenFuzz while maintaining comparable recall. We further observe that combining our approach with existing unit test generation methods yields complementary gains, increasing the bug detection recall from 67.3% to 79.5%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑