Table of Contents
Fetching ...

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

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

TL;DR

This work uses large language models (LLMs) to perform versatile yet controlled bug transfer for silent bug fuzzing and introduces an LLM-powered self-validation module that systematically evaluates the validity of each transferred bug instance.

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.

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

TL;DR

This work uses large language models (LLMs) to perform versatile yet controlled bug transfer for silent bug fuzzing and introduces an LLM-powered self-validation module that systematically evaluates the validity of each transferred bug instance.

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.
Paper Structure (27 sections, 8 equations, 25 figures, 11 tables, 1 algorithm)

This paper contains 27 sections, 8 equations, 25 figures, 11 tables, 1 algorithm.

Figures (25)

  • Figure 1: Testing silent bugs: Manual Analysis demands hand-crafted test programs for many APIs; existing API-Based Fuzzers struggle with rigid API selection and oracle design.
  • Figure 2: Two Examples of Silent Bug Transfers.
  • Figure 3: Oracle Design Similarity vs. Functional and Usage Scenario Similarity.
  • Figure 4: The Workflow of TransFuzz, which consists of four main stages: Bug Pattern Extraction, High-Risk API Scanning, Context-Aware Bug Transfer, and Bug Validation.
  • Figure 5: Overview of LLM-powered self-validation.
  • ...and 20 more figures