Skip to main content
QUICK REVIEW

[論文レビュー] Dr. Kernel: Reinforcement Learning Done Right for Triton Kernel Generations

Wei Liu, Jiawei Xu|arXiv (Cornell University)|Feb 5, 2026
Advanced Neural Network ApplicationsComputer Science被引用数 0
ひとこと要約

この論文は KernelGym と多ターン強化学習法(特に TRLOO、プロファイリングベースの報酬、PRS)を用いて、14B モデル Dr. Kernel を訓練し、強力な速度向上と報酬ハッキングの削減を実現する Triton カーネルを生成する方法を示しています。KernelBench で最先端モデルと競合する性能を示し、推論時のスケーリングで顕著な利得を示します。

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.2x 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.2x speedup rate further increases to 47.8%. All resources, including environment, training code, models, and dataset, are included in https://www.github.com/hkust-nlp/KernelGYM.

研究の動機と目的

  • AI システムを加速させる高品質 GPU カーネルの自動生成を動機づける。
  • 実行ベースのフィードバックを伴う長期的なカーネル生成のための堅牢で分散された RL 環境(KernelGym)を開発する。
  • カーネル生成における報酬ハッキングと多ターン RL の lazy 最適化を特定・軽減する。
  • バイアスのない多ターン RL 推定量(TRLOO)とボトルネック認識報酬を提案し、最適化を改善する。
  • KernelBench ベンチマークと最先端モデルに対するスケーラブルなトレーニングと評価を実証する。

提案手法

  • ハッキングチェックと豊富なプロファイリングフィードバックを備えたサーバー–ワーカー型分散環境 KernelGym を作成する。
  • 各ターンがカーネルコードを改良し KernelGym から実行フィードバックを受け取る多ターン RL を使用する。
  • 自ノイズ含有バイアスを排除する Turn-level Reinforce-Leave-One-Out(TRLOO)を導入する。
  • 幾何学的 MRS によるミスマッチ補正を組み込み、訓練を安定化させる。
  • 最適化の真のボトルネックを評価するためのプロファイリングベースの報酬(PR)と、低影響サンプルを除外する PRS(Profiling-based Rejection Sampling)を追加する。
  • 逐次的なテスト時スケーリング(STTS)を適用して推論時のカーネル生成を改善する。

実験結果

リサーチクエスチョン

  • RQ1多ターン RL が実行フィードバックを明示的に提供することで、正確さ以上の有意な速度向上を生むカーネルコードを生み出せるか。
  • RQ2RL ガイダンス付きカーネル生成における報酬ハッキングと lazy 最適化をどう軽減するか。
  • RQ3長期的な目標のための偏りのない優位推定量と訓練安定化技術は何か。
  • RQ4ボトルネック志向の報酬設計と選択サンプリングは実際の性能向上と整合性を高めるか。
  • RQ5テスト時のスケーリングはコンテキストの増大を過度に招くことなく生成品質をさらに向上させられるか。

主な発見

  • Dr. Kernel-14B with STTS は Level-2 で複数のベースラインを上回り、より厳格な指標でいくつかの最先端モデルを凌駕する。
  • TRLOO は偏りのないターンレベルの利点を提供し、Fast@1.2 で GRPO および単一ターンのベースラインを上回る。
  • プロファイリングベースの報酬(PR)と PRS は MRS のみの場合より Fast@1.2 を大きく向上させ、真のボトルネックへの焦点が改善されていることを示す。
  • STTS とコンテキスト管理は Level-1 / Level-2 指標を大幅に改善し、最良ターン選択では GPT-5 や Claude-4.5-Sonnet に匹敵する結果に到達する。
  • Dr. Kernel-14B-STTS with best-turn selection は Level-2 で Fast@1.2 が 47.8% に達し、いくつかの最先端モデルを上回る。
  • Sequential test-time scaling は Level-3 の結果をさらに改善し、最先端モデルとのギャップを縮める。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。