arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2212.14834cs.SE
收藏

大语言模型是Zero-Shot模糊器:通过大语言模型模糊深度学习库

Large Language Models are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models

Yinlin Deng, Chunqiu Steven Xia, Haoran Peng, Chenyuan Yang, Lingming Zhang

摘要:

检测深度学习(DL)库中的错误(例如,TensorFlow/PyTorch)对于几乎所有下游DL系统都至关重要,可以确保最终用户的有效性/安全性。同时,传统的模糊技术对于这样一个具有挑战性的领域可能很难有效,因为输入DL程序需要满足输入语言(例如,Python)语法/语义和用于张量计算的DL API输入/形状约束。为了解决这些限制,我们提出TitanFuzz -第一种直接利用大语言模型(LLM)来生成模糊DL库的输入程序的方法。LLM是在数十亿代码片段上训练的巨大模型,可以自动回归生成类似人类的代码片段。我们的关键见解是,现代LLM还可以在其训练语料库中包含大量调用DL库API的代码片段,因此可以隐式地学习语言语法/语义和复杂的DL API约束,以生成有效的DL程序。更具体地说,我们使用生成和填充LLM(例如,Codex/InCoder)生成和变异有效/多样的输入DL程序,以进行模糊化。我们的实验结果表明,TitanFuzz可以实现比TensorFlow/PyTorch上最先进的模糊器高30.38%/50.84%的代码覆盖率。此外,TitanFuzz能够检测到65个bug,其中41个已经被确认为以前未知的bug。本文表明,现代Titanic LLM可以直接执行几十年来研究的基于生成和基于突变的模糊,同时完全自动化,可推广,并适用于传统方法(如DL系统)具有挑战性的领域。我们希望TitanFuzz可以在这个有前途的LLM方向上激发更多的工作。

英文摘要:

Detecting bugs in Deep Learning (DL) libraries (e.g., TensorFlow/PyTorch) is critical for almost all downstream DL systems in ensuring effectiveness/safety for end users. Meanwhile, traditional fuzzing techniques can be hardly effective for such a challenging domain since the input DL programs need to satisfy both the input language (e.g., Python) syntax/semantics and the DL API input/shape constraints for tensor computations. To address these limitations, we propose TitanFuzz - the first approach to directly leveraging Large Language Models (LLMs) to generate input programs for fuzzing DL libraries. LLMs are titanic models trained on billions of code snippets and can auto-regressively generate human-like code snippets. Our key insight is that modern LLMs can also include numerous code snippets invoking DL library APIs in their training corpora, and thus can implicitly learn both language syntax/semantics and intricate DL API constraints for valid DL program generation. More specifically, we use both generative and infilling LLMs (e.g., Codex/InCoder) to generate and mutate valid/diverse input DL programs for fuzzing. Our experimental results demonstrate that TitanFuzz can achieve 30.38%/50.84% higher code coverage than state-of-the-art fuzzers on TensorFlow/PyTorch. Furthermore, TitanFuzz is able to detect 65 bugs, with 41 already confirmed as previously unknown bugs. This paper demonstrates that modern titanic LLMs can be leveraged to directly perform both generation-based and mutation-based fuzzing studied for decades, while being fully automated, generalizable, and applicable to domains challenging for traditional approaches (such as DL systems). We hope TitanFuzz can stimulate more work in this promising direction of LLMs for fuzzing.

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

↑