paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code Data

半监督代码翻译:克服平行代码数据稀缺
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 3/10 · 论文属于代码翻译与LLM交叉,虽使用静态分析和编译辅助合成数据,但研究对象是神经代码翻译的数据稀缺问题,而非ML/Agentic程序静态分析、LLM改进静态分析/形式化验证,也未涉及浮点或贝叶斯程序分析。引用 18 inbox
Ming Zhu, Mohimenul Karim, Ismini Lourentzou, Daphne Yao
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出半监督方法 MIRACLE,通过合成高质量平行代码数据与课程学习,缓解代码翻译数据稀缺并提升多语言翻译性能。

神经代码翻译需将源代码从一种语言转成另一种,但平行代码数据稀缺,模型难以学习准确跨语言对齐。论文提出半监督方法 MIRACLE:利用静态分析与编译合成高质量、对齐度更高的平行代码数据,并按对齐程度递增进行课程学习。作者发现,开源代码预训练的 LLM 无论规模大小都存在“浅层翻译”问题,即复制源语言关键字、语句甚至代码块,导致编译或运行错误。在 C++、Java、Python 和 C 上对多个模型的实验表明,MIRACLE 显著缓解该问题,可超越参数量十倍于它的代码 LLM,并在少于 150 个标注样例时使 C 代码翻译提升最多 43%。

问题
神经代码翻译受限于平行代码数据稀缺,且现有代码 LLM 易出现复制源语言片段的“浅层翻译”,导致编译与运行时错误。
方法
MIRACLE 利用静态分析与编译合成高质量、高对齐的平行代码数据,并采用按对齐级别递增的课程学习来改进翻译模型。
评估
在 C++、Java、Python、C 多种语言上,与指令微调代码 LLM 等强基线对比;方法显著缓解浅层翻译,并在少标注样本下超越十倍参数量模型。
原文摘要(Abstract)

Neural code translation is the task of converting source code from one programming language to another. One of the main challenges is the scarcity of parallel code data, which hinders the ability of translation models to learn accurate cross-language alignments. In this paper, we introduce MIRACLE, a semi-supervised approach that improves code translation through synthesizing high-quality parallel code data and curriculum learning on code data with ascending alignment levels. MIRACLE leverages static analysis and compilation to generate synthetic parallel code datasets with enhanced quality and alignment to address the challenge of data scarcity. We evaluate the proposed method along with strong baselines including instruction-tuned Large Language Models (LLMs) for code. Our analysis reveals that LLMs pre-trained on open-source code data, regardless of their size, suffer from the "shallow translation" problem. This issue arises when translated code copies keywords, statements, and even code blocks from the source language, leading to compilation and runtime errors. Extensive experiments demonstrate that our method significantly mitigates this issue, enhancing code translation performance across multiple models in C++, Java, Python, and C. Remarkably, MIRACLE outperforms code LLMs that are ten times larger in size. MIRACLE also achieves up to a 43% improvement in C code translation with fewer than 150 annotated examples.CCS CONCEPTS• Computing methodologies → Machine learning; • Software and its engineering;

链接与引用

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

BibTeX
@inproceedings{0015KLY24,
  title = {Semi-Supervised Code Translation Overcoming the Scarcity of Parallel Code Data},
  author = {Ming Zhu and Mohimenul Karim and Ismini Lourentzou and Daphne Yao},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695524}
}