arXiv:2608.13854cs.CL2026-08

用执行验证强化学习,提升冷门编程语言间代码翻译质量。

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

论文配图:Bootstrapping Niche Multilingual Code Translation via Reinforcement Learning with Execution-Based Verifiable Supervision
图 1 · 摘自论文原文
  • 通过执行结果构建偏好数据,训练奖励模型评估跨语言翻译质量。
  • 在600个语言对上优化模型,4B版本在冷门语言上提升21%。
  • 提出新基准HumanEval-X++,支持多语言间可执行代码翻译评测。

代码翻译需保持跨多种编程语言的可执行性,但现有神经方法主要集中于C++、Java和Python等主流语言。这导致冷门语言间的多对多翻译缺乏标注数据,生成结果看似合理却无法运行。本文提出基于执行验证的偏好强化学习方法:首先将可执行的Python代码扩展为多语言验证池;利用该池生成翻译候选,以执行结果作为标签构建偏好;进而训练奖励模型并用GRPO优化基线LLM,在600个方向(25×24)语言对上进行训练。为评估能力,引入HumanEval-X++基准,扩展至广泛多语言空间。使用Qwen-3.5 4B和9B模型测试,在HumanEval-X++及现有基准上均优于未训练基线。其中4B模型在所有语言上平均提升13%,冷门语言提升达21%。本研究建立了一套可靠的数据生成、训练与评测流程,为多语言代码翻译质量的持续提升提供可行路径。

原文摘要 · Abstract (English)

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.

代码翻译强化学习多语言执行验证

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。