CoChat

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

Open access
Deng, Yinlin, Xia, Chunqiu Steven, Peng, Haoran, Yang, Chenyuan, Zhang, Lingming · 2023 · Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis

The DOI matches its Crossref record; 65 of the 65 references it cites were found in a registry or an index; 3 of the 45 sources its claims cite were checked for support.

Abstract

Deep Learning (DL) systems have received exponential growth in popularity and have become ubiquitous in our everyday life. Such systems are built on top of popular DL libraries, e.g., TensorFlow and PyTorch which provide APIs as building blocks for DL systems. Detecting bugs in these DL libraries 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 autoregressively 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 44 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.

Overview

CoChat Summary

TL;DR

TitanFuzz is presented as the first approach to fuzz deep-learning libraries by directly using large language models to generate and mutate Python programs that call library APIs. It reports higher API and code coverage than prior fuzzers and finds dozens of previously unknown bugs in TensorFlow and PyTorch.

Key findings

  • TitanFuzz covered 2215 TensorFlow APIs and 1329 PyTorch APIs, improving API coverage over the best baseline, DeepREL, by 91.11% and 24.09%, respectively.
  • It reached 39.97% line coverage on TensorFlow and 20.98% on PyTorch, improving over DeepREL by 30.38% and 50.84%.
  • It detected 65 bugs total, with 55 confirmed and 44 confirmed as previously unknown; 21 of the previously unknown bugs were already fixed.
  • Ablations showed the full set of mutation operators and the fitness function combining dataflow depth, unique API calls, and repeated-call penalty performed best; Thompson sampling for operator selection outperformed random selection.

Methods

  • TitanFuzz uses Codex as a generative LLM with a step-by-step prompt to create seed programs for each target API, then uses InCoder as an infilling LLM within an evolutionary fuzzing loop.
  • Mutation operators include argument replacement, keyword insertion, prefix/suffix edits, and method replacement; operator choice is learned with a multi-armed bandit using Thompson sampling, and generated programs are ranked by a fitness function based on dataflow depth, unique API calls, and repeated API calls.
  • Evaluation targets PyTorch v1.12 and TensorFlow v2.10, compares against API-level and model-level fuzzers, and uses differential testing across CPU and GPU backends to detect wrong-computation and crash bugs.

Limitations

  • The paper states internal validity threats around implementation correctness and randomness: RQ1 was run once due to the large API set, while RQ2 used five runs on 100 sampled APIs; external validity is limited to PyTorch and TensorFlow.
  • The paper acknowledges that differential testing can produce false positives when CPU/GPU differences are tolerated or implementation-defined, as shown by a rejected right-shift bug report.
  • The text also makes evident that TitanFuzz has higher execution time than prior tools and depends on access to specific LLMs such as Codex and InCoder.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1145/3597926.3598067

Cites

65 of 65 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Verification

Claims the paper makes

2 Valid · 1 Not valid · 21 Not checked · 88 Own results and interpretations

47 more claims

Create a free account to see all 112 claims and to verify the 42 references still open.

See all claims — free account
  • It may state two separate claims as one. 51
  • The quote only partly states this claim. 4
  • Probably not a substantial claim. 15

Create a free account to see these claims.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

1 of 1

Citations

Cites

Show all 65 references

Research works printed but not linked: 13

  1. Andrea Fioraldi , Dominik Maier , Heiko Eiß feldt, and Marc Heuse . 2020 . AFL++: Combining Incremental Steps of Fuzzing Research . In Proceedings of the 14th USENIX Conference on Offensive Technologies (WOOT’20) . USENIX Association, USA. Article 10, 1 pages. Andrea Fioraldi, Dominik Maier, Heiko Eiß feldt, and Marc Heuse. 2020. AFL++: Combining Incremental Steps of Fuzzing Research. In Proceedings of the 14th USENIX Conference on Offensive Technologies (WOOT’20). USENIX Association, USA. Article 10, 1 pages.
  2. Sepp Hochreiter and Jürgen Schmidhuber . 1997. Long Short-term Memory. Neural computation, 9 ( 1997 ), 12, 1735–80. Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long Short-term Memory. Neural computation, 9 (1997), 12, 1735–80.
  3. Suyoung Lee , HyungSeok Han , Sang Kil Cha , and Sooel Son . 2020 . Montage: A Neural Network Language $Model-Guided$$JavaScript$ Engine Fuzzer . In 29th USENIX Security Symposium (USENIX Security 20) . 2613–2630. Suyoung Lee, HyungSeok Han, Sang Kil Cha, and Sooel Son. 2020. Montage: A Neural Network Language $Model-Guided$$JavaScript$ Engine Fuzzer. In 29th USENIX Security Symposium (USENIX Security 20). 2613–2630.
  4. Jiawei Liu Jinkun Lin Fabian Ruffy Cheng Tan Jinyang Li Aurojit Panda and Lingming Zhang. 2023. NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilers. In ASPLOS. 530–543. Jiawei Liu Jinkun Lin Fabian Ruffy Cheng Tan Jinyang Li Aurojit Panda and Lingming Zhang. 2023. NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilers. In ASPLOS. 530–543.
  5. Xiao Liu , Xiaoting Li , Rupesh Prajapati , and Dinghao Wu . 2019 . Deepfuzz: Automatic generation of syntax valid c programs for fuzz testing . In Proceedings of the AAAI Conference on Artificial Intelligence. 33 , 1044–1051. Xiao Liu, Xiaoting Li, Rupesh Prajapati, and Dinghao Wu. 2019. Deepfuzz: Automatic generation of syntax valid c programs for fuzz testing. In Proceedings of the AAAI Conference on Artificial Intelligence. 33, 1044–1051.
  6. Zohar Manna and Richard J . Waldinger . 1971 . Toward Automatic Program Synthesis. Commun. ACM , 14, 3 (1971), mar, 151–165. Zohar Manna and Richard J. Waldinger. 1971. Toward Automatic Program Synthesis. Commun. ACM, 14, 3 (1971), mar, 151–165.
  7. Pengyu Nie , Rahul Banerjee , Junyi Jessy Li , Raymond J. Mooney , and Milos Gligoric . 2023 . Learning Deep Semantics for Test Completion. In 45th International Conference on Software Engineering. Pengyu Nie, Rahul Banerjee, Junyi Jessy Li, Raymond J. Mooney, and Milos Gligoric. 2023. Learning Deep Semantics for Test Completion. In 45th International Conference on Software Engineering.
  8. Jiwon Park , Dominik Winterer , Chengyu Zhang , and Zhendong Su . 2021 . Generative type-aware mutation for testing SMT solvers . Proceedings of the ACM on Programming Languages, 5, OOPSLA (2021), 1–19. Jiwon Park, Dominik Winterer, Chengyu Zhang, and Zhendong Su. 2021. Generative type-aware mutation for testing SMT solvers. Proceedings of the ACM on Programming Languages, 5, OOPSLA (2021), 1–19.
  9. Alec Radford , Jeffrey Wu , Rewon Child , David Luan , Dario Amodei , and Ilya Sutskever . 2019. Language models are unsupervised multitask learners. OpenAI blog, 1, 8 ( 2019 ), 9. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1, 8 (2019), 9.
  10. Colin Raffel , Noam Shazeer , Adam Roberts , Katherine Lee , Sharan Narang , Michael Matena , Yanqi Zhou , Wei Li , and Peter J . Liu . 2020 . Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. J. Mach. Learn. Res ., jan. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. J. Mach. Learn. Res., jan.
  11. Daniel J Russo , Benjamin Van Roy , Abbas Kazerouni, Ian Osband, and Zheng Wen. 2018 . A tutorial on thompson sampling. Foundations and Trends® in Machine Learning , 11, 1 (2018), 1–96. Daniel J Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, and Zheng Wen. 2018. A tutorial on thompson sampling. Foundations and Trends® in Machine Learning, 11, 1 (2018), 1–96.
  12. Jiannan Wang , Thibaud Lutellier , Shangshu Qian , Hung Viet Pham, and Lin Tan . 2022 . EAGLE : Creating Equivalent Graphs to Test Deep Learning Libraries . Jiannan Wang, Thibaud Lutellier, Shangshu Qian, Hung Viet Pham, and Lin Tan. 2022. EAGLE: Creating Equivalent Graphs to Test Deep Learning Libraries.
  13. Chenyuan Yang , Yinlin Deng , Jiayi Yao , Yuxing Tu , Hanchi Li , and Lingming Zhang . 2023 . Fuzzing Automatic Differentiation in Deep-Learning Libraries. In International Conference on Software Engineering (ICSE). to appear Chenyuan Yang, Yinlin Deng, Jiayi Yao, Yuxing Tu, Hanchi Li, and Lingming Zhang. 2023. Fuzzing Automatic Differentiation in Deep-Learning Libraries. In International Conference on Software Engineering (ICSE). to appear

Cited by

See all 334

Metadata

Authors
Deng, Y., Xia, C. S., Peng, H., Yang, C., & Zhang, L.
Affiliations
  • University of Illinois Urbana-Champaign (US)
  • University of Science and Technology of China (CN)
Venue
Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis
Publisher
ACM
Published
2023-07-12
Pages
423-435
OpenAlex
W4378591002
Cited by
326
References
39
Citations by year
2026: 93 · 2025: 137 · 2024: 87 · 2023: 9
FWCI
63.11
Type
conference paper
Language
en
Open access
Locations
  • ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA) (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • Zenodo (CERN European Organization for Nuclear Research) (submittedVersion, cc-by)
  • arXiv (Cornell University) (cc-by)
Funders
National Science Foundation (CCF-2131943,CCF-2141474)
Topics
  • Physical Sciences › Computer Science › Software › Software Testing and Debugging Techniques
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
Keywords
large language models, fuzzing, deep learning libraries, TensorFlow, PyTorch, bug detection, code generation, code mutation, input generation, code coverage

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

The claim verdicts this report counts are experimental: their accuracy is not yet measured.

A language model drew the claims from the paper on 2026-10-07, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-10-07 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Cited sources are checked with a language model’s help (gpt-6-sol and qwen3.8-omni-flash).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models. https://app.cochat.ai/papers/10.1145/3597926.3598067
The paper
Deng, Y., Xia, C. S., Peng, H., Yang, C., & Zhang, L. (2023). Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models. Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis. https://doi.org/10.1145/3597926.3598067

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.