[Paper Review] Towards Cold-Start Drafting and Continual Refining: A Value-Driven Memory Approach with Application to NPU Kernel Synthesis
EvoKernel frames NPU kernel synthesis as a memory-based reinforcement learning task, using value-driven retrieval to draft feasible kernels and continually refine them for latency gains, improving frontier-model performance from 11.0% to 83.0% correctness and achieving median 3.60× speedups.
Deploying Large Language Models to data-scarce programming domains poses significant challenges, particularly for kernel synthesis on emerging Domain-Specific Architectures where a "Data Wall" limits available training data. While models excel on data-rich platforms like CUDA, they suffer catastrophic performance drops on data-scarce ecosystems such as NPU programming. To overcome this cold-start barrier without expensive fine-tuning, we introduce EvoKernel, a self-evolving agentic framework that automates the lifecycle of kernel synthesis from initial drafting to continual refining. EvoKernel addresses this by formulating the synthesis process as a memory-based reinforcement learning task. Through a novel value-driven retrieval mechanism, it learns stage-specific Q-values that prioritize experiences based on their contribution to the current objective, whether bootstrapping a feasible draft or iteratively refining latency. Furthermore, by enabling cross-task memory sharing, the agent generalizes insights from simple to complex operators. By building an NPU variant of KernelBench and evaluating on it, EvoKernel improves frontier models' correctness from 11.0% to 83.0% and achieves a median speedup of 3.60x over initial drafts through iterative refinement. This demonstrates that value-guided experience accumulation allows general-purpose models to master the kernel synthesis task on niche hardware ecosystems. Our official page is available at https://evokernel.zhuo.li.
Motivation & Objective
- Address the data-scarce cold-start problem in NPU kernel synthesis where public data is limited and expert demonstrations are scarce.
- Develop a memory-based RL framework that automates from initial drafting to continual refining without fine-tuning model weights.
- Enable cross-task memory sharing to transfer insights from simple to complex operators on niche hardware.
Proposed method
- Formulate kernel synthesis as a Memory-based MDP (M-MDP) where a generator samples kernels conditioned on retrieved context.
- Introduce a value-driven retrieval policy that learns stage-specific Q-values to select memory items for drafting (Q1) and refining (Q2).
- Maintain a dynamic, self-evolving memory M that stores seeds, traces, and best practices; update memory via Monte-Carlo (MC) style value iteration without weight updates.
- Implement a two-stage pipeline: Cold-Start Drafting to obtain a feasible kernel, then Continual Refining to reduce latency using optimization traces and profiler signals.
- Use a multi-gate verifier to provide structured feedback (hack, compile, correctness, latency) and define a feasibility gate gfeas for progression.
- Demonstrate cross-task transfer by sharing memory across operator classes and backends (Ascend C, CUDA) and evaluate on KernelBench, Attention Set, and mHC kernels.
Experimental results
Research questions
- RQ1Can a memory-based RL agent bootstrap kernel synthesis in data-scarce hardware ecosystems without expert demonstrations or fine-tuning?
- RQ2Does a value-driven retrieval mechanism improve cross-task generalization and efficiency compared to similarity-based or heuristic retrieval in cold-start kernel synthesis?
- RQ3To what extent does cross-task memory sharing accelerate learning and improve performance on harder operator blocks and new backends?
- RQ4How well does the EvoKernel framework transfer from KernelBench to Attention Set and mHC kernels on Ascend and CUDA backends?
Key findings
- EvoKernel boosts frontier-model correctness on Ascend C kernel tasks from 11.0% to 83.0%.
- Median within-task latency improvement during refining is 3.60× over the initial feasible draft.
- Value-driven retrieval outperforms heuristic retrieval in correctness and compilation, especially on harder operators.
- Cross-task memory sharing yields substantial gains, e.g., Level 2 compilation rate from 55.0% to 100% and accuracy from 3.0% to 76.0% with GPT-5.2.
- Memory transfers across backbones (GPT-5.2 to weaker models) significantly improve compilation and correctness (e.g., DeepSeek: 26%→80% CR; 6%→58% Acc).
- The approach generalizes to Attention Set and mHC kernels, achieving 100% compilation and near 78–100% correctness on CUDA and Ascend variants.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.