超越翻译准确性:解决基于LLM的代码翻译中的虚假失败
Beyond Translation Accuracy: Addressing False Failures in LLM-Based Code Translation
AI总结:
本文指出LLM代码翻译中许多失败并非逻辑错误,而是评估框架导致的编译器标志、库链接缺失或运行时环境未配置等问题,通过大规模实验揭示了虚假负样本的分类及改进评估标准的必要性。
摘要:
大型语言模型(LLMs)在自动化代码翻译中取得了显著成就。尽管先前的工作重点在于通过高级提示和迭代修复来提高翻译准确性,但底层评估框架的可靠性却受到较少关注。本文证明,代码翻译中报告的许多失败并非由于逻辑错误,而是由不当的编译标志、缺失的库链接和未配置的运行时环境等评估引起的错误。我们对五种编程语言(C、C++、Java、Python、Go)和三个基准(Avatar、CodeNet、EvalPlus)进行了大规模实证研究,涵盖了由GPT-4o、DeepSeek-Coder和Magicoder生成的6,164个翻译。我们的分析识别并分类了常见的假阴性,区分了影响所有模型的流水线引起的失败与模型依赖的行为,这些行为在不同LLM之间有所不同。我们的发现强调了透明且配置感知的评估标准的必要性,以准确评估LLM在代码翻译中的进步。
英文摘要:
Large Language Models (LLMs) have achieved remarkable success in automated code translation. While prior work has focused on improving translation accuracy through advanced prompting and iterative repair, the reliability of the underlying evaluation frameworks has received less attention. In this paper, we demonstrate that a significant number of reported failures in code translation are not due to incorrect logic, but rather evaluation-induced errors stemming from improper compilation flags, missing library links, and unconfigured runtime environments. We conduct a large-scale empirical study across five programming languages (C, C++, Java, Python, Go) and three benchmarks (Avatar, CodeNet, EvalPlus), covering 6,164 translations generated by GPT-4o, DeepSeek-Coder, and Magicoder. Our analysis identifies and categorizes common false negatives, distinguishing pipeline-induced failures that affect any model from model-dependent behaviors that vary across LLMs. Our findings highlight the necessity for transparent, configuration-aware evaluation standards to accurately assess progress in LLM-based code translation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。