Large language models (LLMs) have recently shown strong potential for automated program repair (APR), particularly through iterative refinement that generates and improves candidate patches. However, state-of-the-art iterative refinement LLM-based APR approaches cannot fully address challenges, including maintaining useful diversity among repair hypotheses, identifying semantically related repair families, composing complementary partial fixes, exploiting structured failure information, and escaping structurally flawed search regions. In this paper, we propose a Population-Based Semantic Evolution framework for APR iterative refinement, called EvolRepair, that formulates LLM-based APR as a semantic evolutionary algorithm. EvolRepair reformulates the search paradigm of classic genetic algorithm for APR, but replaces its syntax-based operators with semantics-aware components powered by LLMs and structured execution feedback. Candidate repairs are organized into behaviorally coherent groups, enabling the algorithm to preserve diversity, reason over repair families, and synthesize stronger candidates by recombining complementary repair insights across the population. By leveraging structured failure patterns to guide search direction, EvolRepair can both refine promising repair strategies and shift toward alternative abstractions when necessary. Our experiments show that EvolRepair substantially improves repair effectiveness over existing LLM-based APR approaches.
翻译:大语言模型(LLMs)近期在自动化程序修复(APR)领域展现出巨大潜力,特别是通过迭代优化生成并改进候选补丁。然而,现有基于LLM的迭代优化APR方法仍无法完全解决以下挑战:维持修复假设间的有效多样性、识别语义相关的修复族、整合互补性局部修复、利用结构化失败信息,以及逃离结构缺陷搜索区域。本文提出一种面向APR迭代优化的种群语义进化框架EvolRepair,将基于LLM的APR形式化为语义进化算法。EvolRepair重构了经典遗传算法在APR中的搜索范式,用基于大语言模型与结构化执行反馈的语义感知组件替代其语法级算子。候选修复被组织为行为一致性群组,使算法能够保持多样性、对修复族进行推理,并通过跨种群重组互补性修复见解来合成更强候选。通过利用结构化失败模式引导搜索方向,EvolRepair既能优化有前景的修复策略,又能在必要时转向替代性抽象方案。实验表明,相较于现有基于LLM的APR方法,EvolRepair显著提升了修复有效性。