arXiv:2602.11000cs.DCcs.AI2026-02被引 5

用强化学习微调GPT-5生成更高效、更准确的GPU内核代码。

Fine-Tuning GPT-5 for GPU Kernel Generation

  • 通过强化学习替代监督微调,解决高质量训练数据不足问题。
  • 单次尝试下内核正确率从43.7%提升至77.0%,超越TorchInductor的场景增至21.8%。
  • 集成到编码代理后可解决97.4%的问题,速度平均快2.12倍,适合加速器编程开发者。

高效GPU内核开发对现代AI系统扩展至关重要,但受限于复杂硬件架构和专业化优化需求。尽管大语言模型在通用代码生成中表现良好,但在GPU代码生成上因高质量标注数据稀缺、编译器偏差及跨代泛化能力差而受限,难以通过监督微调提升。相比之下,强化学习具备数据高效与自适应优势,但需配套工具与评估环境。本文提出Makora环境与工具,用于前沿模型的强化学习微调,并报告了对GPT-5进行Triton代码生成微调的结果。在单次尝试下,内核正确率由43.7%提升至77.0%(+33.3个百分点),超越TorchInductor的案例从14.8%增至21.8%(+7个百分点),并在KernelBench上优于现有最先进模型。集成至完整编码代理后,可在扩展的KernelBench套件中解决高达97.4%的问题,且在72.9%的测试中胜过PyTorch TorchInductor,几何均值提速2.12倍。结果表明,针对特定技术领域开展强化学习后训练,可突破传统监督学习在数据有限时的瓶颈,为AI辅助加速器编程开辟新路径。

原文摘要 · Abstract (English)

Developing efficient GPU kernels is essential for scaling modern AI systems, yet it remains a complex task due to intricate hardware architectures and the need for specialized optimization expertise. Although Large Language Models (LLMs) demonstrate strong capabilities in general sequential code generation, they face significant challenges in GPU code generation because of the scarcity of high-quality labeled training data, compiler biases when generating synthetic solutions, and limited generalization across hardware generations. This precludes supervised fine-tuning (SFT) as a scalable methodology for improving current LLMs. In contrast, reinforcement learning (RL) offers a data-efficient and adaptive alternative but requires access to relevant tools, careful selection of training problems, and a robust evaluation environment. We present Makora's environment and tools for reinforcement learning finetuning of frontier models and report our results from fine-tuning GPT-5 for Triton code generation. In the single-attempt setting, our fine-tuned model improves kernel correctness from 43.7% to 77.0% (+33.3 percentage points) and increases the fraction of problems outperforming TorchInductor from 14.8% to 21.8% (+7 percentage points) compared to baseline GPT-5, while exceeding prior state-of-the-art models on KernelBench. When integrated into a full coding agent, it is able to solve up to 97.4% of problems in an expanded KernelBench suite, outperforming the PyTorch TorchInductor compiler on 72.9% of problems with a geometric mean speedup of 2.12x. Our work demonstrates that targeted post-training with reinforcement learning can unlock LLM capabilities in highly specialized technical domains where traditional supervised learning is limited by data availability, opening new pathways for AI-assisted accelerator programming.

GPU内核强化学习代码生成大模型微调

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。