LLMs as Idiomatic Decompilers: Recovering High-Level Code from x86-64 Assembly for Dart

Raafat Abualazm 1 and Ayman Abo Elhassan 1 · 2026

Read LLMs as Idiomatic Decompilers: Recovering High-Level Code from x86-64 Assembly for Dart by Raafat Abualazm 1 and Ayman Abo Elhassan 1 (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-02278.txt.

Introduction

Abualazm and Abo Elhassan test small language models as decompilers that turn x86 assembly into idiomatic Dart. Training data augmentation with synthetic same language examples is compared against adding human written Swift examples. A 4B specialized model scores about 71 on CODEBLEU, nearly matching a model about 120 times larger at about 73. On natural Dart functions it compiles about 79 percent of cases at five tries, well above its base model. Swift data helps at 8B but not at 4B.

Catalog record

CREATORRaafat Abualazm 1 and Ayman Abo Elhassan 1
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE25112
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2604.02278

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

LLMs as Idiomatic Decompilers: Recovering High-Level Code from x86-64 Assembly for Dart Raafat Abualazm 1 and Ayman Abo Elhassan 1 Abstract Translating machine code into human-readable high-level languages is an open research problem in reverse engineering. Despite recent advancements in LLM-based decompilation to C, modern languages like Dart and Swift are unexplored. In this paper, we study the use of small specialized LLMs as an idiomatic decompiler for such languages. Additionally, we investigate the augmentation of training data using synthetic same-language examples, and compare it against adding human-written examples using related-language (Swift → \rightarrow Dart). We apply CodeBLEU to evaluate the decompiled code readability and compile@k to measure the syntax correctness. Our experimental results show that on a 73-function Dart test dataset (representing diverse complexity levels), our 4B specialized model achieves 71.3 CodeBLEU (95% CI 65.5–77.1), approximately comparable to a ∼ \sim 480B code model (73.1; 67.4–78.8). On a subset of 34 natural Dart functions , it reaches compile@k 5 = 79.4 % {}_{5}=79.4\% (Wilson 95% CI 63.2–89.7), vs. 64.7% (47.9–78.5) for the base model; the difference is suggestive but not statistically significant at 0.05. Our results indicate that adding Swift training data helps at 8B but not at 4B, suggesting a capacity threshold for effective cross-lingual transfer. Our experimental results show that small specialized models can generate readable, idiomatic Dart with meaningful identifiers while using minimal compute. © 2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works. I Introduction Traditional decompilers like Hex-Rays IDA Pro and Ghidra produce functionally correct but hard-to-read code, with generic variable names (e.g., v1 , v2 ) and a lack of semantic information [ 1 ] . Recent machine learning methods have shown promising results in recovering more idiomatic code, primarily targeting C. Early efforts used RNNs [ 2 ] , followed by Transformer-based models: SLaDe (200M parameters) [ 3 ] , Nova (1B) [ 4 ] , and LLM4Decompile (up to 33B) [ 5 ] , achieving better improvements in improving decompiled code readability and re-executability. Dart and Swift represent significant portions of modern software development, particularly in mobile and web applications. According to GitHub’s language statistics, these languages power millions of applications and are growing rapidly in adoption. Their object-oriented paradigms, null-safety features, and extensive abstraction layers make them particularly challenging targets for decompilation, yet increasingly important for reverse engineering efforts. Hosseini and Dolan-Gavitt showed that it is possible to decompile code into multiple languages (Go, Fortran, OCaml) without using language-specific tools [ 6 ] . However, contemporary languages such as Dart and Swift remain unexamined due to their object-oriented paradigms and extensive abstractions. Recent work has focused on making decompiler output easier to read. DeGPT [ 7 ] applies LLM refinement over classical decompiler output to reduce cognitive load, while Idioms [ 8 ] couples code and type prediction to improve exact-match on GNU coreutils. As well as the LLM4Decompile-Ref model that enhances upon Ghidra output These approaches primarily focus on C and demonstrate the limitations of existing methods when applied to modern languages with richer type systems and idioms. We investigate small capacity-constrained LLMs, fine-tuned on targeted data, ability to produce idiomatic Dart/Swift from x86-64 assembly. Our central research question under limited target-language data is: Is it better to add more synthetic target-language pairs, or to add training data from a closely related language (Swift) with similar idioms and domain? To address this, we compare a Dart-only dataset (natural + synthetic) against a Dart+Swift dataset, applying a comprehensive evaluation protocol using CodeBLEU for code readability and compile@k for syntax validation. Contributions. • First end-to-end neural decompilation study from x86-64 assembly to Dart/Swift with idiom-aware evaluation. • A direct comparison of synthetic augmentation vs. adding a close language under low-data constraints. • A comprehensive evaluation protocol: CodeBLEU + compile@k with uncertainty quantification on all metrics. • Practical training approach enabling 4B models to approach much larger code LLMs on Dart decompilation tasks. II Related Work II-A Neural Decompilation for C The progression from RNN-based decompilers [ 2 ] to Transformer-based systems has steadily improved both readability and re-executability of recovered C code. SLaDe [ 3 ] adapted BART for assembly \rightarrow C, emphasising robustness to compiler optimizations. Nova [ 4 ] leveraged StarCoder initialisation and code-pretrained priors, achieving significant improvements on standard benchmarks. LLM4Decompile [ 5 ] scales up to 33B parameters and popularises evaluation grounded in execution success, reaching over 60% re-executability on certain C benchmarks. These C-focused studies share common limitations: they primarily evaluate on simple algorithmic functions, struggle with optimized code, and produce outputs that lack domain-specific idioms. Our work addresses these gaps by targeting modern languages with richer abstractions and evaluating on more diverse, real-world functions. II-B Language-Agnostic and Cross-Language Decompilation Beyond C, Hosseini and Dolan-Gavitt [ 6 ] explore retargetable decompilation (e.g., Go, Fortran, OCaml) by treating source and assembly as plain text, suggesting that multilingual decompilers are feasible without bespoke language front-ends. However, their evaluation was limited to simple programs and didn’t address the challenge of language-specific idioms. Our design probes the data axis of that question: when the target language does not have large dataset pool (low-resource) (Dart), does mixing in a closely related high-level language (Swift) help a small model, or does it dilute the LLM’s target signal? Complementary studies on multilingual code modelling and cross-lingual transfer show that transferability depends on both source/target pairs and model scale [ 13 , 14 ] . II-C Evaluation Metrics in Decompilation Previous decompilation works [ 3 , 4 , 5 ] primarily relied on execution-based metrics like pass@k or simple token overlap measures. However, BLEU-like metrics miss structure; CodeBLEU [ 12 ] augments n-gram matches with Abstract Syntax Tree (AST) and data-flow components to better capture semantic similarity in code. Still, compilation and execution are different notions of success. Hence, compile@k results provide a measurable reference to indicate the output code’s syntax validation. We therefore report CodeBLEU under a fixed decoding policy and separate executability via compile@k , reserving semantic pass@k for future work when comprehensive unit tests become available. III Dataset Construction We developed two main training datasets that include both natural and synthetic examples. The natural examples consist of 246 Dart functions compiled from RosettaCode projects, representing diverse algorithmic patterns. For synthetic augmentation, we employed multiple LLMs (GPT, Claude, DeepSeek and Qwen families) to generate diverse coding styles across different complexity levels, with all outputs validated for syntactic correctness through compilation. The synthesized data underwent rigorous quality control to ensure code correctness. Assembly Generation and Compilation: We used different compilation approaches for each language to balance training effectiveness with code preservation: • Dart : Compiled using dart compile aot-snapshot , which applies Dart’s standard ahead-of-time (AOT) optimization including type propagation, inlining, and other production-level optimizations. We disabled tree shaking using @pragma(’vm:entry-point’) annotations to preserve function boundaries. • Swift : Compiled with optimization level -O0 to preserve program structure and prevent aggressive optimizations that might

Read the complete text