KLineage: Recovering the Missing When of Kernel Optimization by Deoptimizing Experts

Shuoming Zhang, Qiuchu Yu, Ruiyuan Xu, Chenjing Zhang, Junjie Peng +9 more
5/27/2026
1 citation
cs.AI

Official code: ict-agent/klineage (1 star, Python, last commit 2026-10-21).

Abstract

LLM-based agents are increasingly used to generate GPU kernels, but they often struggle to determine when an optimization is sound because its required code state and dependencies are implicit in expert implementations. We introduce KLineage, which learns this missing "when" knowledge from expert kernels: instead of relying on forward rollouts, KLineage walks expert implementations backward through validation-gated simplifications and reverses each accepted step into a reusable optimization skill.

Show full abstract

Each skill records not only the optimization intent, but also when to apply the optimization technique, including where it applies in code, what conditions made it valid, what effect it has, and what failures its assumptions avoid. A downstream LLM materializes these skills on new code surfaces under the same compile/correctness/profile gate. This guidance on when to apply each optimization can help downstream models to generate higher-performance kernels. On five expert workloads across two NVIDIA architectures, these lineage-derived skills serve as an effective optimization curriculum, exceeding recent memory-based LLM-kernel baselines in both final kernel quality and optimization efficiency under the same fixed budget. We also demonstrate that the KLineage framework extends beyond NVIDIA GPUs to Ascend NPUs. Our code is publicly available at https://github.com/ict-agent/klineage.

View on arXivView PDF

Code Implementations(1)

ict-agent/klineageOfficial100%

An agentic harness for accelerator kernel generation and optimization, with reusable skills extracted from expert implementations.

10Python, CudaSep 5, 20261 months ago
ascendcudahipkernel-generationkernel-optimization+2 more

Similar Papers

Cite this paper

@article{zhang2026klineage,
  title  = {KLineage: Recovering the Missing When of Kernel Optimization by Deoptimizing Experts},
  author = {Shuoming Zhang and Qiuchu Yu and Ruiyuan Xu and Chenjing Zhang and Junjie Peng and Zhicheng Xie and Yangyu Zhang and Xiyu Shi and Ying Liu and Guangli Li and Xiaobing Feng and Huimin Cui and Xingjun Zhang and Jiacheng Zhao},
  year   = {2026},
  eprint = {2605.28213},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.28213v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.28213.svg)](https://codeofpaper.com/paper/2605.28213)

Discussion