通过加权多语言探索进行代码翻译的 bootstrap
Bootstrapping Code Translation with Weighted Multilanguage Exploration
AI总结:
本文提出BootTrans方法,通过利用测试套件的功能不变性和跨语言可移植性,解决代码翻译中平行数据稀缺和优化不平衡的问题,通过双池架构和语言感知加权机制提升多语言强化学习训练效果。
摘要:
跨多种编程语言的代码翻译至关重要却具有挑战性,主要障碍在于平行数据稀缺且缺乏可执行测试或acles,以及在处理多样语言对时的优化不平衡。我们提出BootTrans,一种bootstrap方法,解决这两个障碍。其核心思想是利用测试套件的功能不变性和跨语言可移植性,将丰富的pivot语言单元测试适应为多语言强化学习(RL)训练的通用验证或acles。我们的方法引入双池架构,包含种子池和探索池,通过执行引导的经验收集逐步扩展训练数据。此外,我们设计了语言感知的加权机制,根据同级语言间的相对性能动态优先处理更难的翻译方向,缓解优化不平衡。在HumanEval-X和TransCoder-Test基准上的大量实验表明,与基线LLMs相比,在所有翻译方向上均取得了显著改进,消融研究验证了bootstrap和加权组件的有效性。
英文摘要:
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 reinforcement learning (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 ablation studies validating the effectiveness of both bootstrapping and weighting components.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。