arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.17016cs.SE
收藏

HELO-APR:通过跨语言知识迁移增强低资源程序修复

HELO-APR: Enhancing Low-Resource Program Repair through Cross-Lingual Knowledge Transfer

Nanjing University(南京大学);Yanshan University(燕山大学);Jiangsu University(江苏大学);Guangdong University of Technology(广东工业大学)

Zhipeng Wang, Boyang Yang, Yidong Wan, Liuye Guo, You Lv, Tao Zheng, Zhuowei Wang, Tieke He

AI总结:

提出HELO-APR框架,通过从高资源语言合成低资源语言修复数据并采用课程学习策略,显著提升低资源语言的自动程序修复效果。

摘要:

大型语言模型(LLM)在高资源编程语言(HRPL)的自动程序修复(APR)上表现良好,但由于缺乏足够的经过验证的缺陷-修复对用于APR训练,它们在低资源编程语言(LRPL)上的有效性急剧下降。为解决这一挑战,我们提出了HELO-APR(高资源赋能低资源APR),这是一个两阶段APR框架,能够将修复知识从HRPL跨语言迁移到LRPL。HELO-APR (1) 通过从HRPL对应代码合成LRPL缺陷-修复对来构建高质量的LRPL训练数据,在保持缺陷类型一致性的同时确保合成代码符合惯用法,然后 (2) 采用课程学习策略,逐步进行HRPL修复学习、跨语言修复对齐和LRPL修复适应,从而提高LRPL中的修复效果。以C++作为源HRPL,Ruby和Rust作为目标LRPL,在xCodeEval上的实验表明,HELO-APR始终优于强基线,在DeepSeek-Coder-6.7B上将Pass@1从31.17%提升至48.65%,在CodeLlama-7B上从1.67%提升至11.97%,同时通过将CodeLlama上的平均目标编译率从49.77%提高到91.98%来改善语法有效性。在Defects4Ruby上,HELO-APR在CodeLlama-7B上将BLEU-4从61.20提高到66.79,ROUGE-1从76.76提高到83.59,表明在真实场景中与开发者补丁的相似度更高。最后,我们进行了消融研究以评估每个核心组件的必要性。这些结果表明,经过验证的跨语言监督为提高低资源语言中基于LLM的修复提供了一种可复用的方法。

英文摘要:

Large Language Models (LLMs) perform well on automatic program repair (APR) for high-resource programming languages (HRPLs), but their effectiveness drops sharply in low-resource programming languages (LRPLs), due to a lack of sufficient verified buggy-fixed pairs for APR training. To address this challenge, we propose HELO-APR (High-resource Enabled LOw-resource APR), a two-stage APR framework that enables cross-lingual transfer of repair knowledge from HRPLs to LRPLs. HELO-APR (1) constructs high-quality LRPL training data by synthesizing LRPL buggy-fixed pairs from HRPL counterparts, preserving defect type consistency while ensuring the synthesized code is idiomatic, and then (2) adopts a curriculum learning strategy that progressively performs HRPL repair learning, cross-lingual repair alignment, and LRPL repair adaptation, improving repair effectiveness in LRPLs. Using C++ as the source HRPL and Ruby and Rust as the target LRPLs, experiments on xCodeEval show that HELO-APR consistently outperforms strong baselines, increasing Pass@1 from 31.17% to 48.65% on DeepSeek-Coder-6.7B and from 1.67% to 11.97% on CodeLlama-7B, while improving syntactic validity by raising the average target compilation rate on CodeLlama from 49.77% to 91.98%. On Defects4Ruby, HELO-APR increases BLEU-4 from 61.20 to 66.79 and ROUGE-1 from 76.76 to 83.59 on CodeLlama-7B, indicating higher similarity to developer patches in real-world settings. Finally, we conduct ablation studies to assess the necessity of each core component. These results suggest that verified cross-lingual supervision provides a reusable approach for improving LLM-based repair in low-resource languages.

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

↑