Correct First, Fast Second: What a Local 7B Code Model Can and Cannot Do for GPU Kernel Optimization
Not on the map. Why?
Abstract (arXiv)
We study how much the interaction strategy around a fixed, locally hosted 7B-parameter code model (Qwen2.5-Coder-7B-Instruct) affects its ability to replace PyTorch operators with custom CUDA kernels. On 30 KernelBench tasks (levels 1-3, first 10 each, evaluated on a V100), we compare four regimes of increasing structure: zero-shot prompting, profiling-guided prompting, iterative refinement on execution feedback, and a multi-agent loop (analysis, retrieval, generation, evaluation, feedback triage) in which the same model fills four roles around a non-LLM evaluator. Three findings stand out. (1) Correctness, not speed, is the binding constraint: even correct generated kernels average 0.97-0.99x the speed of eager PyTorch, because a 7B model cannot out-write cuBLAS/cuDNN on dense GEMM and convolution; the only real wins are fused memory-bound epilogues. (2) The best strategy depends on difficulty: profiling-guided prompting is strongest overall (43% correct, 27% faster than baseline), but the agent loop is the only method that solves any level-2 fusion problem (3/10 vs. 0/10 for all others). (3) Naive agentic scaffolding is actively harmful: our first agent scored 3% correct, below zero-shot's 30%, and the decisive repairs were matching the agent's ambition to the model's competence and spending compute on best-of-n sampling under a real execution oracle (3% to 33% correct from n=1 to n=8), not on more reasoning steps.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Builds on 6 of its 7 references that are in the map. Submitted 9 Nov 2026.
Builds on
6 of 7 references.
References · 6
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,789
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,799
- 2022Competition-Level Code Generation with AlphaCodecited by 1,510
- 2024Qwen2.5-Coder Technical Reportcited by 1,301
- 2023Teaching Large Language Models to Self-Debugcited by 1,049
- 2025KernelBench: Can LLMs Write Efficient GPU Kernels?cited by 279
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026KernelBench-Verified: Do LLM-Generated Kernels Actually Beat PyTorch?
- 2026A Two-Stage GPU Kernel Tuner Combining Semantic Refactoring and Search-Based Optimization
- 2026Kernel Forge: An Agent Harness for LLM-based Generation and Optimization of CUDA Kernels
- 2026Agentic Kernel Optimization: Generating State-of-the-Art GPU Kernels Without Hand-Written CUDA
- 2026KernelOPT: Dispatch-Aware Agentic Search for GPU Kernel Optimization
- 2026Optimizing CUDA like a Human: Micro-Profiling Tools as Expert Surrogates for LLM-Based GPU Kernel Optimization
- 2025Astra: A Multi-Agent System for GPU Kernel Performance Optimization
- 2025STARK: Strategic Team of Agents for Refining Kernels