DynaFix:利用执行级动态信息迭代修复程序的LLM自动修复框架
DynaFix: Iterative Automated Program Repair Driven by Execution-Level Dynamic Information
DynaFix是一个基于LLM的自动程序修复框架,通过ByteTrace在每轮修复中采集变量状态、分支路径和调用栈,将运行时信号写入结构化提示并重新执行验证补丁,再把更新后的执行轨迹反馈到下一轮迭代。
arXiv:2512.24635v3 Announce Type: replace-cross Abstract: Automated Program Repair (APR) seeks to generate correct patches for buggy programs, but recent Large Language Model (LLM)-based repair systems remain sensitive to superficial code changes and often rely on coarse test outcomes during iterative repair. We propose DynaFix, an LLM-based APR framework that integrates execution-level dynamic information into a closed-loop repair workflow. The distinguishing feature of DynaFix lies not in using execution-level information per se, but in repeatedly updating and exploiting such information throughout the iterative repair process. In each repair round, DynaFix uses ByteTrace to collect variable states, branch paths, and call stacks, incorporates these runtime signals into structured prompts, validates generated patches through re-execution, and feeds the resulting updated traces into subsequent repair iterations. This process grounds patch generation in concrete execution behavior rather than static code alone. We evaluate DynaFix on Defects4J v2.0, the Real-World Benchmark, and a code perturbation benchmark, Defects4J-Trans. DynaFix repairs 236 single-function Defects4J bugs with GPT-4 and 186 with GPT-4o, including 23 bugs not fixed by existing baselines. On Defects4J-Trans, DynaFix achieves 15.6%-32.1% higher aggregate repair counts than ReinFix and shows higher repair retention under semantics-preserving transformations. It also reduces token consumption by 60%-70% compared with state-of-the-art LLM-based APR methods. These results show that repeatedly updating and exploiting execution-level information throughout iterative repair can substantially improve the effectiveness, robustness, and cost efficiency of LLM-based program repair.
来源:arXiv (AI + Vision + Imaging) · arxiv.org