Introduction
Software security has long relied on fuzzing—a dynamic testing technique that feeds random or mutated inputs to programs to trigger crashes. However, traditional fuzzers often hit an "intelligence bottleneck," struggling to generate the complex, structured inputs required by modern software like compilers and deep learning libraries. This survey explores the emergence of Large Language Models (LLMs) as a transformative solution, moving fuzzing from random bit-flipping to context-aware, semantic-driven test generation.
The Intelligence Bottleneck in Traditional Fuzzing
Traditional fuzzing methods typically rely on predefined rules or simple mutations. While effective for finding shallow bugs, they lack the semantic understanding necessary to navigate complex execution paths. The challenges are primarily twofold:
- Manual Effort: Defining initial "seeds" and writing test drivers remains a labor-intensive process.
- Semantic Blindness: Standard tools do not "understand" the code structure, often producing syntactically invalid inputs that are immediately rejected by the target program.
Methodology: Integrating LLMs into the Fuzzing Lifecycle
Researchers are integrating LLMs into the fuzzing workflow through two primary tracks: prompt engineering and specialized fine-tuning. By leveraging models like GPT-4, CodeX, and StarCoder, tools can now generate valid but "edge-case" code snippets and perform intelligent seed mutations that preserve structural validity while exploring new logic.
As shown in the figure above, the LLM-based fuzzing cycle involves prompt engineering, seed mutation, and a feedback loop where execution results (crashes, coverage, or errors) are used to refine subsequent generations. This process is evaluated across three main dimensions: code quality (e.g., coverage), performance (e.g., bug discovery rate), and time efficiency.
Comparative Landscape of LLM-Based Fuzzers
The current research landscape features a variety of tools tailored to specific software domains, ranging from AI frameworks to network protocols. These methods utilize different underlying models and benchmarking datasets to validate their effectiveness.
As detailed in the table, tools like TitanFuzz and FuzzGPT focus on AI software using models like CodeGen and ChatGPT, while others like CHATAFL and OSS-Fuzz target non-AI software using grey-box or black-box testing strategies. This diversity demonstrates the broad applicability of LLMs across different software layers.
Key Insights and Performance Gains
The primary advantage of LLM-based fuzzing is the shift from syntax-heavy to semantic-heavy generation. Key innovations include:
- Infilling Techniques: Tools like TitanFuzz use "fill-in-the-middle" capabilities to generate diverse, syntactically correct test cases by masking and completing parts of valid programs.
- Feedback Loops: Modern fuzzers feed error messages back into the LLM, allowing the model to "learn" from its mistakes and fix invalid inputs in real-time.
These advancements have led to significant results. For instance, TitanFuzz increased API coverage in TensorFlow by 91.11% compared to traditional tools. Similarly, FuzzGPT detected 76 bugs, 49 of which were previously unknown and subsequently confirmed by developers.
Challenges and Future Directions
Despite their success, LLM-based fuzzers face several hurdles:
- Hallucinations: Models may generate calls to non-existent APIs, leading to false positives.
- Computational Cost: Generating millions of test cases via large models is significantly slower and more expensive than traditional C-based bit-flipping.
- Data Bias: Models are limited by their training data, potentially leaving "blind spots" in less common programming patterns.
Future research is expected to move toward Multi-Agent systems, where specialized AI agents collaborate to find vulnerabilities, and expanding these techniques into Hardware Testing to verify chip logic and communication protocols.
Summary updated