EffiReasonTrans: RL-Optimized Reasoning for Code Translation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wang, Yanlin, Ou, Rongyi, Wang, Yanli, Liu, Mingwei, Chen, Jiachi, Shi, Ensheng, Liu, Xilin, Ma, Yuchi, Zheng, Zibin
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866914106556022784
author Wang, Yanlin
Ou, Rongyi
Wang, Yanli
Liu, Mingwei
Chen, Jiachi
Shi, Ensheng
Liu, Xilin
Ma, Yuchi
Zheng, Zibin
author_facet Wang, Yanlin
Ou, Rongyi
Wang, Yanli
Liu, Mingwei
Chen, Jiachi
Shi, Ensheng
Liu, Xilin
Ma, Yuchi
Zheng, Zibin
contents Code translation is a crucial task in software development and maintenance. While recent advancements in large language models (LLMs) have improved automated code translation accuracy, these gains often come at the cost of increased inference latency, hindering real-world development workflows that involve human-in-the-loop inspection. To address this trade-off, we propose EffiReasonTrans, a training framework designed to improve translation accuracy while balancing inference latency. We first construct a high-quality reasoning-augmented dataset by prompting a stronger language model, DeepSeek-R1, to generate intermediate reasoning and target translations. Each (source code, reasoning, target code) triplet undergoes automated syntax and functionality checks to ensure reliability. Based on this dataset, we employ a two-stage training strategy: supervised fine-tuning on reasoning-augmented samples, followed by reinforcement learning to further enhance accuracy and balance inference latency. We evaluate EffiReasonTrans on six translation pairs. Experimental results show that it consistently improves translation accuracy (up to +49.2% CA and +27.8% CodeBLEU compared to the base model) while reducing the number of generated tokens (up to -19.3%) and lowering inference latency in most cases (up to -29.0%). Ablation studies further confirm the complementary benefits of the two-stage training framework. Additionally, EffiReasonTrans demonstrates improved translation accuracy when integrated into agent-based frameworks. Our code and data are available at https://github.com/DeepSoftwareAnalytics/EffiReasonTrans.
format Preprint
id arxiv_https___arxiv_org_abs_2510_18863
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle EffiReasonTrans: RL-Optimized Reasoning for Code Translation
Wang, Yanlin
Ou, Rongyi
Wang, Yanli
Liu, Mingwei
Chen, Jiachi
Shi, Ensheng
Liu, Xilin
Ma, Yuchi
Zheng, Zibin
Software Engineering
Code translation is a crucial task in software development and maintenance. While recent advancements in large language models (LLMs) have improved automated code translation accuracy, these gains often come at the cost of increased inference latency, hindering real-world development workflows that involve human-in-the-loop inspection. To address this trade-off, we propose EffiReasonTrans, a training framework designed to improve translation accuracy while balancing inference latency. We first construct a high-quality reasoning-augmented dataset by prompting a stronger language model, DeepSeek-R1, to generate intermediate reasoning and target translations. Each (source code, reasoning, target code) triplet undergoes automated syntax and functionality checks to ensure reliability. Based on this dataset, we employ a two-stage training strategy: supervised fine-tuning on reasoning-augmented samples, followed by reinforcement learning to further enhance accuracy and balance inference latency. We evaluate EffiReasonTrans on six translation pairs. Experimental results show that it consistently improves translation accuracy (up to +49.2% CA and +27.8% CodeBLEU compared to the base model) while reducing the number of generated tokens (up to -19.3%) and lowering inference latency in most cases (up to -29.0%). Ablation studies further confirm the complementary benefits of the two-stage training framework. Additionally, EffiReasonTrans demonstrates improved translation accuracy when integrated into agent-based frameworks. Our code and data are available at https://github.com/DeepSoftwareAnalytics/EffiReasonTrans.
title EffiReasonTrans: RL-Optimized Reasoning for Code Translation
topic Software Engineering
url https://arxiv.org/abs/2510.18863