paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Polyglot: An Extensible Framework to Benchmark Code Translation with LLMs

Polyglot:一个可扩展的、基于 LLM 的代码翻译基准测试框架
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 3/10 · 论文聚焦于用 LLM 进行代码翻译的基准测试框架,虽涉及静态代码度量,但核心并非静态分析/形式化验证、浮点程序分析或贝叶斯程序分析,与用户研究方向仅存在边缘交叉。引用 0 inbox
Marco Vieira, Priyam Ashish Shah, Bhavain Shah, Rrezarta Krasniqi
crossref: 2026-09-12

AI 速览

一句话:提出可扩展多语言框架 Polyglot,基于 IBM CodeNet 从语法、执行、语义与静态度量四维度评测 LLM 的代码翻译质量。

大语言模型在代码相关任务上展现出很大潜力,但其代码翻译能力的可靠性仍缺乏可靠的评估手段。本文提出 Polyglot——一个自动化、多语言、可扩展的框架,用于评测 LLM 在不同编程语言之间的翻译质量。框架以 IBM CodeNet 项目(涵盖多语言的大量编程题目)为数据基础,从语法正确性、执行可靠性、语义保持和静态代码度量四个方面衡量翻译质量。评测聚焦于把 C 代码翻译为 Java、Python 和 Rust,这三种目标语言分属不同范式,也是现代化改造 C 语言系统的常见替代方案。作者使用三种提示策略评测多个开源 LLM,以考察提示方式对翻译表现的影响。结果显示,LLM 在简单代码翻译上表现良好,但在复杂逻辑处理与跨语言范式迁移方面仍有明显局限,需要进一步分析。

问题
LLM 被广泛用于自动化代码翻译,但缺乏可靠、可扩展的多语言评测手段来判断其翻译质量。
方法
构建自动化多语言基准框架 Polyglot,基于 IBM CodeNet 的编程题目,从语法正确性、执行可靠性、语义保持与静态代码度量四个维度评估翻译,并采用三种提示策略。
评估
在 C 到 Java、Python、Rust 的翻译任务上评测若干开源 LLM;结果表明简单代码翻译效果较好,而复杂逻辑与跨范式翻译仍存在局限。
原文摘要(Abstract)

Large Language Models (LLMs) show great potential for automating code-related tasks. However, sound assessments are necessary to understand their true capabilities, particularly in code translation, where reliability is crucial. We introduce Polyglot, an automated, multi-language framework for evaluating the translation quality of LLMs between different programming languages. Leveraging the IBM CodeNet Project, an extensive collection of coding problems in multiple languages, we assess translation quality using syntactic correctness, execution reliability, semantic preservation, and static code metrics. Our evaluation focuses on translating C to Java, Python, and Rust, languages that follow distinct paradigms and represent alternatives to modernize C-based systems. We evaluate open-source LLMs using three prompting strategies to understand the impact on translation performance. Our findings highlight that while LLMs show promising results for simple code translation, their limitations regarding complex logic and distinct language paradigms require further analysis.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9556,
  title = {Polyglot: An Extensible Framework to Benchmark Code Translation with LLMs},
  author = {Marco Vieira and Priyam Ashish Shah and Bhavain Shah and Rrezarta Krasniqi},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00195}
}