paperbot · PL 论文追踪

全部论文 待读 收藏

P2 INTERTRANS: Leveraging Transitive Intermediate Translations to Enhance LLM-Based Code Translation

INTERTRANS:利用传递式中间翻译增强基于 LLM 的代码翻译
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 3/10 · 该论文属于 LLM 与程序语言交叉,但核心任务是代码翻译,而非用户关注的静态分析、形式化验证、浮点程序分析或贝叶斯程序分析。其目标是提升 LLM 自身的翻译能力,接近用户明确不感兴趣的“研究目标本身是 LLM”的范畴。引用 13 inbox
Marcos Macedo, Yuan Tian, Pengyu Nie, Filipe R. Cogo, Bram Adams
crossref: 2026-09-12

AI 速览

一句话:提出 INTERTRANS,用 ToCT 算法规划并验证传递式中间翻译序列,显著提升开源 LLM 的代码翻译准确率。

代码翻译对遗留系统现代化、跨平台兼容等任务至关重要,但语言间句法与语义差异使自动化十分困难,即便先进 LLM(尤其是开源模型)表现仍不佳。本文探究能否利用 LLM 的多语言能力来改进代码翻译,提出 INTERTRANS:与现有直接翻译不同,它借助中间翻译来弥合源语言与目标语言的差异。方法分两阶段,首先用新颖的代码翻译树(ToCT)算法规划源语言到目标语言的传递式中间翻译序列,再按特定顺序验证这些序列。作者在 CodeNet、HumanEval-X、TransCoder 三个基准、六种编程语言上用三个开源 LLM 进行评估,10 次尝试下计算准确率(CA)较直接翻译绝对提升 18.3%–43.3%,最佳变体(Magicoder)在三基准上平均 CA 达 87.3%–95.4%。

问题
在源语言与目标语言存在大量句法和语义差异的情况下,如何提升(尤其是开源)LLM 自动代码翻译的准确率。
方法
提出 INTERTRANS,两阶段式利用 LLM 的多语言能力:先用代码翻译树(ToCT)算法规划出源语言到目标语言之间的传递式中间翻译序列,再按特定顺序对这些序列进行验证,以中间语言桥接差异。
评估
在 CodeNet、HumanEval-X、TransCoder 三个基准、六种编程语言上,用三个开源 LLM 与直接翻译基线对比计算准确率(CA),并进行多次尝试的评估。
原文摘要(Abstract)

Code translation aims to convert a program from one programming language (PL) to another. This long-standing software engineering task is crucial for modernizing legacy systems, ensuring cross-platform compatibility, enhancing performance, and more. However, automating this process remains challenging due to many syntactic and semantic differences between PLs. Recent studies show that even advanced techniques such as large language models (LLMs), especially open-source LLMs, still struggle with the task. Currently, code LLMs are trained with source code from multiple programming languages, thus presenting multilingual capabilities. In this paper, we investigate whether such capabilities can be harnessed to enhance code translation. To achieve this goal, we introduce INTERTRANS, an LLM-based automated code translation approach that, in contrast to existing approaches, leverages intermediate translations to bridge the syntactic and semantic gaps between source and target PLs. INTERTRANS contains two stages. It first utilizes a novel Tree of Code Translation (ToCT) algorithm to plan transitive intermediate translation sequences between a given source and target PL, then validates them in a specific order. We evaluate INTERTRANS with three open LLMs on three benchmarks (i.e., CodeNet, HumanEval-X, and TransCoder) involving six PLs. Results show an absolute improvement of 18.3% to 43.3% in Computation Accuracy (CA) for INTERTRANS over Direct Translation with 10 attempts. The best-performing variant of INTERTRANS (with the Magicoder LLM) achieved an average CA of 87.3%-95.4% on three benchmarks.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8795,
  title = {INTERTRANS: Leveraging Transitive Intermediate Translations to Enhance LLM-Based Code Translation},
  author = {Marcos Macedo and Yuan Tian and Pengyu Nie and Filipe R. Cogo and Bram Adams},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00236}
}