TL;DR
This paper introduces the concept of using Large Language Models (LLMs) as "virtual GPU surrogates" to forecast the runtime performance of generated GPU kernels. By predicting relative speedups and reporting calibrated confidence, these surrogates allow kernel optimization searches to filter out slow candidates, drastically reducing the need for expensive on-device evaluations and finding faster kernels under a fixed hardware budget.
What Problem Does This Paper Address?
Modern deep learning relies heavily on highly optimized GPU kernels. To find the fastest implementations, state-of-the-art methods use LLM agents or evolutionary algorithms to automatically generate thousands of candidate kernels.
However, evaluating these candidates is a massive bottleneck: each kernel must be compiled (which can take up to two minutes for CUDA) and executed repeatedly on physical hardware to get an accurate runtime measurement. This process is slow, expensive, and requires complex infrastructure. The authors address this bottleneck by asking: Can we use LLMs to predict how a physical GPU will respond to a piece of code, avoiding the need to run every single candidate on actual hardware?
Methods
Instead of trying to predict exact execution times in seconds (which is intractable due to complex hardware behaviors), the authors formulate the task as relative performance forecasting.
- Task Formulation: The LLM is given a reference kernel, a candidate kernel, and the hardware specifications (e.g., NVIDIA A100). It is prompted to reason step-by-step and output a probability distribution over 8 discrete, logarithmic speedup bins (ranging from severe slowdown to >4x speedup).
- Selective Prediction: The model outputs a confidence score alongside its prediction. If confidence is high, the search algorithm trusts the forecast; if it's low, it defers to a real GPU measurement.
- Reinforcement Learning for Calibration: To ensure the model's confidence is trustworthy, the authors fine-tune an open-weights model (GPT-OSS-20B) using Reinforcement Learning (GRPO). They test three reward structures: pure correctness, correctness + Categorical Calibration (Brier score), and correctness + Distance-Aware Calibration (CRPS).
Datasets
The authors built and released a massive, reusable dataset consisting of 12,388 unique LLM-generated GPU kernels with measured runtimes.
- Scope: Covers 118 problems, written in both CUDA and Triton, across three GPU generations (NVIDIA A100, L40S, H100).
- Evaluation Set: A curated subset of 480 Triton kernels across 6 challenging tasks from the GPU Mode kernel optimization competition (including TriMul, cross-entropy, Gated DeltaNet, and FP8 quantization).
Key Insights and Ideas
- LLMs as Physical World Models: LLMs don't just understand code syntax; they can simulate microarchitectural implications (like tensor core throughput and memory coalescing) well enough to act as surrogates for physical hardware.
- The "Correctness Trap" in RL: Training a model purely to get the right bin makes it highly overconfident on its wrong answers. Adding a Brier score penalty forces the model to distribute its uncertainty properly, which unexpectedly improves its ability to rank good kernels.
- Data is Free: A beautiful property of this setup is that the training data for the surrogate is a natural by-product of running the kernel search itself—every explored candidate provides a new training tuple.
Key Results
- High Speedup Recovery: Off-the-shelf models perform surprisingly well. Gemini-3 Flash recovers 93.12% of the maximum available speedup while only evaluating a fraction of the candidates on a real GPU.
- RL Boosts Performance: Fine-tuning with a Brier-shaping reward improved the speedup recovered by +2.06 percentage points and drastically reduced the Expected Calibration Error (ECE).
- Real Search Improvements: When integrated into an actual end-to-end kernel search loop, the surrogate allowed the system to explore 4x more candidates under the same GPU budget, matching or beating the baseline on 4 out of 6 optimization tasks.
Limitations and Future Work
- Noisy "Discovery Moments": While the surrogate is better than chance at identifying breakthrough mutations (where a child kernel is significantly faster than its parent), it still suffers from high false-positive rates, meaning physical GPU verification remains necessary for confirmation.
- Coarse Binning: The model currently predicts discrete speedup ranges rather than continuous, fine-grained performance metrics.
- Scope of Optimization: The current approach focuses on relative performance against a reference rather than predicting absolute execution times from scratch.
Summary updated