paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Multilingual Code Co-evolution using Large Language Models

使用大语言模型的多语言代码协同演化
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 2/10 · 该论文关注用LLM在不同编程语言之间翻译代码变更,属于代码生成/软件演化方向,与用户核心关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析及Agentic程序分析均无直接关系。虽然同属LLM与程序语言交叉,但并非将LLM用于改进静态分析或验证。引用 43 inbox
Jiyang Zhang, Pengyu Nie, Junyi Jessy Li, Milos Gligoric
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 Codeditor,用大语言模型将代码变更从一种编程语言翻译到另一种,实现多语言代码协同演化。

许多软件项目在多种编程语言中实现相同 API 与算法,维护时需将每次修改及时且正确地传播到其他语言实现。传统的基于规则的转译器或机器学习翻译模型通常假设整体代码翻译,不符合开发者只修改局部代码的工作方式。本文提出新任务:用大语言模型将一个语言的代码变更翻译到另一个语言,并实现首个模型 Codeditor。Codeditor 将代码变更显式建模为编辑序列,并学习跨语言变更之间的对应关系。作者构建了来自 8 对 Java/C# 开源项目的 6,613 个对齐代码变更作为评测集。结果表明 Codeditor 在所有常用自动指标上大幅优于现有方法,且与基于生成的模型互补,二者结合可进一步提升性能。

问题
多语言项目维护中,需将代码变更从一个语言正确、及时地传播到其他语言实现;现有整体代码翻译工具或模型不适合按变更翻译的场景。
方法
提出 Codeditor,将代码变更建模为编辑序列,并利用大语言模型学习跨编程语言的变更对应关系来翻译变更。
评估
在从 8 对 Java/C# 开源项目收集的 6,613 个对齐代码变更上评测,自动指标大幅超越 SOTA,并与生成式模型互补、组合后性能更高。
原文摘要(Abstract)

Many software projects implement APIs and algorithms in multiple programming languages. Maintaining such projects is tiresome, as developers have to ensure that any change (e.g., a bug fix or a new feature) is being propagated, timely and without errors, to implementations in other programming languages. In the world of ever-changing software, using rule-based translation tools (i.e., transpilers) or machine learning models for translating code from one language to another provides limited value. Translating each time the entire codebase from one language to another is not the way developers work. In this paper, we target a novel task: translating code changes from one programming language to another using large language models (LLMs). We design and implement the first LLM, dubbed Codeditor, to tackle this task. Codeditor explicitly models code changes as edit sequences and learns to correlate changes across programming languages. To evaluate Codeditor, we collect a corpus of 6,613 aligned code changes from 8 pairs of open-source software projects implementing similar functionalities in two programming languages (Java and C#). Results show that Codeditor outperforms the state-of-the-art approaches by a large margin on all commonly used automatic metrics. Our work also reveals that Codeditor is complementary to the existing generation-based models, and their combination ensures even greater performance.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{00030L023,
  title = {Multilingual Code Co-evolution using Large Language Models},
  author = {Jiyang Zhang and Pengyu Nie and Junyi Jessy Li and Milos Gligoric},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616350}
}