CoDe-R:通过理由引导与自适应推理利用大语言模型精化反编译输出 CoDe-R: Refining Decompiler Output with LLMs via Rationale Guidance and Adaptive Inference 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-04-14
👁️ 预览文献
💡 AI 中文简介
反编译是把编译后的二进制程序还原成高级源代码,但大语言模型常因编译中丢失语义而产生“逻辑幻觉”,生成的代码无法重新运行。本研究提出CoDe-R,一个轻量级两阶段代码精化框架:第一阶段用理由引导的语义注入训练模型恢复算法意图,第二阶段在推理时用动态双路径回退机制平衡语义与语法。在HumanEval-Decompile基准上,仅用1.3B参数骨干模型就达到轻量级最优,平均可重执行率首次突破50%,显著优于基线,缩小了高效模型与专家级性能的差距。
领域软件工程 / 二进制逆向与程序理解
适合谁读需要一定专业背景(了解反编译、大语言模型微调与推理)
核心贡献1. 提出理由引导的语义认知增强(SCE),让模型在生成代码的同时恢复高层算法意图,缓解逻辑幻觉;2. 设计动态双路径回退(DDPF)推理机制,通过混合验证自适应平衡语义恢复与语法稳定性。
关键数据在HumanEval-Decompile基准上,1.3B参数模型平均可重执行率首次超过50.00%,达到轻量级SOTA,显著优于基线。
推荐理由如果你关注用大模型做反编译或代码生成,这篇用1.3B小模型就刷新了轻量级SOTA,思路巧妙且代码开源,值得一读。
关键词["反编译", "大语言模型", "代码精化", "语义恢复", "可重执行率", "自适应推理"]

原文摘要

查看英文原文摘要

Binary decompilation is a critical reverse engineering task aimed at reconstructing high-level source code from stripped executables. Although Large Language Models (LLMs) have recently shown promise, they often suffer from "logical hallucinations" and "semantic misalignment" due to the irreversible semantic loss during compilation, resulting in generated code that fails to re-execute. In this study, we propose Cognitive Decompiler Refinement with Robustness (CoDe-R), a lightweight two-stage code refinement framework. The first stage introduces Semantic Cognitive Enhancement (SCE), a Rationale-Guided Semantic Injection strategy that trains the model to recover high-level algorithmic intent alongside code. The second stage introduces a Dynamic Dual-Path Fallback (DDPF) mechanism during inference, which adaptively balances semantic recovery and syntactic stability via a hybrid verification strategy. Evaluation on the HumanEval-Decompile benchmark demonstrates that CoDe-R (using a 1.3B backbone) establishes a new State-of-the-Art (SOTA) in the lightweight regime. Notably, it is the first 1.3B model to exceed an Average Re-executability Rate of 50.00%, significantly outperforming the baseline and effectively bridging the gap between efficient models and expert-level performance. Our code is available at https://github.com/Theaoi/CoDe-R.