flâneur — a map of the web's best reading

Cognition | Kevin-32B: Multi-Turn RL for Writing CUDA Kernels

cognition.ai · 4,126 words · saved by 2 readers

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