Lune

ICML2026Top-tier venue

Dr. Kernel: Reinforcement Learning Done Right for Triton Kernel Generations

Wei Liu, Jiawei Xu, Yingru Li, Longtao Zheng, Tianjian Li, Qian Liu, Junxian He

Abstract

High-quality kernel is critical for scalable AI systems, and enabling LLMs to generate such code would advance AI development. However, training LLMs for this task requires sufficient data, a robust environment, and the process is often vulnerable to reward hacking and lazy optimization. In these cases, models may hack training rewards and prioritize trivial correctness over meaningful speedup. In this paper, we systematically study reinforcement learning (RL) for kernel generation. We first design KERNELGYM, a robust distributed GPU environment that supports reward hacking check, data collection from multi-turn interactions and long-term RL training. Building on KERNELGYM, we investigate effective multi-turn RL methods and identify a biased policy gradient issue caused by self-inclusion in GRPO. To solve this, we propose Turn-level Reinforce-Leave-One-Out (TRLOO) to provide unbiased advantage estimation for multi-turn RL. To alleviate lazy optimization, we incorporate mismatch correction for training stability and introduce Profiling-based Rewards (PR) and Profiling-based Rejection Sampling (PRS) to overcome the issue. The trained model, DR. KERNEL-14B, reaches performance competitive with Claude-4.5-Sonnet in Kernelbench. Finally, we study sequential test-time scaling for DR. KERNEL-14B. On the KernelBench Level-2 subset, 31.6% of the generated kernels achieve at least a 1.2× speedup over the Torch reference, surpassing Claude-4.5-Sonnet (26.7%) and GPT-5 (28.6%). When selecting the best candidate across all turns, this 1.2× speedup rate further increases to 47.8%. All resources, including environment, training code, models, and dataset, are included in github.com/hkust-nlp/KernelGYM. D .K -14B + STTS (Best)

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Kevin: Multi-Turn RL for Generating CUDA Kernels cites KernelBench: Can LLMs Write Efficient GPU Kernels?
  • Kevin: Multi-Turn RL for Generating CUDA Kernels cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • KernelBench: Can LLMs Write Efficient GPU Kernels? cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on3

  1. FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
  2. Kevin: Multi-Turn RL for Generating CUDA KernelsCarlo Baronio, Pietro Marsella, Ben Pan, Simon Guo et al.ICLR 2026 · 81 citations
  3. KernelBench: Can LLMs Write Efficient GPU Kernels?Anne Ouyang, Simon Guo, Simran Arora, Alex L. Zhang et al.ICML 2025

Related papers

  1. QiMeng-Kernel: Macro-Thinking Micro-Coding Paradigm for LLM-Based High-Performance GPU Kernel GenerationXinguo Zhu, Shaohui Peng, Jiaming Guo, Yunji Chen et al.AAAI 2026 · 9 citations
  2. STARK: Strategic Team of Agents for Refining KernelsJuncheng Dong, Yang Yang, Tao Liu, Yang Wang et al.ICLR 2026 · 26 citations
  3. StitchCUDA: An Automated Multi-Agents End-to-End GPU Programing Framework with Rubric-based Agentic Reinforcement LearningShiyang Li, Zijian Zhang, Winson Chen, Yuebo Luo et al.ICML 2026 · 9 citations
  4. EGG: An Expert-Guided Agent Framework for Kernel GenerationYaochen Han, Ke Fan, Hongxu Jiang, Wanqi Xu et al.ICML 2026
  5. ReVeal: Self-Evolving Code Agents via Reliable Self-VerificationYiyang Jin, Kunzhao Xu, Hang Li, Xueting Han et al.ICLR 2026 · 13 citations
Dusk over the sea between two cliffs drawn in fine vertical lines