ASAP: Assembly-Source Aligned Pseudocode Refinement For Binary Decompilation
cs.PL, cs.CR, cs.SE
Submitted: 2026-09-30
Updated: 2026-09-30
Code: https://github.com/huggingface/transformers
License: http://creativecommons.org/licenses/by/4.0/
The gist: Large language models (LLMs) are increasingly used in binary decompilation to refine the C-like pseudocode produced by traditional rule-based decompilers.
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.
Sources
- Program Synthesis with Large Language Models
- ReCopilot: Reverse Engineering Copilot in Binary Analysis
- Evaluating Large Language Models Trained on Code
- A Systematic Literature Review on Neural Code Translation
- PCodeTrans: Translate Decompiled Pseudocode to Compilable and Executable Equivalent
- QiMeng-MuPa: Mutual-Supervised Learning for Sequential-to-Parallel Code Translation
- The CodeInverter Suite: Structure- and Data-Aware Binary Decompilation with Efficient LLMs
- Decoupled Weight Decay Regularization
- Representation Learning with Contrastive Predictive Coding
- Code Llama: Open Foundation Models for Code
- Empirical Studies on Adversarial Reverse Engineering with Students
- SK2Decompile: LLM-based Two-Phase Binary Decompilation from Skeleton to Skin
- Context-Guided Decompilation: A Step Towards Re-executability
- SALT4Decompile: Inferring Source-level Abstract Logic Tree for LLM-Based Binary Decompilation
- Qwen3 Technical Report
- A Survey of Large Language Models
- FidelityGPT: Correcting Decompilation Distortions with Retrieval Augmented Generation
- DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence
- Beyond C/C++: Probabilistic and LLM Methods for Next-Generation Software Reverse Engineering
Related papers
- Language-Based Agent Control
- ANEForge: Python for direct computation on the Apple Neural Engine
- Volition Elicitation: Operational Semantics for People and Their Machines
- Griotte: Verified Compartmentalisation via Capabilities
- GraphMend: Code Transformations for Fixing Graph Breaks in PyTorch 2
- Two Birds One Stone: Effective Static Detection of Resource and Communication Deadlocks in Rust Programs