Cognition | Kevin-32B: Multi-Turn RL for Writing CUDA Kernels
Coding is an iterative process – you write a program, execute it, evaluate the results, and refine your code based on the feedback. Recent advances in LLM for code generation have tried to incorporate this process at inference-time, using methods like parallel sampling. While these methods are effective, they rely on search without actual learning — the model weights are frozen. We explore reinforcement learning in a multi-turn setting, using intermediate feedback from the environment, and masking model thoughts to avoid exploding context over multiple turns. Our model, Kevin-32B = K(ernel D)evin, outperforms frontier reasoning models on kernel generation. Moreover, our results show that multi-turn training makes the model more effective at self-refinement compared to single-turn training. We use KernelBench, a dataset of 250 PyTorch-based classic deep learning tasks. It measures a model’s ability to replace the PyTorch operators with optimized CUDA kernels. We focus on the first two l
Carlo Baronio*, Pietro Marsella*, Ben Pan*, Silas Alberti Stanford University, Cognition AI *equal contribution Coding is an iterative process – you write a program, execute it, evaluate the results, and refine your code based on the feedback. Recent advances in LLM for code generation have tried to incorporate this process at inference-time, using methods like parallel sampling. While these methods are effective, they rely on search without actual learning — the model weights are frozen. We explore reinforcement learning in a multi-turn setting, using intermediate feedback from the environmen
Explore this link on the map →saved by
related reading
- Composer2.pdfcursor.com
- Introducing SWE-grep and SWE-grep-mini: RL for Multi-Turn, Fast Context Retrieval | Cognitioncognition.ai
- Defeating Nondeterminism in LLM Inference - Thinking Machines Labthinkingmachines.ai
- Look Ma, No Bubbles! Designing a Low-Latency Megakernel for Llama-1B · Hazy Researchhazyresearch.stanford.edu
- KernelBench v0.1 | Scaling Intelligence Lab at Stanford Universityscalingintelligence.stanford.edu
- How to Land a Frontier Lab Jobvladfeinberg.com
- ⭐️ Fast LLM Inference From Scratchandrewkchan.dev
- Andrej Karpathy — AGI is still a decade awaydwarkesh.com
- 2506.17298arxiv.org
- Improving Composer through real-time RL · Cursorcursor.com
- Coding Models Are Doing Too Much | whnrehiew.github.io
- State of RL for reasoning LLMs | A. Weersaweers.de