about
RL on GPT-5 to write better kernels (arxiv.org)
4 points by atallahw 234 days ago | hide | past | pdf | 1 comment on HN

In plain words: Instead of learning from labeled examples, which are scarce for GPU code, GPT-5 was trained by trial and error with a purpose-built setup that tests and rewards the Triton kernels it writes. Correct kernels rose from 43.7% to 77.0% on first try.

Abstract · Fine-Tuning GPT-5 for GPU Kernel Generation

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.

Ali Tehrani, Yahya Emara, Essam Wissam, Wojciech Paluch, Waleed Atallah, Łukasz Dudziak, Mohamed S. Abdelfattah
arXiv:2602.11000 · cs.DC, cs.AI, cs.LG · submitted Feb 11, 2026
abstract · pdf · html

add comment on HN
Also discussed: Feb 2026 (4 points, 0 comments)

We got access to OpenAI's RFT API with GPT5 and tried to see how good we could get it at one-shot Triton kernel generation. Some key decisions/observations: 1. tool use instead of multi-turn rl 2. skip SFT altogether 3. dataset curation was more important than dataset scale 4. reward hacks detection must be robust 5. models are getting a lot better at this