Recent advances in leveraging LLMs for APR have demonstrated impressive capabilities in fixing software defects. However, current LLM-based approaches predominantly focus on mainstream programming languages like Java and Python, neglecting less prevalent but emerging languages such as Rust due to expensive training resources, limited datasets, and insufficient community support. This narrow focus creates a significant gap in repair capabilities across the programming language spectrum, where the full potential of LLMs for comprehensive multilingual program repair remains largely unexplored. To address this limitation, we introduce a novel cross-language program repair approach LANTERN that leverages LLMs' differential proficiency across languages through a multi-agent iterative repair paradigm. Our technique strategically translates defective code from languages where LLMs exhibit weaker repair capabilities to languages where they demonstrate stronger performance, without requiring additional training. A key innovation of our approach is an LLM-based decision-making system that dynamically selects optimal target languages based on bug characteristics and continuously incorporates feedback from previous repair attempts. We evaluate our method on xCodeEval, a comprehensive multilingual benchmark comprising 5,068 bugs across 11 programming languages. Results demonstrate significant enhancement in repair effectiveness, particularly for underrepresented languages, with Rust showing a 22.09% improvement in Pass@10 metrics. Our research provides the first empirical evidence that cross-language translation significantly expands the repair capabilities of LLMs and effectively bridges the performance gap between programming languages with different levels of popularity, opening new avenues for truly language-agnostic automated program repair.


翻译:近期利用大语言模型进行自动程序修复的研究在修复软件缺陷方面展现出卓越能力。然而,当前基于大语言模型的方法主要集中于Java和Python等主流编程语言,由于训练资源昂贵、数据集有限及社区支持不足,往往忽视Rust等使用率较低但正在兴起的语言。这种局限性在编程语言谱系中造成了显著的修复能力断层,使得大语言模型在多语言程序修复领域的完整潜力尚未得到充分探索。为突破此限制,我们提出一种创新的跨语言程序修复方法LANTERN,该方法通过多智能体迭代修复范式,巧妙利用大语言模型在不同语言间的差异化修复能力。我们的技术策略性地将缺陷代码从大语言模型修复能力较弱的语言,翻译至其表现更强的语言,且无需额外训练。本方法的核心创新在于基于大语言模型的决策系统,该系统能根据缺陷特征动态选择最优目标语言,并持续整合先前修复尝试的反馈信息。我们在涵盖11种编程语言、包含5,068个缺陷的多语言基准测试集xCodeEval上评估了该方法。实验结果表明修复效能得到显著提升,尤其在代表性不足的语言中表现突出,其中Rust语言的Pass@10指标提升了22.09%。本研究首次提供实证证据,表明跨语言翻译能显著扩展大语言模型的修复能力,有效弥合不同流行度编程语言间的性能差距,为真正实现语言无关的自动程序修复开辟了新路径。

0
下载
关闭预览

相关内容

Rust 是一种注重高效、安全、并行的系统程序语言。
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Meta-Transfer Learning for Zero-Shot Super-Resolution
Arxiv
43+阅读 · 2020年2月27日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
相关基金
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员