TL;DR
AdaExplore is a novel LLM agent framework designed to automatically generate and optimize high-performance GPU kernels (such as Triton code) without any model fine-tuning. By combining a cross-task "skill memory" distilled from execution failures with a diversity-preserving tree search, it achieves up to 3.11× speedups over standard baselines and can even outperform expert-written CUDA kernels.
What Problem Does This Paper Address?
Writing high-performance GPU kernels in domain-specific languages like Triton is notoriously difficult, even for state-of-the-art LLMs. The authors identify two core bottlenecks that cripple standard code-generation approaches:
- The Feasibility Bottleneck: The correctness boundary for low-level code is razor-thin. Minor mistakes in syntax, memory alignment, or parallelization cause immediate compilation or runtime crashes, leaving the model with a very narrow "feasible region" to explore.
- The Locality Bottleneck: The performance landscape is highly non-linear and combinatorial. Standard iterative refinement (making small local edits) easily gets trapped in local optima because meaningful performance gains often require coordinated, sweeping structural changes.
Furthermore, existing LLM coding agents treat every optimization task in isolation, meaning they fail to accumulate and reuse knowledge about common language pitfalls across different problems.
Methods
AdaExplore addresses these challenges through a two-stage framework: Adapt and Explore.
- Adapt (Failure-Driven Adaptation): Before tackling target benchmarks, the framework uses mutation-based prompting to synthesize diverse training programs. The agent attempts to write kernels for these programs, intentionally exposing itself to edge cases. When a kernel fails, an LLM judge analyzes the execution feedback and extracts a concise constraint rule. High-frequency failure patterns are compiled into a cross-task Skill Memory that is injected into system prompts during inference to keep the model within the feasible region.
- Explore (Diversity-Preserving Search): Instead of a single linear chain of edits, AdaExplore organizes candidate kernels into a search tree using a UCT-style Monte Carlo Tree Search (MCTS) rule. The agent balances exploration and exploitation by alternating between two actions: Small steps (localized patch-based tuning) and Large steps (complete structural regeneration from scratch).
Datasets
The authors evaluated AdaExplore across multiple benchmarks:
- KernelBench: The primary testbed. Level-1 tasks (single operators) were used for synthetic data generation, while Level-2 (simple fused kernels) and Level-3 (complex model-level workloads like ResNet and LSTM) were used for evaluation.
- FlashInfer-Bench: Real-world LLM serving workloads (e.g., Fused Add RMSNorm, GEMM, Grouped-Query Attention) featuring production-level input shapes captured from models like Llama-3.1-8B.
- TritonBench-T: Used to evaluate how well the learned skill memory generalizes to entirely different benchmarks.
Key Insights and Ideas
- Failures are highly redundant: From 200 synthesized tasks yielding 1,178 raw error experiences, semantic deduplication and frequency filtering compressed the data down to just 78 high-frequency rules. This proves that LLM failures in low-level programming concentrate around a small, predictable set of recurring constraints.
- Skill memory is model-agnostic: A skill memory harvested using GPT-5-mini successfully boosted the performance of entirely different models, including GPT-5, Claude-4.6-Opus, and Qwen3-Coder-Next.
- Structural regeneration prevents code bloat: Traditional iterative refinement tends to continuously append patches, causing the code size to expand over time and exhaust the LLM's context window. AdaExplore’s "Large Step" action resets kernel size by rewriting from scratch, keeping context lengths flat and efficient over long search horizons.
Key Results
- Substantial Speedups: Using GPT-5-mini as the base model, AdaExplore achieved a 3.11× speedup on KernelBench Level-2 and a 1.62× speedup on Level-3 within a 100-step budget.
- Outperforming Human Experts: On FlashInfer-Bench's memory-bound Fused Add RMSNorm kernel, AdaExplore discovered a hardware-efficient implementation that achieved a 1.75× speedup over the expert-written CUDA baseline by performing fused operations entirely within registers.
- Drastic Accuracy Boosts for Small Models: On the small open-weight model Qwen3-Coder-Next (3B active parameters), adding the skill memory skyrocketed single-pass correctness from a meager 7% to 91%.
Limitations and Future Work
- Compute-Bound Kernels Remain Challenging: While AdaExplore dominates on memory-bound tasks, it still struggles against heavily engineered, compute-intensive baselines like GEMM (achieving only 0.42× of cuBLAS performance).
- Hardware-Specific Instructions: For advanced architectures like the NVIDIA B200, expert kernels leverage highly specialized mechanisms (e.g., Blackwell QMMA instructions, warp-specialization). AdaExplore cannot currently infer these advanced strategies purely from execution feedback.
- Future Directions: The authors note that incorporating explicit hardware-specific knowledge and reference implementation skills into the agent's memory is a crucial next step for optimizing compute-bound workloads.
Summary updated