arXiv:2610.31342cs.SEOct 2026

Manuscript Offprint

arXiv:2610.31342

Typed Template Fuzzing

Lu Maltsis, Dominik Winterer

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

LU MALTSIS, University of Manchester, United Kingdom

DOMINIK WINTERER, University of Manchester, United Kingdom

Fuzzing software with complex inputs has been a longstanding challenge. Traditionally, fuzzers either programmatically encode language constraints, requiring significant engineering effort, or rely on users to declare grammars and constraints. Recent LLM-based fuzzers address these drawbacks but introduce new issues. Some use LLMs for test generation, sacrificing throughput and producing invalid inputs when the LLM makes mistakes. Others rely on language-specific parsers, static analysis, and AST manipulation libraries.

We introduce Typed Template Fuzzing (TTF), a lightweight LLM-based fuzzing methodology. The key idea is to use LLMs in a preprocessing step to transform seeds into typed templates. The typed templates then enable semantically aware, mutation-based fuzzing without language-specific parsers, type checkers, or further LLM queries during fuzzing. By exploiting the correspondence between seeds and templates, TTF can moreover repair LLM mistakes. We have implemented TTF in our tool Typos, which we evaluate across 21 input languages, including C, C++, Go, Rust, SystemVerilog, Scala, and Java, as well as libraries such as PyTorch and Qiskit. In a six-month fuzzing campaign, we reported 135 bugs, 128 of which were previously unknown. Perhaps most notably, on average 96% of Typos's mutants are valid, coming close to the validity rates of domain-specific fuzzers. Our evaluation further shows Typos's benefits over the state of the art.

1 Introduction

Fuzzing is an automated testing technique for generating high input volumes to trigger unexpected behavior. Compilers, interpreters, constraint solvers, and libraries feature complex input languages, making it challenging to generate semantically valid input to exercise deep program behavior.

Traditionally, two families of fuzzers address this challenge. Domain-specific fuzzers [14, 37] programmatically encode input language constraints. While often producing valid input at a near-perfect rate, they require significant engineering effort to build and cannot be easily adapted to evolving languages. Domain-agnostic fuzzers include AFL-based [8, 38], grammar-based [13, 21, 29], and language-based fuzzers [24]. These approaches either achieve low validity rates or require users to declare grammars and language constraints.

Recently, researchers have been using LLMs to address the shortcomings of the two fuzzing families (see Table 1 for a taxonomy). One way is to use LLMs for test generation in the fuzzing loop [34, 36]. While such an approach incurs low user effort, the drawback is that almost every mutant relies on a new LLM query, making fuzzing slow and costly. Moreover, LLM mistakes cannot be corrected, resulting in a high proportion of invalid mutants. LegoFuzz [16] uses LLMs to produce a corpus of self-contained functions for mutating C programs. While LegoFuzz frees the fuzzing loop from LLM calls, it needs C-specific AST manipulation tooling and cannot repair LLM mistakes. MetaMut and Once4All [18, 25] use LLMs to generate code. Both feature repair mechanisms but remain domain-specific as the LLM-generated code relies on language-specific tooling (e.g., AST manipulation, parsing). Most recently, GenToo [27], an agentic approach for writing fuzzers for Java libraries, was proposed. While GenToo has an LLM-free fuzzing loop and repair for LLM mistakes, it is domain-specific, i.e., it relies on Java-specific static analysis.

Typed Template Fuzzing. We propose Typed Template Fuzzing (TTF), a lightweight LLM-based fuzzing approach. Its key idea is to use an LLM to create typed templates from a set of initial program seeds once, upfront, in a preprocessing step. The resulting typed templates contain annotations with type and scope information but are otherwise identical to the original seed programs. This

Authors' Contact Information: Lu Maltsis, University of Manchester, Manchester, United Kingdom, lu.maltsis@postgrad.manchester.ac.uk; Dominik Winterer, University of Manchester, Manchester, United Kingdom, dominik.winterer@manchester.ac.uk.

Lu Maltsis and Dominik Winterer

Table 1. Taxonomy of LLM-based fuzzers targeting complex input formats. Existing approaches either rely on language-specific tooling, LLM input generation in the fuzzing loop or cannot repair LLM mistakes. Typos uses the LLM to annotate seed files in preprocessing, requiring no language-specific tooling and no LLM calls in the fuzzing loop, and can repair LLM mistakes.

LLM-Based FuzzerLanguage-AgnosticLLM-Free Fuzzing LoopRepairs LLM ErrorsLLM Task
Fuzz4All [34], WhiteFox [36]✓✕✕Test input generation
LegoFuzz [16]✕✓✕Code fragment generation
MetaMut [18], Once4All [25]✕✓✓Write fuzzing code
GenToo [27]✕✓✓Generator synthesis
Typos (ours)✓✓✓Annotate seed files

correspondence allows us to repair LLM mistakes using a simple repair procedure. Given the typed templates, TTF chooses an expression at random and replaces it with a newly generated one of the same type. TTF has several distinctive advantages. First, TTF does not require domain-specific tooling such as a parser or type checker. Second, it does not need repeated LLM calls in the fuzzing loop or LLM-based iterative refinement. We realize Typed Template Fuzzing in a practical tool Typos, which we have extensively evaluated across 21 input languages. Our results reveal that Typos's mutated test inputs are valid in 96%96\% of cases on average, nearly matching purpose-built domain-specific fuzzers and outperforming or matching the previous state of the art in LLM-based fuzzing. We further conducted a bug-hunting campaign of 6 months on 27 targets across 21 languages, including GCC, G++, Clang, Clang++, rustc, Go, gccgo, javac, scalac, JerryScript, cvc5, Z3, slang, solc, Roslyn (csc), erlc, kotlinc, Lua, Perl, PHP, CPython, DuckDB, SQLite, scriptc, tsc, PyTorch and Qiskit. We found 128 new bugs, of which 74 have already been fixed by project maintainers.

The source code of Typos, seed files, prompts, experimental data, and evaluation scripts are available in our replication package (see Data Availability).

Main Contributions. In sum, we make the following main contributions:

  • We propose Typed Template Fuzzing, a lightweight LLM-based fuzzing methodology. The key idea is to use an LLM upfront in a preprocessing step to transform seeds into templates that are then used for fuzzing. TTF is language-agnostic, has an LLM-free fuzzing loop, and is able to repair LLM mistakes;

  • Based on Typed Template Fuzzing, we implemented an effective tool Typos with which we conducted several in-depth evaluations to assess its effectiveness. Perhaps most notably, we observe that Typos produces valid inputs at a rate of 96%96\% on average across all languages, which is within a few percentage points of domain-specific fuzzers;

  • We conducted a bug-hunting campaign on 21 input languages and 27 targets during which we reported 135 new bugs, out of which 107 bugs were confirmed and 74 bugs were fixed.

References (21)