Title: Refine, Don’t Rewrite: LearnFrom for Consistency-Aware LLM Decompilation
Primary area: foundation or frontier models, including LLMs
Keywords: Reverse Engineering, Patch Generation, Large Language Models

Abstract: Decompilation aims to translate binary executables into high-level source code; yet, the task remains demanding. Traditional tools, such as Ghidra, yield output that is structurally faithful but rarely recompilable or linkable.     Recent methods built upon large language models improve readability and executability. However, unconstrained LLMs exhibit inherent stochasticity, they provide little guarantees of semantic consistency with the originating binary, which forces extensive cross-checking against the disassembly.  We introduce the LearnFrom to address this challenge by leveraging traditional decompiler outputs and treating a code block corresponding to each control-flow graph node as a minimal editable unit to constrain modification scope. This patch generation design limits potential semantic deviations while reducing verification overhead. To achieve better model performance on the patch generation task in the context of decompilation, we further construct an open-source dataset of two million functions with explicit control-flow graph annotations, then use it to fine-tune the DeepSeek-Coder model series for specialized adaptation to the patch generation task. Within the LearnFrom framework, strict preservation of CFG structural consistency is enforced throughout the editing process, ensuring reliable control-flow alignment. Under this constraint, identical base models achieve a 5\% improvement in HumanEval re-execution rates over baseline systems, with further gains of 8\% when substituting DeepSeek-Coder V2 followed by re-fine-tuning. These results confirm that CFG-aligned constraints offer the structural reliability essential for large-scale reverse engineering, while still permitting further optimization as foundational models advance.