NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bootstrapping Niche Multilingual Code Translation via Reinforcement Learning with Execution-Based Verifiable Supervision

Kouki Yuki, Jie Zeng, Kyoko Ogawa, Ryunosuke Ikeda, Yohei Kobashi, Takeshi Kojima, Ikuya Yamada, Yusuke Iwasawa, Yutaka MatsuoarXiv 2026

This paper presents a robust framework for tackling one of the most persistent challenges in AI-driven software engineering: translating code into "niche" or "long-tail" programming languages where training data is scarce.

TL;DR

The authors introduce NicheCodeTranslator, a pipeline that uses reinforcement learning (RL) and execution-based verification to bootstrap code translation across 25 different programming languages. By training a reward model to predict whether code will actually run and pass tests, they achieve a 13% average performance boost, with gains as high as 21% for mid-tier languages.

What Problem Does This Paper Address?

While Large Language Models (LLMs) are surprisingly good at translating between popular languages like Python, Java, and C++, they often stumble when tasked with "niche" languages (e.g., Julia, Lua, or Ada). In these cases, models often produce code that looks correct but fails to compile or run—a problem known as failing to preserve "functional equivalence."

The core challenge is the lack of parallel data: there aren't many repositories containing the exact same logic written in both Python and, say, Haskell. Furthermore, using Reinforcement Learning to fix this is difficult to scale; running execution sandboxes for 25 different languages during the training loop is computationally expensive and prone to infrastructure errors.

Methods

The authors propose a three-stage pipeline to bridge this gap, as illustrated in the overview below:

Figure 1: Overview of our pipeline. Data Generation: Stage1 synthesizes assertions for each KodCode Python seed with sandboxed execution-based filtering, followed by type inference. Stage2 exports the code and assertion pairs to 24 further languages. Only candidates passing all transpiled tests are admitted, yielding execution-verified source programs in 25 languages. Stage3 builds the labeled pair data by translating each source into the other 24 languages, and sandboxed execution labels every candidate positive or negative, covering 25 × 24 = 600 directions. Training: Stage1 trains a reward model on these execution- verified labels. A single model scores all translation directions. Stage2 optimizes the policy with GRPO over the verified source pool. The learned reward replaces per-language sandboxes at rollout time: RL stably and efficiently scales to 600 directions. Evaluation: HumanEval-X is extended to HumanEval-X++ by the same rule-based transpilation, broadening the target from 6 to 25 languages. The models are evaluated by executing the generated code against the transpiled test suites.
  1. Verifiable Data Generation: They start with high-quality Python seeds (from the KodCode dataset) and synthesize unit tests. These tests and function headers are then transpiled into 24 other languages using deterministic, rule-based tools.
  2. Learned Reward Model (RM): Instead of running a sandbox every time the model generates a translation during RL, they train a "cross-encoder" reward model. This RM learns to predict the execution outcome (pass/fail) based on the source code and the generated translation. This effectively "internalizes" the execution judge, allowing the training to scale to 600 directed language pairs (25 source $\times$ 24 target).
  3. Policy Optimization (GRPO): They fine-tune the base models (Qwen-3.5 4B and 9B) using Group Relative Policy Optimization (GRPO). The model is rewarded for generating code that the RM predicts will pass the unit tests.

Datasets

  • KodCode: Used as the source for initial Python seeds and test synthesis.
  • HumanEval-X++ (New): The authors introduced this benchmark by extending the popular HumanEval-X (which covers 6 languages) to 25 languages. They used rule-based transpilation to ensure the problem semantics remained identical across all versions.
  • CodeScope: An existing multilingual benchmark used for additional validation.

Key Insights and Ideas

  • Decoupling Reward from Infrastructure: The most significant "aha moment" is the use of a learned reward model to proxy execution. By doing this, the authors avoided the "hell" of managing 25 different compilers and runtimes inside a high-speed RL training loop.
  • Execution is the Ultimate Truth: The paper reinforces that for code, "plausibility" is not enough. By filtering training data through sandboxed execution, they ensure the model learns from functionally correct examples rather than just statistically likely ones.
  • The "Mid-tier" Sweet Spot: The largest gains weren't in the most popular languages (where models are already good) or the most obscure ones (where models lack basic syntax knowledge), but in the "mid-tier." In these languages, the model often just needed a "nudge" to fix structural errors, like missing function closings.
Figure 3: An example of C++ to Julia translation. Without RL, the output fails to compile because the body of the solu- tion is missing and the end closing the function is omitted. After GRPO, the model emits the same algorithm in confor- mance with Julia’s conventions and passes the tests.

Key Results

The experiments, conducted on Qwen-3.5 models, showed consistent improvements across the board:

  • Overall Gain: The 4B model saw a 13% average improvement across all 25 languages on HumanEval-X++.
  • Mid-tier Surge: Languages like Perl and Lua saw massive recoveries. For example, Perl accuracy jumped from 9.2% to 67.8%, and Ruby rose from 29.9% to 86.8%.
  • Error Reduction: More than half of the performance gain came from a drastic reduction in compilation errors, proving the RL successfully taught the model the "rules of the road" for these niche languages.

Limitations and Future Work

  • Functional Language Gap: The method was less effective for functional or declarative languages like Ada, OCaml, and Racket. These languages are syntactically distant from the imperative source languages, suggesting the model might need more basic pre-training on their unique paradigms.
  • Transpiler Dependency: The quality of the entire pipeline depends on the rule-based transpiler used to port tests. If the transpiler makes a mistake, the model learns from flawed supervision.
  • Compute Constraints: The authors noted that due to limited resources, they couldn't perform extensive hyperparameter tuning, suggesting there might be even more performance left on the table.

Summary updated

BibTeX
@misc{yuki2026bootstrapping,
  author = {Kouki Yuki and Jie Zeng and Kyoko Ogawa and Ryunosuke Ikeda and Yohei Kobashi and Takeshi Kojima and Ikuya Yamada and Yusuke Iwasawa and Yutaka Matsuo},
  title = {{Bootstrapping Niche Multilingual Code Translation via Reinforcement Learning with Execution-Based Verifiable Supervision}},
  year = {2026},
  eprint = {2608.13854},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.13854},
}
Figure