# ASAP: Assembly-Source Aligned Pseudocode Refinement For Binary Decompilation

DevFeed: [ASAP: Assembly-Source Aligned Pseudocode Refinement For Binary Decompilation](<https://devfeed.tech/articles/asap-assembly-source-aligned-pseudocode-refinement-for-binary-decompilation-131679.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.06900>)

Author: Yujian Zhuang, Dehong Gao, Qichao Zhang, Qijing Lai, Jiaxin Wang, Libin Yang, Xiaoyan Cai

Published: 2026-11-13T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>), [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [Reverse Engineering](<https://devfeed.tech/topics/reverse-engineering.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [code analysis](<https://devfeed.tech/topics/code-analysis.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [LLM evaluation / benchmarking](<https://devfeed.tech/topics/llm-evaluation-benchmarking.md>)

Tags: [alignment](<https://devfeed.tech/tags/alignment.md>), [assembly](<https://devfeed.tech/tags/assembly.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [binaries](<https://devfeed.tech/tags/binaries.md>), [c](<https://devfeed.tech/tags/c.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compiler-optimization](<https://devfeed.tech/tags/compiler-optimization.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [cs-pl](<https://devfeed.tech/tags/cs-pl.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [decompilation](<https://devfeed.tech/tags/decompilation.md>), [decompiler](<https://devfeed.tech/tags/decompiler.md>), [errors](<https://devfeed.tech/tags/errors.md>), [language-models](<https://devfeed.tech/tags/language-models.md>), [large-language-models-llms](<https://devfeed.tech/tags/large-language-models-llms.md>), [pseudocode](<https://devfeed.tech/tags/pseudocode.md>), [source](<https://devfeed.tech/tags/source.md>)

## AI overview

ASAP refines decompiler-produced pseudocode by conditioning a decompilation LLM on both that pseudocode and assembly features aligned with source code. It learns the alignment from paired source and binary functions, compresses assembly features into a fixed set of tokens, and uses stochastic pseudocode masking plus a relative assembly-advantage loss to reduce reliance on potentially lossy pseudocode alone. Across two benchmarks and multiple compiler optimization levels, it raises average re-execution rates from 64.7% to 71.9% and recompilation rates from 91.6% to 96.6% versus the strongest baseline.

## Source excerpt

arXiv:2610.06900v2 Announce Type: replace-cross 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. These tokens and the decompiler-produced pseudocode jointly condition the decompilation LLM. During refinement, we use stochastic pseudocode masking and a relative assembly-advantage loss to discourage the model from relying solely on pseudocode. 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. Our approach offers both a new perspective and a practical solution to binary decompilation.