LLM-Powered Silent Bug Fuzzing in Deep Learning Libraries via Versatile and Controlled Bug Transfer

Kunpeng Zhang, Dongwei Xiao, Daoyuan Wu, Shuai Wang, Jiali Zhao, Yuanyi Lin, Tongtong Xu, Shaohua Wang

TL;DR

This paper introduces TransFuzz, a novel framework that uses Large Language Models (LLMs) to find "silent bugs" in deep learning libraries. By transferring knowledge from past bugs to similar code components, TransFuzz significantly improves the detection of these hard-to-find errors, uncovering 79 new bugs, including 12 CVEs, across major DL libraries.

What Problem Does This Paper Address?

Deep learning (DL) libraries are the backbone of many critical applications, from autonomous driving to medical diagnosis. While obvious bugs like crashes are relatively easy to detect, "silent bugs" are far more insidious. These bugs don't cause immediate failures but lead to incorrect computations or degraded performance, which can propagate through downstream applications, causing significant, undetected issues. Existing fuzzing techniques struggle with silent bugs because they lack effective test programs and reliable "oracles" (mechanisms to determine if a bug has occurred). This is largely due to the context-dependent nature of silent bugs, making it difficult to create general-purpose detection methods.

Methods

TransFuzz employs a "transfer-then-verify" approach powered by LLMs. The core idea is to leverage historical bug reports to find new bugs.

  1. Context-Aware Bug Pattern Extraction: LLMs analyze past bug reports (issues and pull requests) to extract key information: the buggy API, the specific conditions (triggering context) that caused the bug, and how the bug was detected (oracle design). This creates a structured "bug pattern."
  2. Functionality-Based API Matching: To generalize beyond the original buggy API, TransFuzz uses LLMs to generate "context-free functional descriptions" for APIs. It then computes semantic similarity between these descriptions to identify functionally similar target APIs that might harbor similar bugs.
  3. Bug Transfer-Driven Fuzzing: For each identified target API, TransFuzz uses LLMs to adapt the extracted bug pattern. This involves rewriting the triggering context and redesigning the oracle to fit the target API's specifics, creating executable test programs.
  4. LLM-Powered Self-Validation: To combat false positives (where the system flags a non-bug as a bug), TransFuzz uses an LLM-powered validation module. This module analyzes the generated test program's runtime behavior, comparing it against the original bug's characteristics and using "bug determination criteria" extracted from resolved issues to confirm if a real bug is present.

Datasets

  • PyTorch GitHub Issues and Pull Requests: Used as the primary source for extracting context-aware bug patterns. The authors focused on issues with corresponding pull requests to ensure they were confirmed bugs.
  • Curated Dataset: A dataset of 78 representative and complex cases (22 real bugs, 56 non-bugs) derived from an earlier TransFuzz prototype was used for ablation studies and evaluating LLM performance.

Key Insights and Ideas

  • Historical bug reports are a goldmine for finding new bugs: Past bugs often follow recurring patterns and involve APIs with similar functionalities, making them excellent sources for transferring knowledge.
  • Context is king for silent bugs: Unlike crashes, silent bugs require understanding the specific API semantics, input data, and call sequences to detect them. Generic oracles are insufficient.
  • LLMs can bridge the gap: LLMs are powerful tools for understanding natural language bug reports, extracting complex patterns, and adapting them to new contexts.
  • Controlled bug transfer is key: Simply copying bug code isn't enough. TransFuzz's approach of extracting structured patterns and adapting them with LLMs allows for more precise and effective bug discovery.
  • Self-validation is crucial for LLM-based fuzzing: LLM-generated oracles can be unreliable. An LLM-powered validation step, grounded in concrete execution evidence and bug determination criteria, is essential for reducing false positives.

Key Results

  • Discovered 79 previously unknown bugs: Across PyTorch, TensorFlow, and MindSpore, TransFuzz found a significant number of new bugs.
  • 12 bugs confirmed as CVEs: This highlights the severity and impact of the discovered silent bugs.
  • Effective across multiple DL libraries: Demonstrates the generalizability of the approach.
  • Outperforms existing tools: In comparisons, TransFuzz found more bugs, especially silent bugs, and covered a wider range of bug types. For example, it found 31 silent bugs in PyTorch, while existing tools collectively covered only 3 out of 9 types.
  • High precision in silent bug detection: The LLM-powered self-validation module achieved a precision of 71.42% on real-world data, significantly reducing false positives.
  • Identified bugs involving API interactions: Over 50% of the silent bugs found involved interactions between multiple APIs, showcasing TransFuzz's ability to uncover complex, state-dependent issues.

Limitations and Future Work

  • False Negatives: The paper acknowledges that the conservative validation strategy, while reducing false positives, might lead to some false negatives (real bugs being missed). The authors state their primary goal was a practical framework, not exhaustive elimination of all false negatives.
  • LLM Hallucinations and Limitations: While LLMs are powerful, they can still make mistakes. The self-validation step aims to mitigate this, but expert-level reasoning for certain complex issues (e.g., compiler optimizations, floating-point behavior) might still be beyond automated analysis.
  • Cost: The Context-Aware Bug Pattern Extraction phase is computationally expensive due to the complexity of analyzing numerous issue reports.
  • Future Work: The authors suggest further optimizations for the validation process and exploring more advanced LLM reasoning capabilities. They also mention the potential to leverage LLMs for analyzing issues further to identify user-triggerability and extract additional bug patterns.

Summary updated

Abstract

Deep learning (DL) libraries are widely used in critical applications, where even subtle silent bugs can lead to serious consequences. While existing DL fuzzing techniques have made progress in detecting crashes, they inherently struggle to detect silent bugs due to the lack of effective test programs and corresponding oracles. Building on the observation that historical bug reports contain rich, underutilized information about silent bugs, we leverage large language models (LLMs) to perform versatile yet controlled bug transfer for silent bug fuzzing. Specifically, our approach uses LLMs to extract context-aware bug patterns from historical issues, match semantically related Application Programming Interfaces (APIs) using functionality-based embeddings, and synthesize test cases with customized oracles. This enables proactive detection of silent bugs by transferring high-risk contexts and oracle designs from known buggy APIs to functionally similar target APIs. To ensure the reliability of our context-aware bug transfer, we introduce an LLM-powered self-validation module that systematically evaluates the validity of each transferred bug instance. We implement this methodology in a tool named TransFuzz and evaluate it on three mainstream DL libraries: PyTorch, TensorFlow, and MindSpore. TransFuzz successfully discovers 79 previously unknown bugs (12 confirmed as Common Vulnerabilities and Exposures (CVEs)) in 10 bug types, demonstrating its effectiveness and generalizability in migrating DL library bug discovery capabilities.
BibTeX
@inproceedings{zhang2026llm,
  author = {Kunpeng Zhang and Dongwei Xiao and Daoyuan Wu and Shuai Wang and Jiali Zhao and Yuanyi Lin and Tongtong Xu and Shaohua Wang},
  title = {{LLM-Powered Silent Bug Fuzzing in Deep Learning Libraries via Versatile and Controlled Bug Transfer}},
  booktitle = {OOPSLA},
  year = {2026},
  url = {https://openreview.net/forum?id=Ririeb5t1m},
}
Figure