NeurIPS 2026QuestionsPapersAreasAboutMarkdown

ASAP: Assembly-Source Aligned Pseudocode Refinement For Binary Decompilation

Yujian Zhuang, Dehong Gao, Qichao Zhang, QiJing Lai, Jiaxin Wang, Libin Yang, Xiaoyan Cai

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: LLM Agents, Evals & Benchmarks › LLM Evaluation Benchmarks · Type: new method · Keywords: binary decompilation, pseudocode refinement, assembly-source alignment, contrastive learning, LLM refinement

Areas: Code & Coding Agents › Code Verification › Code benchmarks

Summary

ASAP is a pseudocode refinement framework that aligns assembly with source code to improve binary decompilation accuracy.

Explained to a 5-year-old

When we look at a computer program that is hidden, we want to know what it does. The program is written in a secret language that computers understand, but we also have a rough story about what it does. The new idea helps the computer remember both the secret language and the story together. It uses a special way to hide parts of the story and compare the two languages. This helps the computer guess the right story more often.

Explained to a 5-year-old, longer

When we look at a computer program that is hidden, we want to know what it does. The program is written in a secret language that computers understand, but we also have a rough story about what it does. This rough story is called pseudocode and can sometimes be wrong. The new idea helps the computer fix those mistakes by also looking at the secret language. It learns how the secret language matches the rough story by comparing many examples. A special tool called a Q-Former turns the secret language into a few important words. These words are used together with the rough story to help the computer understand better. During learning, the computer sometimes hides parts of the story to focus on the secret language. It also uses a special rule that tells it when the secret language is more helpful than the story. This prevents the computer from ignoring the secret language and only trusting the story. After training, the computer can produce a more accurate story that matches the original program. This makes it easier to understand what the program does, which is useful for fixing bugs and analyzing security.

For a technical reader

ASAP refines pseudocode produced by decompilers by incorporating assembly information. It learns aligned representations using contrastive learning at both function and snippet levels. A Q-Former compresses assembly features into tokens that condition the LLM alongside the original pseudocode. During refinement, stochastic masking and a relative assembly-advantage loss keep the model from ignoring assembly cues. The result is higher re-execution and recompilation rates on multiple benchmarks.

Problem

Binary decompilation often yields pseudocode that is a lossy abstraction and contains errors, especially for heavily optimized binaries where low-level details are obscured. This makes it difficult to obtain a faithful copy of the original source code from binaries.

Method

The approach learns source-aligned assembly representations from paired source and binary functions using joint function-level and snippet-level contrastive alignment. It then compresses assembly features with a Q-Former into tokens that condition the decompilation LLM together with the existing pseudocode. During refinement, stochastic pseudocode masking and a relative assembly-advantage loss are used to prevent the model from ignoring assembly information.

Results

The approach raises the average re-execution rate from 64.7% to 71.9% and the average recompilation rate from 91.6% to 96.6% on the benchmarks, outperforming the strongest baseline.

Contributions

It introduces a framework that aligns assembly with source code via contrastive learning, uses a Q-Former to integrate assembly tokens, and employs novel masking and loss strategies to balance pseudocode and assembly cues. This yields significant improvements in decompilation fidelity across optimization levels.

Practical relevance

It provides a practical solution that enhances binary decompilation reliability for security analysis and reverse engineering tasks.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction