GPU Forecasters: Language Models as Selective Surrogates for Kernel Runtime Optimization

Zaid Khan, Justin Chih-Yao Chen, Jaemin Cho, Elias Stengel-Eskin, Mohit BansalarXiv 2026 · arXiv

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.

  1. 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).
  2. 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.
  3. 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).
Figure 1: Left: LLM-driven kernel optimizers use physical GPU measurements as feedback for candidate kernels, making search costly when many candidates must be compiled, executed, and profiled. Right: a learned surrogate forecasts execution outcomes for candidate kernels and flags uncertain cases for real GPU measurement. This motivates using the surrogate where its forecasts are reliable and reserving device measurement for candidates where the forecast is uncertain.

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.
Surrogate performance in a real kernel search loop across six 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

Abstract

GPU kernels are the workhorse of modern deep learning, and optimizing them (via evolutionary search or coding agents) usually requires repeated measurement on target hardware. While these measurements provide the ground-truth signal necessary for kernel search, they are costly, because each evaluation of a kernel requires compilation and repeated execution on a GPU. As improvements in LLM inference reduce the cost of writing novel kernels and LLM-driven searches scale to large search budgets, on-device evaluation becomes a bottleneck. To address this, we study how LLMs can serve as selective GPU surrogates for kernel evaluation, by forecasting the performance of proposed kernels. A useful surrogate should be accurate, and it should be selective, by knowing when it could be wrong, and deferring to the GPU. To evaluate surrogates, we measure whether their forecasts are accurate, calibrated, and practically useful for recovering fast kernels under limited GPU-measurement budgets. Next, we study whether reinforcement learning can improve forecast accuracy and confidence calibration. Our experiments demonstrate that LLMs can accurately forecast relative kernel performance, that their utility can be improved through reinforcement learning. Used inside a kernel search, the surrogate lets the search consider several times as many candidates under the same GPU evaluation budget, and that leads to finding faster kernels than an equal-budget baseline. These results suggest that LLMs can play a broader role in kernel optimization, by acting as virtual models of a GPU rather than solely as kernel generators for search.
BibTeX
@misc{khan2026gpu,
  author = {Zaid Khan and Justin Chih-Yao Chen and Jaemin Cho and Elias Stengel-Eskin and Mohit Bansal},
  title = {{GPU Forecasters: Language Models as Selective Surrogates for Kernel Runtime Optimization}},
  year = {2026},
  eprint = {2605.31464},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.31464},
}
Figure