Beyond Code Pairs: Dialogue-Based Data Generation for LLM Code Translation

Le Chen, Nuo Xu, Winson Chen, Bin Lei, Pei-Hung Lin +5 more
11/29/2025
cs.PLcs.AIcs.SE

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) have shown remarkable capabilities in code translation, yet their performance deteriorates in low-resource programming domains such as Fortran and emerging frameworks like CUDA, where high-quality parallel data are scarce. We present an automated dataset generation pipeline featuring a dual-LLM Questioner-Solver design that incorporates external knowledge from compilers and runtime feedback. Beyond traditional source-target code pair datasets, our approach additionally generates (1) verified translations with unit tests for assessing functional consistency, and (2) multi-turn dialogues that capture the reasoning process behind translation refinement. Applied to Fortran -> C++ and C++ -> CUDA, the pipeline yields 3.64k and 3.93k dialogues, respectively. Fine-tuning on this data yields dramatic improvements in functional correctness, boosting unit test success rates by over 56% on the challenging C++-to-CUDA task. We show this data enables a 7B open-weight model to significantly outperform larger proprietary systems on key metrics like compilation success.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2025beyond,
  title  = {Beyond Code Pairs: Dialogue-Based Data Generation for LLM Code Translation},
  author = {Le Chen and Nuo Xu and Winson Chen and Bin Lei and Pei-Hung Lin and Dunzhi Zhou and Rajeev Thakur and Caiwen Ding and Ali Jannesari and Chunhua Liao},
  year   = {2025},
  eprint = {2512.03086},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.03086v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.03086.svg)](https://codeofpaper.com/paper/2512.03086)

Discussion