paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Large Language Models Can Connect the Dots: Exploring Model Optimization Bugs with Domain Knowledge-Aware Prompts

大语言模型能够“连点成线”:利用领域知识感知提示探索模型优化缺陷
ISSTA Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis2024匹配度 5/10 · 该论文用LLM生成测试用例发现深度学习模型优化器中的缺陷,属于PL→AI方向上对ML系统进行测试/缺陷检测的工作,与用户关注的ML系统分析有部分重合;但其核心是动态模糊测试而非静态分析,也未涉及浮点程序分析或贝叶斯程序分析,方法上偏向LLM提示工程而非程序分析理论。引用 9 inbox
Hao Guan, Guangdong Bai, Yepang Liu
crossref: 2026-09-12

AI 速览

一句话:用领域知识感知提示引导LLM生成测试用例,自动发现深度学习模型优化器中的缺陷。

模型优化(如剪枝、量化)是深度学习模型部署前的关键阶段,但优化器中的模型优化缺陷(MOB)涉及复杂数据类型与层结构,传统静态分析和动态测试难以检测。本文提出用大语言模型加提示技术生成测试用例来检测MOB,并探索“聚焦与扩散”范式:从已知MOB的issue报告与修复等工件中提取代码结构和错误描述等领域知识,形成对问题域的精确刻画(聚焦),再以此为启发式方向引导LLM生成创新测试用例(扩散)。该思想实现为工具YanHui,并与现有基于少样本LLM的模糊测试技术对比。结果显示,YanHui生成的测试用例能更好地组合相关API与数据以暴露MOB,生成语法有效代码的比例提升11.4%,针对模型优化的on-target代码提升22.3%;共检测出17个MOB,其中5个为深层MOB,若无该提示技术则难以揭示。

问题
深度学习模型优化器中的缺陷(MOB)涉及复杂数据类型和层结构,传统静态分析与动态测试技术难以有效检测。
方法
从已知MOB的issue报告和修复中提取领域知识(代码结构与错误描述),设计知识感知提示,引导LLM以“聚焦与扩散”范式生成能暴露MOB的测试用例,并实现为工具YanHui。
评估
与现有基于少样本LLM的模糊测试技术进行基准对比,统计生成语法有效代码和on-target代码的比例,并报告实际检测到的MOB数量及其中深层MOB的占比。
原文摘要(Abstract)

Model optimization, such as pruning and quantization, has become the de facto pre-deployment phase when deploying deep learning (DL) models on resource-constrained platforms. However, the complexity of DL models often leads to non-trivial bugs in model optimizers, known as model optimization bugs (MOBs). These MOBs are characterized by involving complex data types and layer structures inherent to DL models, causing significant hurdles in detecting them through traditional static analysis and dynamic testing techniques. In this work, we leverage Large Language Models (LLMs) with prompting techniques to generate test cases for MOB detection. We explore how LLMs can draw an understanding of the MOB domain from scattered bug instances and generalize to detect new ones, a paradigm we term as concentration and diffusion. We extract MOB domain knowledge from the artifacts of known MOBs, such as their issue reports and fixes, and design knowledge-aware prompts to guide LLMs in generating effective test cases. The domain knowledge of code structure and error description provides precise in-depth depictions of the problem domain, i.e., the concentration, and heuristic directions to generate innovative test cases, i.e., the diffusion. Our approach is implemented as a tool named YanHui and benchmarked against existing few-shot LLM-based fuzzing techniques. Test cases generated by YanHui demonstrate enhanced capability to find relevant API and data combinations for exposing MOBs, leading to an 11.4% increase in generating syntactically valid code and a 22.3% increase in generating on-target code specific to model optimization. YanHui detects 17 MOBs, and among them, five are deep MOBs that are difficult to reveal without our prompting technique.

链接与引用

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

BibTeX
@inproceedings{paperbot8597,
  title = {Large Language Models Can Connect the Dots: Exploring Model Optimization Bugs with Domain Knowledge-Aware Prompts},
  author = {Hao Guan and Guangdong Bai and Yepang Liu},
  booktitle = {ISSTA},
  year = {2024},
  doi = {10.1145/3650212.3680383}
}