Abstract
Binary decompilation—the process of reversing compiled code into human-readable source—is a critical task for security auditing and software maintenance. However, existing datasets for training Large Language Model (LLM) decompilers often lack real-world complexity or functional completeness. This paper introduces Decompile-Bench, a million-scale dataset of high-quality binary-to-source function pairs. By employing a novel Compile-Trace-Filter (CTF) framework, the authors curated two million pairs from thousands of GitHub repositories. Models trained on this data demonstrate significant improvements in re-executability and readability, narrowing the gap between open-source models and state-of-the-art commercial systems.
Introduction
Decompilation is inherently lossy. The compilation process strips away variable names, comments, and structural metadata, leaving behind optimized machine code. While LLMs excel at reconstructing these missing semantic layers, their efficacy is bottlenecked by the quality of training data. Most current benchmarks rely on synthetic code or simple competitive programming snippets that do not reflect the aggressive optimizations (e.g., function inlining) found in production software.
The CTF Framework: Building a High-Fidelity Dataset
To bridge the gap between "toy" datasets and real-world software, the researchers developed the Compile-Trace-Filter (CTF) framework. This pipeline ensures that the resulting dataset is both functionally accurate and representative of modern compilation practices.
1. Compile
The team utilized a patched version of the Clang compiler to process 3,961 permissively licensed C/C++ repositories from GitHub. By forcing optimization levels from -O0 to -O3 while retaining DWARF debug information, they created a ground-truth mapping between binary segments and source lines.
2. Trace
Standard DWARF mappings often break under heavy optimization. To counter this, the authors introduced a Source-Trace algorithm. This tool uses Tree-sitter to parse the original source code and identify function boundaries. It then maps binary segments to the source function with the "maximum intersection," ensuring that even inlined or heavily transformed code is correctly paired.
3. Filter
Raw compilation data is notoriously noisy. The researchers found that nearly 45% of raw pairs consisted of trivial system headers or boilerplate code. The CTF framework applies a three-stage filter to remove these "junk" functions, deduplicate identical functions within binaries (common in C++ templates), and perform cross-bin deduplication using MinHash-LSH.
Dataset Composition and Evaluation
The resulting Decompile-Bench contains 2 million "clean" binary-source pairs. For evaluation, the authors created Decompile-Bench-Eval, which includes manually translated C++ versions of standard Python benchmarks (HumanEval & MBPP) and a collection of repositories created after 2025 to prevent data leakage from the LLMs' original pre-training sets.
Key Results and Performance
The impact of high-quality, real-world data is evident in the performance of models fine-tuned on Decompile-Bench.
- Re-executability: The 1.3B parameter model (LLM4Decompile-DCBench) achieved a 20.89% re-executability rate on HumanEval, a significant jump over the 16.22% achieved by the previous state-of-the-art baseline.
- Readability: On the GitHub2025 test set, the model achieved a Readability-to-Information (R2I) score of 65.73, nearly doubling the performance of industry-standard tools like IDA Pro (~38.35).
- The Power of Clean Data: Ablation studies revealed that training on the unfiltered 100M raw pairs actually degraded performance. The model became biased toward trivial header functions, highlighting the necessity of the CTF filtering stage.
Conclusion
Decompile-Bench represents a significant step forward in reverse engineering. By providing a massive, high-fidelity dataset, it allows smaller open-source models to compete with massive closed-source models like Claude-3.5 Sonnet. Future work will focus on project-level decompilation and expanding the dataset to include more diverse obfuscation techniques.
Summary updated