从灰烬中崛起:基于LLM的深度学习框架缺陷静态分析
Rise From The Ashes: LLM-based Static Analysis for Deep Learning Framework Bugs
AI总结:
提出首个基于LLM的静态分析技术Phoenix,通过结构化语义桥接中间表示建模跨语言张量流,结合多智能体工作流检测深度学习框架缺陷,已在PyTorch中发现31个新bug。
摘要:
深度学习(DL)框架是关键的人工智能基础设施,通常隐藏着具有严重安全影响的缺陷。虽然模糊测试等动态方法在发现这些缺陷方面有效,但它们需要实际测试执行并产生高计算成本。静态分析是自然的补充,因为它可以在无需运行时执行的情况下检测缺陷,提供快速且可扩展的测试。不幸的是,由于DL框架的多语言架构和张量相关的程序状态,针对DL框架的静态分析工作仍然有限。我们提出了Phoenix,这是首个基于LLM的DL框架静态分析技术。我们的关键洞察是,DL框架中的跨语言张量流可以连同具体的代码上下文一起建模为结构化的语义桥接中间表示(SBIR),LLM可以分析其中的张量语义传播潜在缺陷。我们通过多智能体工作流实现这一洞察。首先,一个摘要智能体从历史缺陷修复补丁和CWE规则中提炼缺陷摘要。在每个摘要的指导下,一个提取智能体识别与缺陷相关的仓库符号以进行代码检索,一个生成智能体从检索到的上下文中合成基于上下文的SBIR。最后,利用一个分析智能体检查SBIR并报告潜在缺陷。我们的评估表明,Phoenix是动态DL框架测试在缺陷发现方面的实用补充。迄今为止,Phoenix已在PyTorch中为不同的异构硬件后端(Intel CPU、NVIDIA CUDA和Apple MPS)发现了31个真实的新缺陷。其中,20个提交的缺陷修复补丁已合并到上游。
英文摘要:
Deep learning (DL) frameworks are critical AI infrastructures that often hide bugs with serious security implications. While dynamic approaches such as fuzzing are effective in uncovering these bugs, they require real test execution and incur high computational costs. Static analysis is a natural complement because it can detect bugs without runtime execution, offering fast and scalable testing. Unfortunately, there is still limited work targeting static analysis for DL frameworks due to their multilingual architectures and tensor-related program state. We present Phoenix, the first LLM-based static analysis technique for DL frameworks. Our key insight is that cross-language tensor flows in DL frameworks can be modeled, together with concrete code context, as a structured semantic bridge intermediate representation (SBIR) that LLMs can analyze for potential bugs in tensor semantic propagation. We implement this insight through a multi-agent workflow. A summarization agent first distills bug summaries from historical bug-fix patches and CWE rules. Guided by each summary, an extraction agent identifies bug-relevant repository symbols for code retrieval, and a generation agent synthesizes grounded SBIRs from the retrieved context. Finally, an analysis agent is leveraged to check SBIRs and report potential bugs. Our evaluation shows that Phoenix is a practical complement to dynamic DL framework testing for bug finding. To date, Phoenix has found 31 real new bugs in PyTorch for different heterogeneous hardware backends (Intel CPU, NVIDIA CUDA, and Apple MPS). Among them, 20 submitted bug-fixing patches have been merged into upstream.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。