GXPO: Group Cross-Lingual Relative Policy Optimization for Code Generation
Abstract
Current reinforcement learning (RL) methods for code generation are predominantly optimized on Python, showing weak generalization to other programming languages (PLs). Although leveraging multilingual solutions offers richer semantics and a wider search landscape, naive independent training across languages suffers from optimization imbalance and fails to effectively transfer knowledge from high-resource languages. We propose Group Cross-lingual Relative Policy Optimization (GXPO), which forms training groups by generating solutions for the same problem in multiple PLs and jointly optimizes language-specific and cross-language signals, enabling more balanced optimization and improved transfer to low-resource PLs. We additionally introduce Multilingual LiveCodeBench (ML-LCB), extending LiveCodeBench to a unified multilingual evaluation setting. On ML-LCB across 8 PLs, GXPO consistently improves performance, with pronounced gains on low-resource PLs, demonstrating scalable multilingual RL for language-consistent code generation.
Lay Summary
Large language models can now write programs, but most training methods focus mainly on Python. This matters because people use many programming languages, and a coding assistant that works well in one language may still struggle in others. We study how to teach a model to solve the same programming problem across several languages at once, so progress in one language can help improve another. Our method, GXPO, asks the model to try solutions in multiple languages and uses test results to compare not only attempts within each language, but also how well different languages support each other as a group. This gives the model a fairer learning signal, especially for languages with fewer training examples. We also build a multilingual version of LiveCodeBench to evaluate code generation in eight programming languages under a unified setting. Across several open-source models, GXPO improves performance over a standard reinforcement learning baseline, with especially strong gains in lower-resource languages such as Go, PHP, Ruby, and Perl. Our results suggest that future coding assistants can become more reliable across the languages developers actually use, without requiring expensive hand-written solutions in every language.