LLM4Decompile

LLM4Decompile is the first open-source family of LLMs specialized for decompiling machine code back into readable, re-executable C source.
Ask this paper
Model range: Open-weight decompilation LLMs from 1.3B to 33B parameters, released with both End-to-end variants (binary → C) and Ref variants that refine outputs produced by the Ghidra decompiler.
Training scale: Trained on 4B tokens of paired C source and assembly, giving the models ample coverage of realistic build-system and optimization patterns.
Decompile-Eval benchmark: The authors introduce a benchmark that measures not just textual similarity but re-compatibility and re-executability of the recovered C code - a more faithful proxy for usefulness.
Strong gains: LLM4Decompile-Ref variants outperform GPT-4o and raw Ghidra by over 100% in re-executability rate, with an additional 16.2% improvement from the refinement stage.
Abstract
Decompilation aims to convert binary code to high-level source code, but traditional tools like Ghidra often produce results that are difficult to read and execute. Motivated by the advancements in Large Language Models (LLMs), we propose LLM4Decompile, the first and largest open-source LLM series (1.3B to 33B) trained to decompile binary code. We optimize the LLM training process and introduce the LLM4Decompile-End models to decompile binary directly. The resulting models significantly outperform GPT-4o and Ghidra on the HumanEval and ExeBench benchmarks by over 100% in terms of re-executability rate. Additionally, we improve the standard refinement approach to fine-tune the LLM4Decompile-Ref models, enabling them to effectively refine the decompiled code from Ghidra and achieve a further 16.2% improvement over the LLM4Decompile-End. LLM4Decompile demonstrates the potential of LLMs to revolutionize binary code decompilation, delivering remarkable improvements in readability and executability while complementing conventional tools for optimal results. Our code, dataset, and models are released at https://github.com/albertan017/LLM4Decompile