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.


翻译:跨多编程语言的代码翻译至关重要,但由于两大障碍而极具挑战性:一是兼具可执行测试预言功能的并行数据稀缺,二是处理多样语言对时存在的优化不平衡问题。我们提出了BootTrans,一种能同时解决这两个障碍的自举方法。其核心思想是利用测试套件的功能不变性与跨语言可移植性,将丰富的枢轴语言单元测试适配为多语言强化学习训练的通用验证预言。我们的方法引入了一个包含种子池和探索池的双池架构,通过执行引导的经验收集逐步扩展训练数据。此外,我们设计了一种语言感知的加权机制,该机制基于兄弟语言间的相对性能动态地优先处理更困难的翻译方向,从而缓解优化不平衡问题。在HumanEval-X和TransCoder-Test基准上的大量实验表明,该方法在所有翻译方向上均显著优于基线大语言模型,消融实验也验证了自举与加权组件的有效性。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【NeurIPS2023】半监督端到端对比学习用于时间序列分类
专知会员服务
36+阅读 · 2023年10月17日
《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
EMNLP 2021 | 学习改写非自回归机器翻译的翻译结果
专知会员服务
16+阅读 · 2021年12月25日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
【NeurIPS2023】半监督端到端对比学习用于时间序列分类
专知会员服务
36+阅读 · 2023年10月17日
《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
EMNLP 2021 | 学习改写非自回归机器翻译的翻译结果
专知会员服务
16+阅读 · 2021年12月25日
相关基金
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员