paper-with-me

Papers

Fortran2CPP: Automating Fortran-to-C++ Translation using LLMs via Multi-Turn Dialogue and Dual-Agent Integration

2024-12-27 · Le Chen, Bin Lei, Dunzhi Zhou, Pei-Hung Lin, Chunhua Liao, Caiwen Ding, Ali Jannesari

Translating legacy Fortran code into C++ is a crucial step in modernizing high-performance computing (HPC) applications. However, the scarcity of high-quality, parallel Fortran-to-C++ datasets and the limited domain-specific expertise in large language models (LLMs) present significant challenges for automated translation. In this paper, we introduce Fortran2CPP, a multi-turn dialogue dataset generated by a novel LLM agent-based approach that integrates a dual-LLM Questioner-Solver module to enhance translation accuracy. Our dataset comprises 11.7k dialogues capturing iterative feedback-decision workflows including code translation, compilation, execution, unit testing, and error-fixing. Using this dataset, we fine-tune several open-weight LLMs and achieve up to a 3.31x improvement in CodeBLEU scores and a 92\% increase in compilation success rate, demonstrating enhanced syntactic accuracy and functional reliability. Our findings highlight the value of dialogue-based LLM training for complex code translation tasks. The dataset and model have been open-sourced and are available on our public GitHub repository\footnote{\url{https://github.com/HPC-Fortran2CPP/Fortran2Cpp}}.

📄 PDF Abstract BibTeX arXiv:2412.19770

Code (1)

hpc-fortran2cpp/fortran2cpp 공식 구현 pytorch

Tasks

C++ codeCode RepairCode TranslationTranslation

Similar Papers 제목 키워드 기반

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

2025-04-21 · Nishath Rajiv Ranasinghe, Shawn M. Jones, Michal Kucer, Ayan Biswas 외

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 lan…

C++ codeCode TranslationTranslation

Creating a Dataset for High-Performance Computing Code Translation using LLMs: A Bridge Between OpenMP Fortran and C++

2023-07-15 · Bin Lei, Caiwen Ding, Le Chen, Pei-Hung Lin 외

In this study, we present a novel dataset for training machine learning models translating between OpenMP Fortran and C++ code. To ensure reliability and applicability, the dataset is created from a range of representati…

C++ codeCode TranslationTranslation

Systematic LLM Translation of Legacy Scientific Code to Differentiable Frameworks: Application to a Land Surface Model

2026-06-04 · Aya Lahlou, Linnia Hawkins, Pierre Gentine arxiv

Differentiable programming offers transformative capabilities for scientific modeling, enabling gradient-based parameter estimation, sensitivity analysis, and data assimilation. Yet, migrating legacy codebases into diffe…

A parallel Fortran framework for neural networks and deep learning

2019-02-18 · Milan Curcic

This paper describes neural-fortran, a parallel Fortran framework for neural networks and deep learning. It features a simple interface to construct feed-forward neural networks of arbitrary structure and size, several a…

Deep Learning

Enhancing Cross-Language Code Translation via Task-Specific Embedding Alignment in Retrieval-Augmented Generation

2024-12-06 · Manish Bhattarai, Minh Vu, Javier E. Santos, Ismael Boureima 외

We introduce a novel method to enhance cross-language code translation from Fortran to C++ by integrating task-specific embedding alignment into a Retrieval-Augmented Generation (RAG) framework. Unlike conventional retri…

Code GenerationCode TranslationContrastive LearningLanguage Modeling+5