Bootstrapping Niche Multilingual Code Translation via Reinforcement Learning with Execution-Based Verifiable Supervision
Organizations: National Institute of Technology, Numazu College, Japan · Seikei University, Japan · Osaka Metropolitan University, Japan · Recruit Co., Ltd., Japan ·
Abstract
Code translation must preserve executable behavior across many programming languages, yet neural code translation has largely focused on a few popular languages such as C++, Java, and Python. This leaves a niche, many-to-many setting where parallel supervision is sparse, producing plausible but non-executable translations. We address this setting with preference-based reinforcement learning driven by execution-based supervision. Our pipeline firstly expands verifiable seed Python programs into a multilingual pool of execution-validated codes. Using the pool, a base LLM generates translation candidates across language pairs, which we label by their execution outcomes. The resulting preferences are used to train a reward model that scores cross-language translation quality. Finally, we optimize our base LLMs with GRPO over 600 directed language pairs (25 x 24) using the reward model as a signal. To evaluate the niche translation capability, we introduce HumanEval-X++, an execution-based benchmark that extends HumanEval-X to a broad many-to-many language space. We evaluate our approach using Qwen-3.5 4B and 9B models. On HumanEval-X++ and existing benchmarks, it yields consistent gains over the untrained baselines. In particular, the 4B model achieves an average improvement of 13% across all languages on HumanEval-X++, with a gain of 21% on mid-tier languages. Our study establishes a reliable approach of data generation, training, and benchmarking, paving the way toward further bootstrapping the quality of many-to-many translation for programming languages.
Figures & tables
| Model | Code Translation | Utilize Execution-Based Verification | Training Method | |
| # of Source | # of Target | |||
| TransCoder ( Lachaux et al. 2020 ) | 3 | 3 | × | Back-Translation |
| TransCoder-ST ( Roziere et al. 2021 ) | 3 | 3 | ✓ | Self-Training |
| CoTran ( Jana et al. 2023 ) | 2 | 2 | ✓ | SFT + RL (PPO) |
| CodeGeeX ( Zheng et al. 2023 ) | 7 | 7 | × | SFT |
| ExeCoder ( He et al. 2025 ) | 3 | 3 | × | SFT |
| Stage 2 | Stage 3 | |||||
| Language | Seed | Verified | Rate | Positive | Negative | Pos. % |
| Popular | ||||||
| JavaScript | 11,070 | 10,103 | 91.3 | 324,036 | 68,268 | 77.1 |
| Python | 11,124 | 11,124 | 100.0 | 327,777 | 35,899 | 86.5 |
| TypeScript | 10,267 | 8,836 | 86.1 | 267,149 | 110,880 | 66.4 |
| Shell | 10,726 | 6,171 | 57.5 | 152,165 | 241,170 | 33.3 |
| Model | Non-Thinking | Thinking |
| Qwen3.5-4B | 14.58 | 11.74 |
| Qwen3.5-4B + GRPO | 15.52 | 17.30 |
| Qwen3.5-9B | 26.76 | 23.08 |
| Qwen3.5-9B + GRPO | 28.78 | 29.70 |
Code Translation
Code translation converts programs between languages, frameworks, and representations while aiming to preserve behavior and sometimes improve safety or performance.
See all 42 papers