Better kernels.
Before the
thinking ends.

Turn the waiting inside AI reasoning into useful work. SpecGen generates, validates, and profiles GPU kernels while the model is still thinking.

THE OPPORTUNITY

The bottleneck is the wait.

A kernel optimizer thinks, generates code, then asks the GPU to test it. Most of the time, the testing hardware is waiting. What if useful candidates arrived sooner?

BASELINESequential workflow
Reasoning & generationCheckProfile
GPU waiting
SPECGENWith speculative generation
ReasoningTime reclaimed ↗
Useful work starts earlier
THE MECHANISM

Don’t wait for the final thought.

Follow one idea as it becomes a candidate, a measurement, and a reason to stop early.

Start with a kernel.

A small GPU program. A clear correctness target. The model begins exploring how to make it faster.

torch.matmul(A, B)
Inspect the generated kernels ↗
Speculative generationIllustrative example
REASONING STREAMSPECULATIVE FORKSVALIDATEPROFILETHINKING · MAIN PATH IS LIVEA[batch, head, M, K] @ B[K, N]Map batch × head onto blocks32 × 32 tiles in shared memoryVectorize loads; check tail masks32 × 64 tile; reuse registersREASONING CONTINUES IN PARALLELK01shared_tile_32WRITING CUDA…QUEUEDcompile / run / diffQUEUEDspeedup vs. referenceK02vector_load_v2WRITING CUDA…QUEUEDcompile / run / diffQUEUEDspeedup vs. referenceK03register_tile_v3WRITING CUDA…QUEUEDcompile / run / diffQUEUEDspeedup vs. referenceFEEDBACK → CONTROLLERWaiting for profiling feedback.Correctness first. Performance feedback second.PREFIX SNAPSHOTK01 ← 3 design notesSELECT A KERNEL TO SEE ITS PREFIX
Click a fork to reveal the reasoning prefix it inherited.
KERNEL LAB

Inside real optimization runs.

Four KernelBench tasks, two optimization systems. Explore measured progress, captured reasoning, and the trade-off between time, tokens, and kernel quality.

Recorded runsDeepSeek-V4-FlashB30020 iterations per taskFixed GPU pools
Compare at
T = min(Tspec, Tbase)

* FP8The report identifies the 21.94× and 23.02× square-matmul kernels as e4m3 FP8. Its best excluding FP8 is 15.87×. Per-candidate precision is not available for the full trace.

Square matrix multiplication

level1/1_Square_matrix_multiplication_

Speedup relative to the KernelBench reference
Best kernel22.29×Baseline 5.95×
Active run time115.3 minBaseline 115.3 min
Equivalent tokens21.15MBaseline 4.80M
Profiler busy time51.9%Baseline 6.9%

At this cutoff, the kernel speed ratio is 3.75× and the token cost ratio is 4.41×. More candidates also consume more tokens.

Loading recorded trace…
UNDER THE HOOD

A good idea needs a good system.

SpecController creates the opportunity. ElasticScheduler makes sure it can reach the hardware.

An elastic GPU pool splits between validation and profiling. At each iteration boundary, queue pressure determines the next split.

The split changes at iteration boundaries, based on the previous iteration’s maximum queue lengths. Each request uses an available GPU in its assigned pool.

Validation favors the latest arrivals, with longer reasoning prefixes. Profiling serves the oldest validated candidate first.

Shared reasoning prefixes reuse KV state. Spare memory on validation and profiling GPUs can hold remote prefix caches.

THE IMPACT

Less waiting. More discovery.

System efficiency and kernel quality are different outcomes. SpecGen improves both.

REPORTED IN THE PAPER§8 ↗
1.68–1.82×

Faster optimization

End-to-end speedup over three baseline systems

1.58–1.98×

More profiling feedback

Relative increase in usable profiling feedback

88.2–96.1%

GPU resource busy time

Validation / profiling resource utilization

1.24–1.91×

Better final kernels

Relative improvement over baseline kernel performance

H200 experiments with GLM-5.1 and DeepSeek-V4-Pro. Ranges span the paper’s baseline comparisons; see §8 for workloads, budgets, and aggregation.

Give the GPU something to do.

Validation / profiling resource busy time · Table 4

BaselinesSpecGen
THE SHORT FILM

The whole idea, in one minute.

English narration, with English and Chinese captions.

THE PAPER

Go deeper.

Accepted at PPoPP 2027

SpecGen: Accelerating Agentic Kernel Optimization with Speculative Generation

Jihu Guo*, Sitian Lu*, Tenghui Ma, Wei Gao, Zhisheng Ye, Xingcheng Zhang, Dahua Lin

arXiv:2606.17518 · 2026 * Equal contribution

Read the paper↗
BibTeX
@article{guo2026specgen,
  title={SpecGen: Accelerating Agentic Kernel Optimization with Speculative Generation},
  author={Guo, Jihu and Lu, Sitian and Ma, Tenghui and Gao, Wei and Ye, Zhisheng and Zhang, Xingcheng and Lin, Dahua},
  journal={arXiv preprint arXiv:2606.17518},
  year={2026},
  note={Accepted at PPoPP 2027}
}