Table of Contents
Fetching ...

Bootstrapping Code Translation with Weighted Multilanguage Exploration

Yuhan Wu, Huan Zhang, Wei Cheng, Chen Shen, Jingyue Yang, Wei Hu

TL;DR

BootTrans tackles the scarcity of multilingual parallel code with executable test oracles and the optimization imbalance across language directions by bootstrapping from a pivot language's unit tests and expanding training via execution-verified rollouts. It introduces a dual-pool RL framework and a language-aware weighting scheme (GRPO) to progressively build a multilingual translation policy that improves functional correctness across all language pairs. Empirical results on HumanEval-X and TransCoder-Test show substantial gains over strong baselines across six translation directions and multiple model families, with ablations validating the contributions of both bootstrapping and weighting. The approach offers a scalable pathway to robust multilingual code translation and demonstrates compatibility with inference-time enhancement methods, highlighting its practical potential for cross-language software modernization.

Abstract

Code translation across multiple programming languages is essential yet challenging due to two vital obstacles: scarcity of parallel data paired with executable test oracles, and optimization imbalance when handling diverse language pairs. We propose BootTrans, a bootstrapping method that resolves both obstacles. Its key idea is to leverage the functional invariance and cross-lingual portability of test suites, adapting abundant pivot-language unit tests to serve as universal verification oracles for multilingual RL training. Our method introduces a dual-pool architecture with seed and exploration pools to progressively expand training data via execution-guided experience collection. Furthermore, we design a language-aware weighting mechanism that dynamically prioritizes harder translation directions based on relative performance across sibling languages, mitigating optimization imbalance. Extensive experiments on the HumanEval-X and TransCoder-Test benchmarks demonstrate substantial improvements over baseline LLMs across all translation directions, with ablations validating the effectiveness of both bootstrapping and weighting components.

Bootstrapping Code Translation with Weighted Multilanguage Exploration

TL;DR

BootTrans tackles the scarcity of multilingual parallel code with executable test oracles and the optimization imbalance across language directions by bootstrapping from a pivot language's unit tests and expanding training via execution-verified rollouts. It introduces a dual-pool RL framework and a language-aware weighting scheme (GRPO) to progressively build a multilingual translation policy that improves functional correctness across all language pairs. Empirical results on HumanEval-X and TransCoder-Test show substantial gains over strong baselines across six translation directions and multiple model families, with ablations validating the contributions of both bootstrapping and weighting. The approach offers a scalable pathway to robust multilingual code translation and demonstrates compatibility with inference-time enhancement methods, highlighting its practical potential for cross-language software modernization.

Abstract

Code translation across multiple programming languages is essential yet challenging due to two vital obstacles: scarcity of parallel data paired with executable test oracles, and optimization imbalance when handling diverse language pairs. We propose BootTrans, a bootstrapping method that resolves both obstacles. Its key idea is to leverage the functional invariance and cross-lingual portability of test suites, adapting abundant pivot-language unit tests to serve as universal verification oracles for multilingual RL training. Our method introduces a dual-pool architecture with seed and exploration pools to progressively expand training data via execution-guided experience collection. Furthermore, we design a language-aware weighting mechanism that dynamically prioritizes harder translation directions based on relative performance across sibling languages, mitigating optimization imbalance. Extensive experiments on the HumanEval-X and TransCoder-Test benchmarks demonstrate substantial improvements over baseline LLMs across all translation directions, with ablations validating the effectiveness of both bootstrapping and weighting components.
Paper Structure (23 sections, 4 equations, 5 figures, 5 tables, 1 algorithm)

This paper contains 23 sections, 4 equations, 5 figures, 5 tables, 1 algorithm.

Figures (5)

  • Figure 1: Illustration of challenges in scaling RLVR for multilingual code translation. (i) Input monotony: verifiable seeds are predominantly confined to a single pivot language. (ii) Optimization imbalance: varying task difficulties lead to biased learning signals.
  • Figure 2: Overview of BootTrans. It comprises two key components: (i) Bootstrapping Multilanguage Exploration (left and center panels), which expands the training set via execution-verified translations; (ii) Language-aware Weight Optimization (right panels), which dynamically re-weights the loss via cross-lingual performance gaps.
  • Figure 3: Performance comparison of different pivot languages with Qwen3-1.7B.
  • Figure 4: Two examples of C++ translated into Python. BootTrans succeeds in the top case but fails in the bottom.
  • Figure 5: Error classification on HumanEval-X.