Decaf: Improving Neural Decompilation with Automatic Feedback and Search
Alexander Shypula, Osbert Bastani, Edward Schwartz · 2026
Read Decaf: Improving Neural Decompilation with Automatic Feedback and Search by Alexander Shypula, Osbert Bastani, Edward Schwartz (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-2605-11501.txt.
Introduction
Shypula, Bastani and Schwartz argue that compiler feedback plus search can greatly improve neural decompilation, not more data and training. Getting source code back from binaries is hard because syntax, identifiers and custom types are lost when code is compiled. Fixed decompilers struggle with idiomatic syntax and names, while generative models invent improper constructs and meanings. Their Decaf system uses automatic feedback to search for correct outputs. It raises the neural decompilation rate from 26 point 0 percent on ExeBench to 83 point 9 percent on Real-O2, without losing source similarity.
Catalog record
| CREATOR | Alexander Shypula, Osbert Bastani, Edward Schwartz |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 63441 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.11501
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Decaf: Improving Neural Decompilation with Automatic Feedback and Search Alexander Shypula, Osbert Bastani, Edward Schwartz Abstract Decompilers are useful tools used in reverse engineering to understand compiled source code. Reconstructing source code from compiled binaries is a challenging task, because high-level syntax, identifiers, and custom data types are generally lost as the compiler translates human-readable code to low-level machine code. Deterministic decompilers are useful tools for binary analysis, but can struggle to infer idiomatic syntax and identifier names. Generative AI models are a natural fit for reconstructing high-level syntax, identifiers, and types, but they can still suffer by hallucinating improper programming constructs and semantics. Instead of attempting to improve neural decompilers with more data and more training, we argue that compiler feedback can be used to dramatically improve the semantic correctness of neural decompiler outputs via search. Our system: Decaf ( DEC ompilation with A utomated F eedback) raises the neural decompilation rate from 26.0% on ExeBench to 83.9% on the Real -O2 split without sacrificing similarity to the original source code. We also find our automatic feedback methodology is highly effective for improving weaker neural decompilation models. Preprint. Under review. I Introduction Decompilation is the process of taking low-level assembly code from an executable and translating it back into a form that resembles the original high-level source code. Reverse engineers employ decompilers to assist with several security tasks, including analyzing malware, discovering, understanding and exploiting vulnerabilities, and fixing legacy software. Understanding compiled executables in general is a challenging task, because many of the design elements that make source-code understandable, such as variable, types, and identifier names, are “lost” as the program is lowered from an abstract source-code representation to an execution-focused assembly code representation. Fortunately, decompiler research, which has been studied for over 30 years, has shown that many of these abstractions can be at least partially recovered by traditional decompilers which employ sophisticated program analysis to recover information about the original program’s variables, types, and functions. Traditional decompilers include both academic efforts [ 1 , 2 , 3 ] and industrial decompilers such as Ghidra and Hex-Rays, which are typically employed by reverse engineers. Although these abstractions make decompiled code more understandable than assembly code, traditional decompilers output code that is non-idiomatic and significantly more difficult to understand than the original source code. To demonstrate these limitations and motivate our solution, we present a simple C function in Figure 1(a) as our working example, and its decompilation using the traditional decompiler Ghidra in Figure 1(c) . It is easy to see that Ghidra did not recover function names, type names, variable names, or comments. To address these limitations, researchers have been studying how to apply neural learning techniques to guess or predict many forms of missing information, such as proposing identifier names [ 4 , 5 , 6 , 7 ] and recovering meaningful types [ 5 , 8 , 9 , 10 ] . More recently, researchers have begun to train neural models to decompile entire functions, either starting from assembly code [ 11 , 12 ] , or learning how to transform the output of a traditional decompiler into the original source code [ 13 , 14 ] . (a) Original Source Code ⬇ void createDimensions ( int * arr , int size ){ int x = 1, y ; while (1){ if ( x == size ){ y = 1; break ; } y = size / x ; if ( x >= y ){ if ( x * y == size ) break ; } x ++; } arr [0] = x ; arr [1] = y ; } (b) LLM4Decompile Decompiled (Incorrect) ⬇ void SplitBij ( int * r , int n ) { int i , j ; for ( i = 1; i != n ; i ++) { j = n / i ; if ( i >= j ) break ; } r [0] = i ; r [1] = n / i ; } (c) Ghidra Decompiled (Correct) ⬇ void FUN_00101140 ( int * param_1 , int param_2 ) { int iVar1 , iVar2 = 1; if ( param_2 != 1) { do { iVar1 = param_2 / iVar2 ; if (( iVar1 <= iVar2 ) && ( iVar1 * iVar2 == param_2 )) goto LAB_0010116e ; iVar2 = iVar2 + 1; } while ( param_2 != iVar2 ); } iVar1 = 1; LAB_0010116e : * param_1 = iVar2 ; param_1 [1] = iVar1 ; return ; } (d) Decaf Decompiled (Correct) ⬇ struct image_t { int cols ; int rows ; }; static void get_shape ( image_t * self , int area ) { if ( area == 1) { self -> cols = 1; self -> rows = 1; return ; } int cols , rows = 1; cols = area / rows ; while (!( cols <= rows && rows * cols == area )) { rows ++; cols = area / rows ; } self -> cols = rows ; self -> rows = cols ; } (e) Decaf Decompiled (Incorrect) ⬇ struct Image { int width ; int height ; }; void get_image_size ( Image * image , int number_of_pixels ) { int i ; for ( i = 1; i < number_of_pixels ; ++ i ) { if ( i * i > number_of_pixels ) { break ; } } image -> width = i ; image -> height = number_of_pixels / i ; } Fig. 1 : Working example. Code is slightly reformatted for space. ( 1(a) ) The original source code returns a factorization of . The highlighted line shows the critical break condition logic that is missing from some decompilations. ( 1(b) ) LLM4Decompile is easy to understand but omits the critical break condition. ( 1(c) ) Ghidra is functionally correct but non-idiomatic. ( 1(d) ) Decaf’s first choice is easy to understand and functionally correct. ( 1(e) ) Lower ranked Decaf candidates are close but functionally incorrect, similar to LLM4Decompile. Reference Binary Disassembly .text+0x1a9e0 \cdot stripped ⬇ |\ A {1 e4e0 :}| endbr64 |\ A {1 e4e4 :}| mov $0x1 ,% ecx |\ A {1 e4e9 :}| cmp $0x1 ,% esi |\ A {1 e4ec :}| je |\ A {1 e509 }| |\ A {1 e4ee :}| xchg % ax ,% ax |\ A {1 e4f0 :}| mov % esi ,% eax |\ A {1 e4f2 :}| cltd |\ A {1 e4f3 :}| idiv % ecx |\ A {1 e4f5 :}| cmp % ecx ,% eax |\ A {1 e4f7 :}| jg |\ A {1 e502 }| |\ A {1 e4f9 :}| mov % eax ,% edx |\ A {1 e4fb :}| imul % ecx ,% edx |\ A {1 e4fe :}| cmp % esi ,% edx |\ A {1 e500 :}| je |\ A {1 e50e }| |\ A {1 e502 :}| add $0x1 ,% ecx |\ A {1 e505 :}| cmp % ecx ,% esi |\ A {1 e507 :}| jne |\ A {1 e4f0 }| |\ A {1 e509 :}| mov $0x1 ,% eax |\ A {1 e50e :}| mov % ecx ,(% rdi ) |\ A {1 e510 :}| mov % eax ,0 x4