Binary Decompilation LLM with Feedback-Driven Multi-Turn Refinement
This paper introduces AutoDecompiler, a reinforcement learning-based LLM that improves the functional correctness of binary decompilation by transforming the task from a single-turn generation into an iterative, feedback-driven refinement process guided by compilation, execution, and semantic consistency rewards.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a locked, ancient machine (a computer program in binary code). You can't see the gears inside, only the raw electrical signals. Your goal is to write a manual (source code) that explains exactly how that machine works, so other humans can understand, fix, or improve it. This process is called decompilation.
For a long time, trying to write this manual was like asking a student to take a single, perfect guess. They would look at the machine, write a manual, and stop. If the manual looked good on the surface but had a hidden math error, the student would get a passing grade, even though the machine would actually break if you tried to use it.
AutoDecompiler is a new AI system that changes the rules of the game. Instead of making one guess and stopping, it treats decompilation like a game of "Hot and Cold" with a helpful coach.
Here is how it works, broken down into simple concepts:
1. The "Try, Fail, Fix" Loop (Multi-Turn Refinement)
Imagine you are trying to fix a broken watch.
- The Old Way: You look at the watch, guess how to fix it, write down the instructions, and hand them to the boss. If the watch still doesn't tick, you don't get to try again.
- The AutoDecompiler Way: You write the instructions. The boss tries to build the watch.
- If the watch doesn't fit together (a compilation error), the boss hands you the broken parts and says, "You tried to screw in a gear that doesn't exist." You fix it and try again.
- If the watch fits but runs backward (an execution error), the boss says, "It works, but it's doing the wrong thing." You fix the logic and try again.
- You keep doing this loop—Try, Get Feedback, Fix—until the watch runs perfectly.
2. The Coach's Scorecard (Reinforcement Learning)
How does the AI know how to fix the watch? It uses a special training method called Reinforcement Learning. Think of this as a video game where the AI gets points for good moves and loses points for bad ones.
The paper designed a very specific "scorecard" for the AI that doesn't just look at whether the code looks nice. It checks four things:
- Is it valid? (Does it look like real code, or is it gibberish?)
- Can it be built? (Does the compiler accept it?)
- Does it run? (Does the program actually start without crashing?)
- Does it do the right thing? (If you give it the number 3, does it give back the correct answer, or just a random number?)
The AI learns to maximize its score by paying attention to the specific errors the "coach" (the computer environment) gives it.
3. The "Progress Tracker" (Avoiding Backsliding)
A tricky part of fixing things is that sometimes, when you fix one problem, you accidentally break something else that was already working.
- The Problem: The AI might fix a math error but accidentally delete a line of code that was correct, making the watch worse than before.
- The Solution: AutoDecompiler has a "Progress Tracker." It looks at the history of fixes. If a new fix makes the watch better than the previous version, it gets a bonus. If a fix makes it worse, it gets penalized. This teaches the AI to only make changes that genuinely improve the result, step-by-step.
4. The Results: Smarter with Less Data
The researchers trained this AI on a relatively small amount of data (about 310,000 examples) compared to other massive AI models that use millions.
- The Analogy: It's like a master mechanic who learned by studying a specific, well-organized repair manual, rather than a student who just read every book in the library but didn't know how to use a wrench.
- The Outcome: When tested, AutoDecompiler was better at producing code that actually works (runs correctly) and compiles (can be built into a program) than previous AI models. It didn't just produce code that looked right; it produced code that acted right.
In Summary
AutoDecompiler is an AI that doesn't just "guess" the source code of a program. Instead, it acts like a persistent editor:
- It writes a draft.
- It tests the draft.
- It reads the error messages (the feedback).
- It rewrites the draft to fix those specific errors.
- It repeats this until the code is perfect.
By using this "feedback-driven" approach, it creates much more reliable and functional software manuals than previous methods that only tried to get it right in one single shot.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.