arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.15424cs.SEcs.AI
收藏

LLM辅助将遗留FORTRAN代码翻译为C++:跨平台研究

LLM-Assisted Translation of Legacy FORTRAN Codes to C++: A Cross-Platform Study

Los Alamos National Laboratory(洛斯阿拉莫斯国家实验室);School of Information, University of Arizona(信息学院,亚利桑那大学)

Nishath Rajiv Ranasinghe, Shawn M. Jones, Michal Kucer, Ayan Biswas, Daniel O'Malley, Alexander Buschmann Most, Selma Liliane Wanna, Ajay Sreekumar

AI总结:

本研究评估LLM将遗留Fortran代码翻译为C++的适用性,在两种计算平台上统计量化编译准确性与代码相似性,为构建智能体工作流奠定基础。

摘要:

大型语言模型(LLMs)正越来越多地被领域专家和非领域专家用于生成和翻译科学计算代码。Fortran一直是遗留高性能计算(HPC)中用于科学发现的首选编程语言之一。尽管采用率不断增长,但基于LLM的遗留代码库代码翻译的可用性尚未得到全面评估或量化。在此,我们研究了基于LLM的Fortran到C++翻译的适用性,作为在两种不同计算平台上使用开放权重LLM构建智能体工作流的一步。我们统计量化了翻译后C++代码的编译准确性,衡量了LLM翻译代码与人工翻译C++代码的相似性,并统计量化了Fortran到C++翻译的输出相似性。

英文摘要:

Large Language Models (LLMs) are increasingly being leveraged for generating and translating scientific computer codes by both domain-experts and non-domain experts. Fortran has served as one of the go to programming languages in legacy high-performance computing (HPC) for scientific discoveries. Despite growing adoption, LLM-based code translation of legacy code-bases has not been thoroughly assessed or quantified for its usability. Here, we studied the applicability of LLM-based translation of Fortran to C++ as a step towards building an agentic-workflow using open-weight LLMs on two different computational platforms. We statistically quantified the compilation accuracy of the translated C++ codes, measured the similarity of the LLM translated code to the human translated C++ code, and statistically quantified the output similarity of the Fortran to C++ translation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑