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

QiMeng-MuPa: Mutual-Supervised Learning for Sequential-to-Parallel Code Translation

Changxin Ke, Rui Zhang, Shuo Wang, Li Ding, Guangli Li, Yuanbo Wen, Shuoming Zhang, Ruiyuan Xu, Jin Qin, Jiaming Guo, Chenxi Wang, Ling Li, Qi Guo, Yunji Chen

TL;DR

QiMeng-MuPa is a novel mutual-supervised learning framework that automates the translation of sequential code (C) into parallel code (CUDA). By using an iterative "Translator-Tester" loop, the system generates its own high-quality training data and ensures functional equivalence, significantly outperforming previous state-of-the-art methods and rivaling top-tier models like GPT-4.

What Problem Does This Paper Address?

High-performance computing (HPC) increasingly relies on GPUs, but writing parallel code in languages like CUDA is notoriously difficult. It requires deep expertise in hardware-specific concepts like thread blocks and memory hierarchies. While automating the translation from sequential C to parallel CUDA is highly desirable, two major hurdles stand in the way:

  1. Data Scarcity: There are very few paired datasets of sequential and parallel code available for training machine learning models.
  2. Functional Equivalence: Even if a model generates code that looks right (achieving high textual similarity scores), it often fails to produce the correct output or even compile. Existing unsupervised methods like back-translation struggle to guarantee that the translated code actually works.

Methods

To tackle these challenges, the authors introduce QiMeng-MuPa, which consists of two primary components: a Translator (which converts code) and a Tester (which generates unit tests). These models are improved collectively through an iterative loop consisting of two steps:

  • Co-verify: The Translator generates target code for a given source function, while the Tester generates unit tests for that same source function. An execution engine then runs both the source and target code against these tests. If the outputs match and the code runs without errors, the result is saved as a "Verified Triplet" (Source, Target, Tests).
  • Co-evolve: These verified triplets are used to fine-tune both models. The Translator learns from the correct translations, and the Tester learns from the valid code-test pairs.

As the Translator improves, it provides more complex code for the Tester to verify; as the Tester improves, it provides more rigorous filtering to ensure the Translator only learns from functionally correct code.

The Overview of QiMeng-MuPa. The framework consists of a Translator and a Tester that mutually generate data and improve through iterative Co-verify and Co-evolve steps.

Datasets

The researchers started with an unaligned training set from BabelTower, containing roughly 500k C functions and 130k CUDA kernels. After filtering for functions that could successfully compile, they were left with ~15k C and ~29k CUDA functions.

Through their iterative process, they produced a new, high-quality dataset of 10,563 verified parallel function pairs in C and CUDA, each accompanied by five unit tests. This dataset was used to train a small 0.6B parameter model (Qwen3-0.6B) that achieved performance comparable to much larger proprietary models.

Key Insights and Ideas

  • Mutual Supervision is a Force Multiplier: Instead of relying on static datasets, the models act as each other's teachers. The core insight is that a model doesn't need a human-labeled dataset if it has a way to verify its own logic through execution.
  • Functional Correctness > Textual Similarity: The paper argues that traditional metrics like BLEU (which measures textual overlap) are poor indicators of whether code actually works. They prioritize Pass@k (the probability that at least one of $k$ generated samples is correct).
  • Language-Agnostic Training: The authors found that training a single model to handle both C-to-CUDA and CUDA-to-C translation performs better than training specialized models. The increased volume of data from combining tasks outweighs any potential confusion between languages.

Key Results

The QiMeng-MuPa framework showed dramatic improvements over base models and existing baselines:

  • Performance Boost: When applied to Qwen2.5-Coder, it improved Pass@1 by 28.91% and boosted the Tester’s accuracy by nearly 69%.
  • Outperforming SOTA: It beat the previous state-of-the-art method, CodeRosetta, by 1.56 BLEU and 6.92 CodeBLEU points.
  • Competitive with Giants: The framework enabled open-source models (like Llama3 and Qwen2.5) to achieve performance comparable to DeepSeek-R1 and GPT-4.1 in code translation tasks.
  • Real-world Speedups: In case studies of classical algorithms like GEMM (General Matrix Multiplication), the translated CUDA code achieved speedups of up to 15,259x over the sequential C version.
Evaluation of Code Translation across iterations. Performance metrics like Pass@1 and CPass show steady improvement over four rounds of mutual supervision.

Limitations and Future Work

While successful, the authors note a few areas for growth:

  • Data Scale: The verified training set is still relatively small (around 10k pairs).
  • Test Complexity: The current test sets focus on functional correctness for relatively simple cases and may not fully capture the nuances of complex, large-scale real-world parallel tasks.
  • Efficiency Optimization: Future work will look into using reinforcement learning to help the models generate not just correct parallel code, but the most efficient and high-performance kernels possible.

Summary updated

BibTeX
@inproceedings{ke2025qimeng,
  author = {Changxin Ke and Rui Zhang and Shuo Wang and Li Ding and Guangli Li and Yuanbo Wen and Shuoming Zhang and Ruiyuan Xu and Jin Qin and Jiaming Guo and Chenxi Wang and Ling Li and Qi Guo and Yunji Chen},
  title = {{QiMeng-MuPa: Mutual-Supervised Learning for Sequential-to-Parallel Code Translation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=bjUDrU4wPv},
}
Figure