AdaExplore: Failure-Driven Adaptation and Diversity-Preserving Search for Efficient Kernel Generation

Weihua Du, Jingming Zhuo, Yixin Dong, Andre Wang He, Weiwei Sun, Zeyu Zheng, Manupa Karunaratne, Ivan Fox, Tim Dettmers, Tianqi Chen, Yiming Yang, Sean WelleckarXiv 2026

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:

  1. 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.
  2. 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.

Figure 1: Illustration of Kernel Optimization Bottlenecks. (a) Most generated kernels are invalid due to limited training coverage; (b) Kernel refinement may be stuck in local optima; (c) Our agent, AdaExplore, can learn skills from failures to prevent pitfalls, and apply diversity-preserving search for global optima exploration.

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).
Figure 2: Overview of AdaExplore for Kernel Runtime Optimization. The method has two stages: Adapt: it turns failures on synthesized tasks into a cross-task memory that helps generate correct kernels. Explore: it organizes candidate kernels as a tree and alternates between local refinement and regeneration to search for higher-performing solutions.

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.
Cross-Task Skill Memory Statistics
  • 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

BibTeX
@misc{du2026adaexplore,
  author = {Weihua Du and Jingming Zhuo and Yixin Dong and Andre Wang He and Weiwei Sun and Zeyu Zheng and Manupa Karunaratne and Ivan Fox and Tim Dettmers and Tianqi Chen and Yiming Yang and Sean Welleck},
  title = {{AdaExplore: Failure-Driven Adaptation and Diversity-Preserving Search for Efficient Kernel Generation}},
  year = {2026},
  eprint = {2604.16625},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.16625},
}
Figure