SLaDe: A Portable Small Language Model Decompiler for Optimized Assembly
Jordi Armengol-Estapé, Jackson Woodruff, Chris Cummins, Michael F. P. O'Boyle
TL;DR
SLaDe introduces a portable neural decompiler that combines a 200M‑parameter Transformer trained on real function‑level assembly–to–C data with a type inference engine to recover external types. It employs a novel 8k UnigramLM‑based tokenizer and dropout‑free training, enabling accurate decompilation across ISAs (x86 and ARM) and optimization levels (-O0 and -O3). In large‑scale evaluations on AnghaBench and ExeBench, SLaDe surpasses industrial decompilers (Ghidra) and a general LLM (ChatGPT) in both correctness (IO accuracy) and readability (edit similarity), with up to about 6× and 4× improvements respectively. The results demonstrate the viability of small, targeted neural models for practical, cross‑ISA decompilation and highlight the benefits of integrating neural translation with program analysis via type inference, opening paths for broader portability and robustness in decompilation tasks.
Abstract
Decompilation is a well-studied area with numerous high-quality tools available. These are frequently used for security tasks and to port legacy code. However, they regularly generate difficult-to-read programs and require a large amount of engineering effort to support new programming languages and ISAs. Recent interest in neural approaches has produced portable tools that generate readable code. However, to-date such techniques are usually restricted to synthetic programs without optimization, and no models have evaluated their portability. Furthermore, while the code generated may be more readable, it is usually incorrect. This paper presents SLaDe, a Small Language model Decompiler based on a sequence-to-sequence transformer trained over real-world code. We develop a novel tokenizer and exploit no-dropout training to produce high-quality code. We utilize type-inference to generate programs that are more readable and accurate than standard analytic and recent neural approaches. Unlike standard approaches, SLaDe can infer out-of-context types and unlike neural approaches, it generates correct code. We evaluate SLaDe on over 4,000 functions from ExeBench on two ISAs and at two optimizations levels. SLaDe is up to 6 times more accurate than Ghidra, a state-of-the-art, industrial-strength decompiler and up to 4 times more accurate than the large language model ChatGPT and generates significantly more readable code than both.
