Manuscript Offprint

arXiv:2610.27588

Beyond Experience: Knowledge-Guided Evolution for NPU Kernel Generation

Xi Chen, Ming Shen, Haotian Yan, Ruoyu Sun, Tianjun Yao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

LLM agents have become capable kernel engineers on mainstream GPU stacks, but they struggle on emerging accelerators such as Ascend NPUs, whose programming model is barely represented in pretraining data. Recent NPU agents address this gap largely through experience: they accumulate memory from their own generation and optimization trials and reuse it on later tasks. We argue that experience alone is not enough for kernel generation. An agent can only remember what it has tried, and it rarely tries a mechanism it does not know. As a result, such memory offers little help when a new operator calls for a different mechanism, and even familiar operators raise unseen situations as optimization proceeds. We present ASCENDEVOLVE, which grounds every step of an evolutionary kernel search in a large external knowledge base built from platform documentation, toolkit headers, and operator repositories. Because this corpus far exceeds any context window, ASCENDEVOLVE indexes it and routes each agent to a small, task-specific slice of evidence instead of the corpus itself. The retrieved knowledge seeds diverse implementation strategies, guides repair when a candidate fails, and constrains how strong candidates are recombined. On 53 Ascend C operators from CANN-Bench spanning four difficulty levels, ASCENDEVOLVE achieves an overall score of 71.39, improving over Reflexion and OpenEvolve by 11.6% and 17.2%.

1 INTRODUCTION

Trial-and-error agents learn from the programs they actually generate and evaluate. As a result, a memory built from past trials is naturally limited by what the agent has explored: it can reuse and refine discovered mechanisms, but does not guarantee access to mechanisms that have never appeared in its search. This motivates knowledge beyond self-generated experience.

Recent work has demonstrated substantial progress in LLM-based kernel generation and optimization for GPUs. On CUDA and related programming stacks, iterative workflows that combine generation with compilation, execution, and profiling feedback can progressively improve both correctness and performance (Ouyang et al., 2025; Zhang et al., 2025; Wei et al., 2025; Baronio et al., 2025). These results establish iterative execution feedback as an effective ingredient for kernel optimization on mature GPU ecosystems. The problem becomes considerably more challenging on specialized accelerator programming stacks for which general-purpose LLMs have demonstrated substantially lower capability—a difficulty well documented for domain-specific programming languages more broadly (Joel et al., 2025). On Huawei's Ascend NPU (Liao et al., 2021), recent work reports that general-purpose LLMs achieve very low success rates on complex kernel-generation tasks without domain-specific adaptation (Cao et al., 2026).

Recent systems have addressed this difficulty in part by accumulating reusable experience from previous generation and optimization trajectories. Value-driven memory substantially improves functional correctness over zero-shot prompting (Zheng et al., 2026), and experience mined from optimization trajectories yields consistent speedups on existing operators (Wu et al., 2026; Zhang

Figure

Figure 1: Three situations in which an agent’s own trials offer no usable precedent while primary platform sources do: (a) a mechanism family absent from past trials, (b) a first-time failure midway through optimization, and (c) a motif carried across toolkit versions. Illustrative, not measured.

et al., 2026). These results provide strong evidence that reusable experience can substantially improve both feasibility and optimization efficiency. However, these systems necessarily construct their reusable evidence from trajectories that the agent has already proposed and evaluated. This suggests a complementary limitation: the usefulness of experience depends not only on how much is retained, but also on what the agent has managed to explore.

We refer to this coverage constraint as experience closure: the reusable evidence in a self-generated memory is derived from trajectories the agent has actually proposed and evaluated. As a result, such memory may provide limited guidance for mechanisms that have not yet appeared in those trajectories—particularly on platforms where the model’s familiarity with the programming stack is limited to begin with.

Figure 1 shows three settings where self-generated experience provides limited guidance:

(i) Coverage gap. An operator may require a mechanism family that no previous trajectory has explored; since such a mechanism is rarely proposed, it is also unlikely to be recorded.

(ii) Repair gap. A familiar operator may encounter, midway through optimization, a constraint that has not appeared before—compiler diagnostics often identify the violated constraint without directly providing a valid alternative implementation.

(iii) Validity gap. Experience collected under one software or hardware configuration may not transfer unchanged to another.

Self-generated experience is not the only source of implementation evidence. Accelerator ecosystems expose additional information through programming guides, API definitions, installed headers, reference implementations, and vendor-maintained operator libraries (NVIDIA Corporation, 2017; Zhao et al., 2021). These sources can provide mechanism and constraint information before the agent has encountered the corresponding trajectory itself. We therefore view primary platform knowledge and execution experience as complementary: platform knowledge can broaden the set of mechanisms the agent considers, while execution experience provides empirical evidence about which candidates are correct and efficient on the target device (Wen et al., 2026). Our goal is not to replace trial-and-error with retrieval, but to inform it.

We present ASCENDEVOLVE, a system that grounds every stage of an evolutionary kernel search in primary platform sources. The design follows three principles:

① Hierarchical and version-aware. Platform information is organized hierarchically and with version awareness: a shared, versioned corpus of documentation, installed headers, and vendor operator libraries is distilled into per-operator evidence before search begins, avoiding repeated processing of a large heterogeneous corpus.

② Demand-driven retrieval. Rather than placing the corpus in context, ASCENDEVOLVE routes each concrete implementation or optimization question to a small set of relevant sources.

③ Bidirectional interaction. Retrieved platform evidence and execution experience interact bidirectionally: retrieved mechanisms seed candidate implementations, each trial records an empirical verdict on the knowledge it was grounded in, and outcomes influence subsequent retrieval.

Because retrieved evidence may suggest multiple plausible implementation mechanisms rather than a single canonical solution, ASCENDEVOLVE maintains several mechanism-distinct implementation lines and progressively selects and recombines promising design choices through evolutionary search.

On 53 Ascend C operators spanning four difficulty levels, ASCENDEVOLVE achieves an overall score of 71.39, improving over Reflexion (Shinn et al., 2023) and OpenEvolve (Sharma, 2025) by 11.6% and 17.2%, respectively, with the largest gains on the operator categories where prior agents have the lowest correctness coverage. On L4 operators, ASCENDEVOLVE reaches 35.0% correctness coverage compared with 4.38% for Reflexion and 1.25% for OpenEvolve. Removing the knowledge base nearly halves the L3 score, showing how platform knowledge helps generate correct kernels. Our contributions are as follows:

① Experience closure. We identify experience closure—a coverage limitation of experience-driven kernel agents on platforms outside the model’s familiarity—and characterize three settings where it is most pronounced.

② Method. We propose ASCENDEVOLVE, which couples primary platform knowledge with procedural experience through hierarchical, demand-driven retrieval and bidirectional feedback within an evolutionary search that maintains mechanism-diverse implementation lines.

③ Evaluation. We evaluate on 53 Ascend C operators from CANN-Bench (Gao et al., 2026) and show that knowledge grounding yields substantial gains, particularly on hard operators where experience-only methods have very low correctness coverage. We isolate the contribution of the knowledge base through ablation.

References (59)