arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.15334cs.LGcs.AIcs.CLcs.SE
收藏

从输入输出到代码:发现代理

Agentic Reverse Engineering: From I/O to Code with Discovery Agent

School of Computer Science, Peking University(北京大学计算机科学系);Tongyi Lab, Alibaba Group(阿里集团通义实验室);Wuhan University(武汉大学);Renmin University of China(中国人民大学);National University of Singapore(新加坡国立大学);Shanghai Jiaotong University(上海交通大学)

Yihong Dong, Jiaru Qian, Haoran Zhang, Peixu Wang, Binhua Li, Zhi Jin, Yongbin Li, Ge Li, Xiaokang Yang, Xue Jiang

AI总结:

本文提出DIO-Agent,通过将IO2Code视为离散程序空间的进化搜索,利用LLM作为突变算子,结合执行误差信号指导突变,解决从输入输出行为合成代码的难题。

摘要:

将程序自动合成视为计算机科学的圣杯。受LLM推动,NL2Code取得巨大成功,但从输入输出行为合成程序(IO2Code)仍难以解决。NL2Code可利用自然语言与代码的语义对齐,而IO2Code需从具体计算行为中恢复底层原理,面对广阔且未明确规定的假设空间。为此,我们提出DIO-Agent,将IO2Code视为离散程序空间的进化搜索,在其中LLM作为突变算子,执行误差信号指导突变。为防止搜索进入结构复杂但错误的死胡同,引入变换优先前提作为突变先验,使LLM偏向最简单的假设,逐步从常量到条件到迭代。为促进系统研究,我们构建了跨越多个难度级别的IO2CodeBench。大量实验表明,DIO-Agent在所有难度级别和各种LLM上均优于传统程序示例方法和SOTA进化代理基线,同时显著超越等效采样预算下的测试时间扩展策略。

英文摘要:

The automatic synthesis of a program from any form of specification is regarded as a holy grail of computer science. Fueled by LLMs, NL2Code has achieved tremendous success, yet the fundamentally more challenging task of synthesizing programs from input-output behavior, which we refer to as IO2Code, remains largely unsolved. Whereas NL2Code can exploit the semantic alignment between natural language and code acquired during pretraining, IO2Code requires recovering underlying principles from concrete computational behavior, navigating a vast and underspecified hypothesis space. To address this, we propose DIO-Agent, a discovery agent that performs agentic reverse engineering from input-output behavior to code. Our method frames IO2Code as an evolutionary search over discrete program space, in which an LLM serves as the mutation operator and concrete error signals from execution guide each mutation. To prevent the search from wandering into structurally complex yet incorrect dead ends, we introduce the Transformation Priority Premise as a mutation prior that biases the LLM toward the simplest hypothesis consistent with current evidence, progressively escalating from constants to conditionals to iteration only when simpler constructs are insufficient. To facilitate systematic study, we further construct an IO2CodeBench spanning multiple difficulty levels. Extensive experiments show that DIO-Agent consistently outperforms both traditional program-by-example method and SOTA evolution-agent baselines across all difficulty levels and various LLMs, while substantially surpassing test-time scaling strategies with equivalent sampling budgets.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑