KernelZero: Co-Evolving Proposer and Coder for Continuously Improved GPU Kernel Generation
Organizations: State Key Lab of Processors, Institute of Computing Technology, CAS · University of Chinese Academy of Sciences · Intelligent Software Research Center, Institute of Software, CAS · Institute of AI for Industries, Chinese Academy of Sciences
Abstract
High-performance GPU kernels are essential to modern machine learning systems, yet automatically generating kernels that are both correct and efficient remains challenging. Existing LLM-based approaches face two major limitations: the scarcity of high-quality training data aligned with the model's current capabilities, and the inherent trade-off between kernel correctness and performance. To address these challenges, we propose KernelZero, a co-evolution framework that continuously improves GPU kernel generation through two specialized models: a Proposer that generates Torch modules from API sets and a Coder that translates them into CUDA or Triton kernels. KernelZero uses a frontier-driven module generation mechanism to continuously produce capability-aligned training modules based on the Coder's current weaknesses. It further introduces Correctness-Aware Group Relative Policy Optimization (CA-GRPO), which optimizes performance only after correctness becomes sufficiently reliable. By alternating the optimization of the Proposer and Coder, KernelZero forms an automatic curriculum that enables targeted and training-efficient capability improvement. Empirically, KernelZero-7B surpasses Claude-4.5-Sonnet on CUDA and DeepSeek-V4-Pro on Triton. On KernelBench Level 1 and 2, it achieves CUDA pass@1 scores of 75.8% and 69.6%, respectively, with pass@10 reaching 100% and 97%. On Triton, it achieves pass@1 scores of 77.2% and 72.5%, respectively.
Figures & tables
| Kernel | Model | Params | Level 1 | Level 2 | ||||||
| pass@1 | pass@5 | pass@10 | Tok. | pass@1 | pass@5 | pass@10 | Tok. | |||
| CUDA | Foundation Models | |||||||||
| Claude-3.5-Sonnet | – | 26.7 | 53.42 | 64 | 1.9k | 5.9 | 21.27 | 32 | 2.6k | |
| Claude-3.7-Sonnet | – | 26.9 | 59.83 | 70 | 3.5k | 15.6 | 46.03 | 61 | 4.3k | |
| Claude-4.5-Sonnet | – | 76.4 | 95.35 | 97 | 2.1k | 66.5 | 90.25 | 93 | 3.1k | |
| Gemini-2.5-Flash | – | 24.2 | 62.76 | 82 | 14.8k | 13.1 | 44.13 | 62 | 21.2k | |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
GPU Kernel Generation
GPU (graphics processing unit) kernel generation automates writing and optimizing device code for faster computation across accelerators.
See all 67 papers