ASAP: Assembly-Source Aligned Pseudocode Refinement For Binary Decompilation

📅 2026-09-29
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the challenges of missing information, inaccuracies, and optimization obfuscation in pseudocode generated during binary decompilation by proposing an assembly-to-source alignment framework. Methodologically, the approach constructs aligned representations through function-level and snippet-level contrastive learning, employs Q-Former to compress features and condition large language models, and refines pseudocode via random masking. Furthermore, it introduces a novel relative assembly advantage loss to prevent the model from neglecting low-level assembly features. Experimental evaluations demonstrate that this method substantially outperforms state-of-the-art baselines across multiple benchmarks, improving re-executability from 64.7% to 71.9% and recompilability from 91.6% to 96.6%.
📝 Abstract
Large language models (LLMs) are increasingly used in binary decompilation to refine the C-like pseudocode produced by traditional rule-based decompilers. While this pseudocode is useful, it is a heuristic and lossy abstraction rather than a faithful copy of the source code. It often contains decompiler errors, especially for aggressively optimized binaries where critical low-level details are obscured. We present ASAP, an assembly-source aligned pseudocode refinement framework for binary decompilation. ASAP learns source-aligned assembly representations from paired source and binary functions using joint function-level and snippet-level contrastive alignment. A Q-Former then compresses chunk-level assembly features into a fixed number of assembly tokens that condition the decompilation LLM alongside the decompiler-produced pseudocode. During refinement, we use stochastic pseudocode masking and a relative assembly-advantage loss to reduce the model's tendency to ignore assembly features and rely only on pseudocode refining. On two decompilation benchmarks across multiple compiler optimization levels, ASAP improves the average re-execution rate from 64.7% to 71.9% and the average recompilation rate from 91.6% to 96.6% compared with the strongest baseline, offering both a new perspective and a practical solution to binary decompilation.
Problem

Research questions and friction points this paper is trying to address.

Binary Decompilation
Pseudocode Refinement
Large Language Models
Compiler Optimization
Innovation

Methods, ideas, or system contributions that make the work stand out.

Binary Decompilation
Contrastive Alignment
Q-Former
Pseudocode Refinement
Large Language Models