---
title: "Learn&Fuzz: Machine learning for input fuzzing (2017)"
description: "Learn&Fuzz learns PDF object structure from examples, then uses prediction confidence to guide fuzzing of the Edge PDF parser."
canonical: "https://research.elamur.ai/free/en/papers/godefroid-2017-learn-fuzz-machine-learning-input/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/godefroid-2017-learn-fuzz-machine-learning-input/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2017](https://md.research.elamur.ai/free/en/papers/2017/) / Learn&Fuzz: Machine learning for input fuzzing

# Learn&Fuzz: Machine learning for input fuzzing

Paper · 2017 · Patrice Godefroid, Hila Peleg and Rishabh Kumar Singh

**Authors:** Patrice Godefroid, [Hila Peleg](https://md.research.elamur.ai/free/en/authors/hila-peleg/) and [Rishabh Kumar Singh](https://md.research.elamur.ai/free/en/authors/rishabh-singh/) · **Year:** 2017 · **Venue:** IEEE/ACM International Conference on Automated Software Engineering (ASE) · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**344** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2583649498) · IEEE/ACM International Conference on Automated Software Engineering (ASE) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [DOI 10.1109/ase.2017.8115618](https://doi.org/10.1109/ase.2017.8115618)
- [arXiv 1701.07232](https://arxiv.org/abs/1701.07232)
- [OpenAlex](https://openalex.org/W2583649498)

## Deep dive: Learn&Fuzz: Machine learning for input fuzzing

Learn&Fuzz learns PDF object structure from examples, then uses prediction confidence to guide fuzzing of the Edge PDF parser. · about 34 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

Testing a parser requires a difficult balance. An input must frequently be structured enough to reach substantial parts of the program, yet unusual enough to expose mistakes in how that program handles its data. Purely random changes can destroy the structure before the interesting processing begins. Carefully generated valid inputs can have the opposite weakness: they may exercise normal behavior while leaving exceptional cases untouched. Learn&Fuzz investigates whether [machine learning](https://md.research.elamur.ai/free/en/concepts/machine-learning/) can help produce useful inputs between these extremes.

The authors learn the character patterns of textual PDF objects from existing documents. They then generate new objects and insert them into otherwise valid PDF files for testing. The learning procedure uses recurrent neural networks, which predict subsequent characters from the preceding sequence. Its training examples come from about 63,000 non-binary objects extracted from 534 PDF files. The target is the PDF parser used by Microsoft Edge, accessed through a separate testing executable. The study concerns the contents of textual objects, rather than learning every component and consistency requirement of an entire PDF document.

The generated objects often pass the parser’s checks. Across the reported learning experiments, pass rates range from 70% to 97%, with the highest result coming from a generation strategy that restricts random choices within tokens. However, the strategy that produces the most accepted inputs does not provide the greatest instruction coverage. Allowing more variation, including some malformed structure, can reach additional parser behavior. This is the paper’s central experimental finding: success at imitating accepted inputs and success at exploring a parser are related objectives, but they are not interchangeable.

The authors turn that observation into SampleFuzz, a generation procedure that occasionally substitutes an extremely unlikely character where the learned distribution strongly favors the character originally selected. Its purpose is to disturb a locally predictable part of an otherwise plausible object. In the larger comparison, SampleFuzz achieves the highest overall instruction coverage among the tested settings, with a pass rate of 68.24%. Its coverage lead over the next setting is small, and the competing settings reach some different instructions. The result supports using learned probabilities to guide mutations, without establishing a universally best mutation policy.

The main comparisons find no bugs. A separate, longer run combining learned generation with ordinary random mutation does uncover a stack-overflow defect, which the Edge development team confirms and fixes. That finding belongs to the combination using random mutation, rather than to SampleFuzz. Taken together, the experiments establish a practical way to generate useful structured test material without manually specifying its object grammar. They also show why a fuzzing system should evaluate execution behavior directly instead of choosing its generator solely by the proportion of inputs a parser accepts.

### Ideas worth borrowing

Learn the repetitive interior. A complicated format need not be learned as an indivisible whole. The authors concentrate on textual PDF objects, whose surface forms are varied but contain recurring delimiters, keywords, and value patterns. They leave document-level addressing and bookkeeping to a separate program. This division makes learning useful without requiring it to solve every constraint in the format. Elsewhere, the same idea applies when a system has a stable outer container and a rich interior: learn the variable contents while preserving the machinery needed to deliver them to the relevant processing code.

Separate acceptance from exploration. A generator can improve at producing accepted inputs while becoming less useful for testing unusual behavior. The paper measures both pass rate and executed instructions, which makes that divergence visible. This is a reusable evaluation principle whenever a generator supplies material to another program. A plausibility score describes the generated material; a behavioral measure describes what the receiving program does with it. Keeping both allows an engineer to discover whether improved conformity is helping the actual task or merely making the output look cleaner.

Use confidence to choose where to interfere. SampleFuzz treats a highly predictable character as an opportunity for a deliberate disruption. The intuition is that a strong local expectation may correspond to a convention on which the parser relies. Replacing that character with an unlikely alternative creates a targeted violation without abandoning the surrounding learned structure. This idea can inform other testing systems that possess a probability distribution over inputs: confidence can guide adversarial variation as well as ordinary prediction. The evidence here supports that use for the studied PDF objects, while leaving its transfer to other formats open.

Control randomness at meaningful boundaries. Sample and SampleSpace use the same learned distribution differently. Sample draws characters throughout generation; SampleSpace reserves that choice for positions following whitespace and otherwise favors the highest-scoring character. The comparison shows that a small change in the sampling policy can alter acceptance and coverage in different directions. The broader lesson is to treat generation policy as an experimental component. A learned distribution does not determine the diversity or usefulness of its outputs by itself; the procedure used to draw from it matters.

Compare coverage sets, not only totals. Two generators can execute similar numbers of instructions while reaching different parts of a program. The authors examine which instructions appear exclusively in each set, revealing both substantial overlap and smaller complementary regions. This analysis prevents a narrow numerical lead from being mistaken for complete replacement of another technique. It is useful whenever the practical objective is a union of discoveries: test selection, benchmark construction, and exploratory analysis can all benefit from asking what each method adds beyond the others.

Keep a conventional baseline in the loop. The study compares learned objects with original objects and also applies ordinary random mutation to both. This makes it possible to distinguish the value of new generated material from the value of adding more corruption. The eventual bug discovery reinforces the point: a learned generator and a simple mutator can work together. A sophisticated component should therefore be assessed both independently and as part of an existing pipeline. Its contribution may be to supply better starting material rather than to replace every established testing technique.

### How Mova uses it

For [Mova](https://md.research.elamur.ai/free/en/projects/mova/), the small transparent language system written in Rust, the clearest connection is [parser](https://github.com/ElamurAI/mova-free/blob/main/docs/parsers.md) testing. Any component that reads structured text has to cope with both expected constructions and unexpected combinations. Learn&Fuzz offers a way to think about generating those combinations from examples instead of enumerating every possible malformed input by hand. This is a possible engineering use of the paper; an implemented Learn&Fuzz integration in Mova is not established.

A concrete adaptation would begin with a narrowly defined input surface. Rather than attempting to reproduce all behavior of the language system, a test generator could focus on the text accepted by a particular parser or reader. Examples already known to reach that component would supply the training material. The analogy to the paper would be strongest where this material contains many repeated local patterns but remains tedious to describe exhaustively. The relevant question would be whether generated variations reach useful behavior beyond the original examples.

The PDF study also suggests keeping structural responsibilities explicit. Its learned component produces object contents, while a separate program constructs the surrounding document updates. For Mova, an analogous design could preserve a valid outer request or container while varying a selected inner fragment. That would make it easier to attribute failures to the component under examination. It would also fit the goal of transparency: the surrounding construction could remain inspectable even if the varied text came from a statistical generator.

The most transferable part may be the evaluation discipline rather than the particular neural architecture. A Mova experiment could distinguish inputs accepted by the chosen parser from inputs that expand exercised behavior or reveal a failure. Those outcomes answer different questions. A high acceptance rate would indicate that the generator had captured something about the examples. It would not establish that testing had become more effective. The paper gives a concrete reason to retain malformed outputs in the evaluation rather than discarding them automatically.

Confidence-guided mutation is another possible extension. If a future generator assigned probabilities to subsequent characters or other input units, it could occasionally perturb a strongly expected continuation. The test would then ask whether that intervention exposes handling of missing delimiters, unexpected symbols, or incompatible continuations. These are illustrative testing targets, not findings about Mova. The paper does not identify any defect in Mova or show that its input conventions resemble PDF closely enough for the same sampling policy to work unchanged.

A transparent implementation would also preserve the distinction between learned expectation and an explicit grammatical rule. Learn&Fuzz generates according to statistical regularities; it does not recover a readable specification proving which strings belong to the format. Mova could borrow its generation strategy while continuing to represent its own intended behavior explicitly. The learned component would serve as a source of challenging examples, and the parser’s observable behavior would remain the object of investigation.

Finally, any claim of benefit would need a local comparison. Existing examples, ordinary mutations of those examples, learned outputs, and mutations of learned outputs would provide different reference points. The paper’s evidence makes that comparison worth conducting, but does not predetermine its outcome. For Mova, the honest conclusion is therefore a concrete testing proposal: learn a restricted input surface, preserve enough structure to reach the relevant code, vary the sampling policy, and judge the result by observed execution and failures.

### The problem and its context

#### Why structured inputs make fuzzing difficult

Fuzzing repeatedly executes a program on varied inputs to uncover defects in the code that consumes them. The paper focuses on parsers, where an input can influence memory operations, control flow, and the handling of exceptional conditions. The testing problem is not simply to produce unusual bytes. It is to produce inputs that cause the application to perform enough meaningful work for hidden mistakes to become observable.

The authors distinguish blackbox random fuzzing, whitebox constraint-based fuzzing, and grammar-based fuzzing. Random fuzzing changes input material without deriving those changes from the program’s internal constraints. Whitebox methods use information about program execution and constraints to guide test construction. Grammar-based methods generate inputs using a representation of the accepted format. These approaches provide different ways of navigating the gap between arbitrary data and inputs that engage a parser’s substantial processing paths.

In the authors’ account, blackbox and whitebox fuzzing had already been highly successful for binary file parsers. Complex structured formats posed a different difficulty. A test may have to satisfy several layers of syntax before the target reaches the feature being tested. A grammar helps preserve those layers while allowing variation within them. The paper therefore treats grammar-based generation as especially important for applications that consume elaborate structured inputs, including browsers.

The cost is the grammar itself. Writing a comprehensive specification for test generation takes effort, and omissions can leave portions of the input space unexplored. A handcrafted grammar can also contain mistakes. Learn&Fuzz asks whether examples can supply much of that work automatically. Its contribution is not the general idea of generating tests from structure, but a particular way to acquire a generative representation from existing inputs.

#### What earlier grammar-learning approaches supplied

The paper situates its proposal beside work that learns explicit grammatical structure. Bastani and colleagues synthesize a [context-free grammar](https://md.research.elamur.ai/free/en/concepts/context-free-grammar/) from examples by progressively generalizing them. As described by the authors, the process introduces repetition and alternatives and merges grammatical categories. This supports hierarchical structure. The authors argue that PDF objects present a somewhat different opportunity: many are relatively flat, but their keys, values, and combinations are highly varied.

That distinction motivates a statistical treatment of the object text. Rather than construct an explicit collection of productions, Learn&Fuzz learns which character continuations tend to occur in context. It can then generate new combinations and expose the relative likelihood of possible continuations. The latter capability matters because the probabilities become information for fuzzing, not merely a mechanism for ordinary generation.

Other related systems infer structure by examining the program consuming the input. AUTOGRAM tracks how input fragments propagate during execution and uses that information to identify grammatical entities. Tupni also uses taint tracking to connect input material with structures in the application’s memory. These approaches obtain information from processing behavior that an example-only learner does not possess.

Learn&Fuzz instead treats the target as a black box for learning its input distribution. The training procedure does not require the parser to be instrumented for taint tracking. Coverage is measured during evaluation, but does not guide the learning described in the study. This distinction is important: the generated patterns reflect the supplied examples, instead of a learned account of which patterns unlock particular parser paths.

The paper also connects its approach to neural work on program analysis and synthesis. It describes research on learning algorithmic behavior, constructing programs from examples, correcting syntax errors, and optimizing assembly. These examples establish a surrounding interest in learning regularities of structured computational material. Learn&Fuzz redirects sequence learning toward generating test inputs, where occasional departures from accepted syntax may be beneficial.

#### Why PDF is a useful and difficult case

PDF provides a demanding setting because its specification is extensive and its object language supports many forms of data. The paper describes the specification as exceeding 1,300 pages and says that roughly 70% concerns data objects and relationships among document parts. Much of that complexity is built from recurring components. The result is a format with substantial repetition but many possible uses of that repetition.

A document contains objects, cross-reference information, and a trailer. Objects carry data and metadata. They can contain dictionaries, arrays, strings, numbers, and combinations of these forms. Dictionaries use recognizable delimiters and key syntax, while indirect references allow an object to point to another object elsewhere in the document. These local conventions provide learnable textual patterns.

The surrounding file structure creates a different class of difficulty. Cross-reference information connects identifiers with byte locations, and the trailer supplies information needed to navigate the document. These relationships depend on addresses, counts, and references that must agree across separated regions. The authors consider them less promising for the neural learning procedure explored in the paper.

That leads to a deliberate scope boundary. Learn&Fuzz learns non-binary object text. It does not learn image subformats, cross-reference construction, or the complete organization of document updates. This makes the study narrower than automatic PDF generation in its fullest sense. It also makes the experiment interpretable: a learned object can be inserted into a valid host document using explicit bookkeeping, allowing the parser to encounter the generated material.

The target strengthens the engineering relevance. The Edge PDF parser is a substantial security-sensitive implementation, and the seed documents had already supported extensive testing. The study therefore asks whether learned generation can contribute additional behavior in a setting where ordinary fuzzing has already received considerable attention. That is a more specific and demanding question than whether a generator can produce superficially plausible PDF text.

### The method, step by step

The method combines example collection, character prediction, controlled generation, and document construction. These components have distinct responsibilities. Learning captures recurring object text; sampling determines how conservatively that text is reproduced; the document-building program makes the generated object available to the parser; execution measurements determine whether the resulting tests are useful.

From existing PDF objects to evaluated tests The steps in order.

#### Select the learnable part of the format

The training material consists of non-binary PDF objects. Each object has an outer textual convention marking its beginning and end, while its contents can take several forms. The paper’s examples include a coordinate array, a string used as bookmark text, a numeric value, and an array containing different kinds of entries. These examples matter because the learner must capture more than a single fixed record layout.

A dictionary offers another recurring pattern. Delimiters mark its extent, keys have a recognizable surface form, and values can themselves contain arrays or references. The character predictor can encounter such conventions repeatedly across objects with different contents. The intended benefit is to acquire reusable regularities from the corpus rather than reproduce an individually specified object template.

Binary objects, including embedded image data, fall outside the scope of extraction. It also avoids asking the learner to maintain the file-wide address relationships used by cross-reference tables. As a consequence, a successful generated object is not by itself a complete executable test input. The later host-construction stage supplies the context required by the target parser.

#### Represent objects as character sequences

The authors use a character-level [language model](https://md.research.elamur.ai/free/en/concepts/language-model/): a predictor that assigns probabilities to continuations of a sequence. Here the sequence is PDF object text rather than ordinary prose. Training asks the network to predict subsequent characters from preceding material. No human-provided category labels are needed, because the next character in the existing text supplies the training target.

The paper introduces the recurrent computation through the hidden-state update:

```
hₜ = f(hₜ₋₁, xₜ)
```

Here, t identifies the current sequence position. The symbol xₜ denotes the input at that position, hₜ₋₁ is the preceding hidden state, and hₜ is the updated state. The function f performs a nonlinear transformation combining the current input with the information carried from earlier positions. The hidden state is therefore the network’s evolving representation of the context it has processed.

The corresponding output is written as:

```
yₜ = φ(hₜ)
```

The symbol yₜ denotes the output at position t. The function φ converts the hidden state hₜ into an output representation; the paper gives softmax as an example that yields probabilities over the available vocabulary. In this application, those alternatives are characters. The distribution describes how the predictor ranks possible continuations after processing the current context.

The next-character prediction objective is expressed through the conditional distribution:

```
p(xₜ | ⟨x₁, …, xₜ₋₁⟩)
```

The function p assigns a probability to character xₜ given the preceding sequence. The angle brackets indicate an ordered sequence, and the vertical bar separates the predicted item from its conditioning context. The subscripts locate characters within that sequence. This expression captures the basic learning problem: use the earlier characters to estimate what may follow.

A recurrent architecture can carry information across a varying amount of preceding text. The paper contrasts this with an [n-gram](https://md.research.elamur.ai/free/en/concepts/n-gram/) approach, which uses a bounded context. That comparison explains the architectural motivation; it is not an experimental claim that the chosen network outperforms an n-gram baseline in this study. No such measured baseline is reported.

#### Use an encoder and decoder

The authors describe a sequence-to-sequence architecture containing recurrent encoder and decoder components. The encoder processes an input sequence into a fixed-dimensional representation. The decoder uses that representation to generate an output sequence. During generation, its previously predicted character becomes input for the following prediction.

The sequence-level conditional distribution is written as:

```
p(⟨y₁, …, yₜ₁⟩ | ⟨x₁, …, xₜ₂⟩)
```

Here, p denotes a conditional probability over an output sequence. The y symbols identify output characters and the x symbols identify input characters. The subscripts t₁ and t₂ represent the respective sequence lengths in this rendering of the paper’s notation. The vertical bar indicates that the output distribution depends on the input sequence. The important distinction from the preceding expression is that the predicted object is now a sequence rather than an individual character.

For the actual training, the authors use an LSTM recurrent network with 2 hidden layers and 128 hidden states in each layer. The paper does not present a comparison of alternative hidden-state sizes or architectures. These values describe the configuration used to establish the case study, instead of an independently demonstrated optimum.

#### Build shifted training pairs

The training procedure begins by joining the object files:

```
s̃ = s₁ + … + sₙ
```

The symbol s̃ denotes the combined character sequence. Each sᵢ is an object file’s text, n is the number of object files being combined, and the plus signs mean concatenation. Joining the material creates a continuous source from which fixed-length training examples can be taken.

The input sequence for a training instance is then selected as follows:

```
tᵢ = s̃[i × d : (i + 1) × d]
```

The symbol tᵢ identifies training instance i. The value d is the fixed sequence length. The expression inside square brackets selects a span of s̃ between the indicated positions. Hence, i and d determine where the current training segment begins and ends. The paper gives this construction symbolically without reporting a numerical value for d.

The corresponding output sequence is offset in the combined text:

```
oₜ = s̃[i × d + 1 : (i + 1) × d + 1]
```

The symbol oₜ is the paper’s notation for the output associated with the selected training sequence. The meanings of s̃, i, and d remain the same. Adding 1 to the boundary positions shifts the selected characters forward relative to the input. This supplies the next-character targets directly from the corpus, so the training procedure needs no separately annotated answers.

The network is trained over these paired sequences. An epoch means a complete pass through the training data. The authors examine training runs of 10, 20, 30, 40, and 50 epochs. In their setting, an epoch takes about 12 minutes; the 50-epoch run takes about 10 hours. These are reported training costs for the study’s setup, rather than general timing guarantees.

#### Generate an object from a starting marker

Generation begins from an object-start prefix based on `obj`. The learned distribution supplies subsequent characters, and the process looks for `endobj` as the closing marker. This converts the predictor into an input generator. The crucial design choice is how to select a character from the available probabilities.

NoSample selects the highest-probability continuation at every position. This is a greedy policy: it repeatedly chooses the locally favored character. The authors expect it to preserve structure well, but the same prefix leads to the same continuation. As a result, it cannot supply the variation needed for the fuzzing task. Its weakness illustrates that a predictor and a useful test generator are different things.

Sample instead draws each next character according to the learned probabilities. Frequent continuations remain likely, but alternatives can occur. Repeated generation from the same starting prefix can therefore produce different objects. Some combinations will be malformed, which is not automatically a failure for testing. Their value depends on what processing they induce before rejection or completion.

SampleSpace limits where this randomness occurs. After whitespace, it samples from the distribution; within a token, it selects the highest-probability character. The policy aims to vary which textual units appear while making their internal spelling more stable. It is a small intervention in generation, but it changes the balance between conformity and diversity.

These policies use the same underlying learned information for different purposes. NoSample emphasizes predictable continuation. Sample emphasizes wider variation. SampleSpace attempts to preserve tokens while varying transitions around them. Their comparison is therefore an examination of how to use learned structure, instead of a comparison between independently designed grammatical representations.

#### Introduce confidence-guided disruption

SampleFuzz adds an explicit mutation decision during generation. It receives the learned distribution, a fuzzing-control parameter called t_fuzz, and a confidence threshold called p_t. At a generation step, the algorithm first samples a candidate character c and obtains its probability p(c).

If that candidate’s probability exceeds p_t, the position becomes eligible for fuzzing. A random draw supplies the further decision controlled by t_fuzz. The description specifies that the mutation occurs when the draw exceeds that parameter. This detail matters because the parameter’s operational meaning comes from the comparison used by the algorithm, rather than simply from calling it a fuzzing probability.

When the mutation is taken, the algorithm substitutes a different character c′ with minimal probability under the current distribution. The intended effect is stronger than choosing another ordinary continuation. It deliberately inserts something the predictor regards as particularly unexpected in that context.

The intuition depends on preserving surrounding structure. If generation were already arbitrary, selecting an unlikely character would offer little distinctive guidance. Here, the object is mostly drawn from learned patterns, and the disruption is introduced at a position where those patterns make a strong prediction. The resulting test can combine plausible context with a concentrated local violation.

The evaluation uses t_fuzz = 0.9 and p_t = 0.9 with the network trained for 40 epochs. The paper reports no parameter sweep establishing that these thresholds are best. It also describes a length bound named MAXLEN. Although generated length is bounded in the algorithm, the authors do not claim a general termination guarantee; they say that termination occurred in their practical runs.

#### Place the generated object into a real document

The parser accepts complete PDF files, so the authors implement a program that appends an object through PDF’s incremental-update mechanism. This is an essential part of the method. A generated fragment cannot contribute coverage if it is never encountered inside a document the parser can navigate.

The program first locates the host document’s final trailer. From the host it obtains information needed to construct the update, including object and cross-reference details. It appends a body containing the generated object, using an identifier that overrides the host’s final object. It then writes updated cross-reference information, advances the generation number for that object, and appends a new trailer.

This stage contains explicit format knowledge. The paper’s claim of learning without format-specific customization concerns the statistical learning approach, not an absence of any PDF-specific engineering in the complete experiment. Object extraction and valid document reconstruction still require understanding the surrounding format.

The use of multiple hosts also acknowledges that object contents do not determine execution alone. References and existing document structure can affect how the appended material is interpreted. Testing the same object through different hosts allows the authors to observe that interaction instead of assuming a fragment has a fixed, context-independent coverage contribution.

### Experiments and results

#### Target, data, and measurements

The target is the PDF parser embedded in Microsoft Edge. The authors execute it through a single-process testing driver supplied for fuzzing. The driver accepts a PDF file, runs the parser, records [parsing](https://md.research.elamur.ai/free/en/concepts/parsing/) errors when present, and exits. The experimental machines are 4-core, 64-bit Windows 10 virtual machines with 20Gb of RAM.

The training corpus contains about 63,000 non-binary objects extracted from 534 PDF documents. The documents had already been used in extended testing of the parser. Their selection resulted from seed minimization: a smaller collection retained the instruction coverage of a larger source collection. The source documents came from several places, including earlier fuzzing material and publicly collected files.

This provenance matters. The corpus is not described as a random sample of all PDF documents. It is a testing-oriented collection selected in part for its coverage properties. Learning from it may therefore inherit useful diversity, while also inheriting the boundaries of what those seeds contain.

Instruction coverage is the primary behavioral measure. For a test, the authors collect the distinct executed instructions, identifying each through its library name and offset. For a collection of tests, coverage is the union of those instruction sets. The reported totals therefore measure distinct instructions reached by the collection, rather than an average per file.

Pass rate measures whether the execution log contains a parsing-error message. An execution with no such message is counted as passing. This is an operational measure of acceptance by this parser. It helps assess how closely generated objects resemble inputs the implementation accepts, but it does not independently certify conformance to the complete PDF specification.

Bug detection uses AppVerifier to monitor executions for defects such as memory corruption. The study thus separates behavioral reach, apparent acceptance, and actual failures. That separation is necessary because an increase in executed instructions does not on its own imply a discovered vulnerability.

#### Establish the effect of the host document

The baseline study randomly selects 1,000 objects from the training corpus. Each is combined with each of the selected hosts. The authors choose the smallest three documents in the seed collection as hosts; their reported sizes are 26Kb, 33Kb, and 16Kb.

The hosts already execute a substantial amount of parser code. The comparison below shows their reported coverage where exact totals are stated in the paper, together with the union baseline obtained after adding the selected original objects. The starred setting is the highest-coverage configuration in this comparison.

Host and baseline coverage in the Edge PDF parser Appending original objects expands coverage beyond the host union.

**The numbers**

| System or setting | unique instructions |
| --- | --- |
| host1 | 353,327 |
| host2 | 457,464 |
| host123 | 494,652 |
| baseline123 (this paper) | 553,873 |

The paper reports 59,221 instructions between the host union and the combined baseline. It also describes 90% of the overall baseline instruction set as already present in host execution. This makes the measurement challenge clear: most observed activity comes from processing a complete document, while the experimental object affects a smaller portion of the total.

File size does not determine coverage. The smallest host does not produce the smallest instruction set. Nor can a host be assumed to preserve the same interaction with every appended object. The authors therefore retain both host-specific results and a union across hosts.

The host validation reports a pass rate of 100% across the hosts, and the baseline recombination procedure produces files accepted by the parser. Processing 1,000 files, including coverage collection, takes about 90 minutes. These costs explain why larger test collections become substantial experiments even before considering training time.

#### How well generated objects are accepted

For each investigated training duration, the authors generate 1,000 unique objects. Comparing these outputs with the training corpus finds no exact matches. This is evidence against literal reproduction of complete training objects in the generated sets. It does not, on its own, measure how much of each object’s internal structure is new.

SampleSpace consistently has a better pass rate than Sample. At 10 epochs, Sample already exceeds 70% acceptance. The paper interprets this as evidence that useful structure has been learned relatively early. More training improves acceptance in the reported experiments, and SampleSpace reaches the highest pass rate, 97%, at 50 epochs.

Acceptance is also stable across host choice. The reported host-to-host variation is at most 0.1%. This contrasts with coverage, which changes substantially with the host. The distinction suggests that the hosts usually agree about whether the appended material is acceptable while still causing different internal work.

These results support a specific conclusion: example-based character learning can produce many new objects that this PDF parser accepts. They do not establish that all necessary relationships within those objects have been learned, or that equivalent acceptance would hold in another parser. The measurement is grounded in the tested implementation’s error reporting.

#### Coverage from generated objects

The coverage experiment compares Sample and SampleSpace across the different training durations and hosts. For host1 and host2, their generated-object collections usually exceed the corresponding original-object baseline. For host3 and the union across hosts, they typically remain below it.

The strongest overall generated-object result comes from Sample after 40 epochs. The original-object union baseline ranks behind that setting. SampleSpace also reaches its best coverage at 40 epochs, even though its highest acceptance occurs with longer training.

This is a central result because it breaks a tempting selection rule. If the authors had chosen the generator solely by pass rate, they would have favored the most accepting setting. The coverage evaluation instead favors a noisier generation policy and a different training duration. Improving conformity is therefore insufficient as a stand-in for improving fuzzing effectiveness.

The host-specific differences also limit any simple story about one generator being uniformly better. A collection can improve coverage in a particular host while losing ground when all host results are combined. The paper’s use of union coverage prevents those local gains from automatically becoming a global claim.

#### Add ordinary random mutation

The Random baseline chooses byte positions and replaces their values with random alternatives between 0 and 255. Its fuzz-factor is 100, which the paper uses to set the average number of changed bytes relative to file length. This provides a conventional mutation procedure against which to assess the learned generation policies.

The authors create 10 mutated variants of each original or generated object used in this comparison. They apply this to Sample objects from 40 epochs, SampleSpace objects from 40 epochs, and original baseline objects. Recombining each object collection with the hosts produces comparison sets containing 30,000 PDF files.

They also evaluate Sample-10K, in which Sample directly generates 10,000 objects. This comparison asks whether additional ordinary generation provides a benefit without adding explicit corruption. SampleFuzz is evaluated using the learned distribution from the 40-epoch run and the reported threshold settings.

Running and measuring each batch of 30,000 PDF files requires approximately 45 hours. The larger comparison therefore concerns substantial batches of complete parser runs, not merely the visual plausibility of a few generated examples.

Random mutation increases coverage for the tested source collections while reducing their pass rates below 50%. Directly generating more Sample objects also expands coverage: Sample-10K adds 6,173 instructions relative to the smaller Sample collection, while maintaining acceptance around 80%.

SampleFuzz obtains the highest coverage in this comparison, with a pass rate of 68.24%. The next setting, Sample combined with Random, trails it by 670 instructions in total coverage. The paper reports that the learning-based alternatives are competitive with mutations of original baseline objects, and that three learning-based settings exceed that baseline’s coverage.

#### A narrow lead with complementary behavior

The leading settings do not cover identical instruction sets. SampleFuzz reaches 2,622 instructions absent from Sample combined with Random. In the opposite direction, the random-mutation combination reaches 1,952 instructions absent from SampleFuzz.

Exclusive instruction coverage of the leading Edge PDF test sets Both settings reach instructions absent from the other setting.

**The numbers**

| System or setting | instructions absent from the competing set |
| --- | --- |
| Sample + Random | 1,952 |
| SampleFuzz (this paper) | 2,622 |

These values measure each setting’s exclusive contribution relative to its competitor; they are not total coverage. The comparison is useful because it explains the practical meaning of the narrow overall lead. SampleFuzz is the best individual setting by the reported total, but keeping the competing mutation strategy could still add behavior.

The authors interpret the best balance in their experiments as an acceptance range around 65%-70%. Enough objects remain plausible to support substantial parsing, while enough are malformed to engage exceptional behavior. This is an empirical interpretation of this study, not a threshold demonstrated to optimize arbitrary fuzzing tasks.

#### What happened with bug discovery

No bugs are found in the main experiments. The authors note that the parser had already undergone months of testing, including whitebox fuzzing, and that previously discovered defects had been repaired in the version they tested. This background helps explain the difficulty of finding another bug, but does not convert coverage gains into evidence of undiscovered vulnerabilities.

A longer run using Sample combined with Random processes 100,000 objects through 300,000 PDF files. The experiment takes almost 5 days. It finds a stack-overflow defect triggered by unexpected recursion in the parser.

The triggering file has a reported size of 33Kb. The failure therefore does not depend on an unusually large input in the account given by the paper. The Edge team confirms the defect and fixes it.

This result establishes that learned object generation can participate in a pipeline that discovers a real parser bug. It does not show that SampleFuzz finds more bugs than random mutation, since the reported defect comes from the other combination and the extended experiments are not presented as an equal-budget bug-finding comparison.

### What the ablations show

The paper offers controlled comparisons of generation policies, training duration, hosts, and mutation procedures, rather than a broad architectural ablation.

#### Training longer improves one objective more clearly than another

The epoch comparison is the clearest test of the relationship between learning quality and testing value. More training generally improves pass rate in the reported runs. That is consistent with a predictor becoming better at reproducing conventions in its examples.

Coverage does not follow the same ordering. The best overall Sample result occurs at 40 epochs, while the strongest acceptance result is associated with SampleSpace at 50 epochs. The comparison therefore shows that selecting a training checkpoint is part of the testing design. The checkpoint preferred for conformity may differ from the checkpoint preferred for behavioral reach.

The study does not isolate why a particular checkpoint reaches particular instructions. It offers a plausible account involving malformed inputs and error handling. The experiment establishes the divergence in outcomes; the account of internal causes remains an interpretation rather than a detailed attribution of every extra instruction.

#### Restricting randomness preserves acceptance

SampleSpace changes the sampling policy while retaining the learned distribution. By choosing greedily inside tokens, it protects recurring textual units from some accidental corruption. Its consistently higher pass rate supports the intended effect of that restriction.

However, Sample obtains stronger overall coverage. The comparison suggests that some of the variation suppressed by SampleSpace is useful for testing. A generator that preserves tokens more carefully can miss behaviors reached when those tokens or their surroundings are disturbed.

This is a meaningful controlled comparison because it changes how probabilities become text, instead of changing the training corpus or parser. Even so, it does not prove that whitespace is the uniquely appropriate boundary. The paper examines this particular boundary policy without comparing a larger family of token-aware sampling rules.

#### Host choice changes what an object can exercise

The host comparison shows that generated fragments cannot be assigned a universal coverage value independently of context. The same generation setting produces different coverage patterns across the selected documents. Some settings improve on the baseline for particular hosts but perform less strongly in the combined result.

Acceptance remains almost unchanged across hosts. That makes the contrast especially informative: apparent well-formedness is relatively stable, while internal execution is context-sensitive. A test pipeline that validated only acceptance could overlook this interaction.

The experiment also shows why host-only coverage needs to be measured. When a complete document already reaches much of the observed instruction set, a large total can obscure the smaller contribution associated with appended objects. The baseline makes that background work visible.

#### Set overlap qualifies the ranking

The overlap analysis compares the best 40-epoch Sample setting with SampleSpace, original objects, and hosts. Sample is almost a superset of the others, but not an exact replacement. SampleSpace reaches 1,680 instructions absent from Sample, while Sample reaches 10,799 absent from SampleSpace.

SampleSpace and the original-object baseline are also incomparable. SampleSpace contributes 3,393 instructions not covered by that baseline, but lacks 6,514 instructions that the baseline reaches. A lower total therefore does not imply an absence of useful novelty.

These analyses support a portfolio interpretation. A setting can be less successful as an individual collection and still add coverage to a combined campaign. The evidence is more informative than a single ranking because it identifies both dominance-like behavior and residual complementarity.

#### Explicit mutation adds another kind of diversity

Applying Random to the different object sources raises coverage and lowers acceptance. Increasing the number of directly generated Sample objects also raises coverage, but preserves a much higher pass rate. These comparisons show that producing more plausible variations and corrupting existing variations are distinct ways to expand testing.

SampleFuzz adds a further alternative: use the learned distribution to choose where corruption occurs. Its leading coverage result supports the usefulness of that policy in the tested setting. The comparison does not establish which component is responsible for every gain, because the paper does not separately test all possible combinations of confidence thresholds, replacement rules, and mutation frequencies.

In particular, there is no reported experiment contrasting the least-probable replacement with a different replacement distribution under otherwise identical conditions. The results validate the complete SampleFuzz policy as evaluated, while leaving the individual design choices open to further investigation.

### Limitations

#### Limits explicitly acknowledged by the authors

The scope is textual PDF objects, not the complete PDF format. The authors exclude binary contents and do not attempt to learn the construction of cross-reference tables or trailers. Those components involve relationships among addresses, counters, lists, and references that the chosen approach does not solve.

This boundary is substantial. A learned object generator depends on explicit surrounding machinery to become a working document test. The paper therefore demonstrates an automated way to learn a useful portion of input structure, rather than a general procedure that learns every requirement from arbitrary raw files.

The authors also acknowledge that results may differ for other applications. Their argument about conflicting learning and fuzzing objectives is broader than the particular coverage ordering, but the experiments remain concentrated on a single format and parser. Neither the best sampling policy nor the observed acceptance balance is established as universal.

The learning procedure is independent of target behavior. It does not receive coverage feedback while acquiring the object distribution. The authors identify feedback-guided learning, potentially through reinforcement learning, as future work. The current system can imitate the corpus effectively without knowing whether a particular pattern opens a valuable new parser path.

The SampleFuzz algorithm has a further stated qualification: the authors do not provide a general guarantee of termination, in spite of observing termination in their runs. Its practical behavior in these experiments should therefore be distinguished from a proof about all possible executions.

Finally, the paper acknowledges the limited bug results. The main comparisons find no defects, and the confirmed failure appears during a longer experiment. That is an important restraint on the conclusion. The study offers stronger comparative evidence about coverage and acceptance than about vulnerability discovery.

#### Limits visible in the experimental design

The corpus and target are closely connected. The seed documents had already been used to test this parser and were minimized with coverage in mind. This is a sensible engineering source of examples, but it differs from learning a format from an unrestricted collection of ordinary documents.

As a consequence, the study does not show how well the procedure would work with a much narrower or less varied corpus. Nor does it establish how much of the observed benefit depends on the seed collection’s previous testing history. The training data already contain material selected to exercise the target.

There is also no held-out grammar evaluation establishing how completely the learned distribution represents valid PDF object structure. The pass-rate measurement uses the same parser that serves as the testing target. It tells the reader which generated files avoid that implementation’s recorded errors, not which objects satisfy every rule of the specification.

The absence of exact training-object matches is useful but limited. It rules out identical whole-object reproduction in the generated collections checked by the authors. It does not quantify memorized substrings, measure semantic novelty, or show that every generated combination represents a distinct behavior.

The study examines a restricted architectural configuration. It reports an LSTM setup and varies training duration, but does not compare alternative recurrent designs, hidden-state sizes, or explicit grammar learners under the same conditions. Claims about the superiority of the chosen architecture would therefore exceed the evidence.

The same qualification applies to the confidence-guided mutation rule. SampleFuzz uses the reported thresholds and selects an extremely unlikely replacement. Without a wider parameter comparison, the study cannot establish whether confidence gating, mutation frequency, or the replacement choice contributes most to its result.

#### Coverage is useful but incomplete evidence

Instruction coverage records whether a machine instruction executes. It does not describe every state in which that instruction runs, every relationship among input values, or whether the execution threatens a security property. A collection can increase coverage without discovering a defect.

Conversely, a defect can depend on a difficult combination of states in code that other tests already execute. The paper’s coverage results therefore support claims about behavioral reach at the instruction level. They should not be read as a complete measurement of testing adequacy.

The large contribution from host documents adds another interpretive constraint. Much of each total reflects work that occurs before considering the distinctive effect of generated objects. The authors address this through host baselines and set comparisons, but the totals remain measurements of complete document executions.

The narrow lead of SampleFuzz also deserves careful treatment. Its total coverage is highest in the larger comparison, yet the competing random-mutation setting reaches instructions that it misses. This makes “best” conditional on the chosen aggregate metric and test collection. It does not imply that the other strategy can be removed without losing behavior.

The reported experiments also do not provide uncertainty estimates across repeated independent campaigns. Sampling and random mutation can affect which objects appear and which paths are reached. Without a distribution of repeated outcomes, a reader cannot determine how stable every small ordering would be under reruns.

#### Acceptance is a diagnostic, not a universal target

The observed acceptance range associated with strong coverage is informative precisely because it differs from perfect conformity. However, it should not become a fixed engineering target. Another parser might reject malformed material earlier, tolerate it differently, or contain important behavior behind constraints the generator has not learned.

The explanation involving error-handling code is reasonable and consistent with the observed tradeoff, but the paper does not map every coverage gain to a particular class of error handling. Some gains could involve different normal paths or interactions with the host. The measured result is the coverage difference; the broader causal account has less direct resolution.

Likewise, very high acceptance is not inherently undesirable. It may be necessary to reach deep processing stages in some tasks. Learn&Fuzz shows that acceptance alone is insufficient for selecting a generator. It does not show that making inputs more valid always reduces useful testing.

#### The confirmed bug supports a narrower claim

The longer experiment demonstrates a real failure from the combined learned-generation and random-mutation pipeline. It does not establish that the learned generator was indispensable to finding that specific defect. The paper does not report an equal-duration campaign that isolates whether ordinary mutations of the original seeds would also discover it.

It also does not establish a comparative bug-finding advantage for SampleFuzz. The highest-coverage setting and the setting responsible for the confirmed defect are different. Preserving that distinction prevents the strongest coverage result from acquiring a bug-discovery claim that the experiments do not supply.

The overall conclusion remains useful in spite of these boundaries. Learned probabilities can generate accepted structured fragments, sampling choices can change their testing value, and probability-guided disruption can compete with conventional mutation. The limits concern how far those findings generalize and which causal or security claims the measurements can support.

### What came after

No later citing studies are identified here, so a documented chain of subsequent results cannot be established. The earlier systems discussed in the paper belong to its intellectual context; they should not be presented as later extensions of Learn&Fuzz.

The authors do set out a clear continuation toward richer document structure. Their experiment separates learned object text from explicitly maintained document invariants. Future work could try to bridge that separation by learning more of the relationships among object bodies, cross-reference information, and trailers. They suggest that logical inference combined with neural methods might help maintain those relationships.

That direction follows directly from the study’s boundary. Local character regularities are useful for generating object contents, but complete documents also require agreement across distant positions. A richer approach would need to preserve those dependencies while retaining enough freedom to create challenging tests. The paper proposes this as an open problem, not as an accomplished extension.

The other proposed continuation is learning from the parser’s feedback. In the reported system, the corpus determines the learned distribution, while coverage is examined afterward. Feedback-guided learning would connect those stages: observed execution could influence which patterns the generator favors. The authors mention reinforcement learning as a possible mechanism.

These proposals address complementary limitations. Richer structural reasoning could help generated material satisfy more document-wide requirements. Behavioral feedback could help prioritize material that exercises additional code. Neither would remove the fundamental need to balance conformity with disruption.

The lasting research question posed by Learn&Fuzz is therefore specific and practical: how should a generator use its knowledge of normal inputs when its purpose is to uncover abnormal program behavior? The study’s answer is to treat that knowledge as both a construction aid and a guide to selective violations, then evaluate the resulting tests against the program itself.

## Cite

Cite as Patrice Godefroid, Hila Peleg and Rishabh Kumar Singh. 2017. Learn&Fuzz: Machine learning for input fuzzing. IEEE/ACM International Conference on Automated Software Engineering (ASE).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1109/ase.2017.8115618](https://doi.org/10.1109/ase.2017.8115618) · [arXiv 1701.07232](https://arxiv.org/abs/1701.07232)

```bibtex
@inproceedings{godefroid2017learn,
  title = {{Learn\&Fuzz: Machine learning for input fuzzing}},
  author = {Patrice Godefroid, Hila Peleg and Rishabh Kumar Singh},
  booktitle = {IEEE/ACM International Conference on Automated Software Engineering (ASE)},
  year = {2017},
  doi = {10.1109/ase.2017.8115618},
  eprint = {1701.07232},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/ase.2017.8115618}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
