NKI-Agent: Domain-Specific Fine-Tuning and Agentic Tool Use for Neuron Kernel Generation
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Recent agentic approaches to LLM-based kernel generation have achieved impressive results on CUDA. For emerging AI accelerators such as AWS Trainium and Inferentia, automated kernel generation and optimization remain largely unaddressed. Writing kernels for these chips via the Neuron Kernel Interface (NKI) is particularly challenging: developers must navigate a multi-engine architecture, tile-based programming, and explicit data movement across multi-level memory hierarchy. Moreover, no publicly-available training data, benchmarks, or tool-augmented agents exist for this domain. We introduce NKI-Agent, the first system combining domain-specific supervised fine-tuning (SFT) with a compile-verify-fix agent loop for NKI kernel generation. We adapt the existing CUDA-Agent framework to Neuron hardware, curate 6,000 NKI kernel generation tasks for training, and construct NKIBench, a 250-task benchmark across three difficulty levels. Evaluated on real Trn1 hardware, NKI-Agent with Claude Opus 4.8 and a rank-aware system prompt achieves a 77.3% pass rate on the 150-task NKIBench. We show that tool use is critical: Opus 4.8 scores 6% in single-shot mode without agent tools. On a 60-task subset, we show that an SFT-trained Qwen3-Coder-30B-A3B achieves 25.0% pass rate at 1/100th the cost, outperforming Claude Sonnet 4 (15.0%). We also report that Group Relative Policy Optimization (GRPO) with binary compilation reward fails to improve over SFT, providing guidance on reward design for RL-based kernel generation.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 9 of its 19 references that are in the map. First posted on arXiv 5 Jul 2026.
Builds on
9 of 19 references.
Closest ancestors · 2
Same direction, newest first
- 2026CUDA Agent: Large-Scale Agentic RL for High-Performance CUDA Kernel Generation27 Feb
- 2025AccelOpt: A Self-Improving LLM Agentic System for AI Accelerator Kernel Optimization19 Nov
Other references · 7
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2020Unsupervised Translation of Programming Languagescited by 263
- 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 197
- 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 99
- 2025TritonBench: Benchmarking Large Language Model Capabilities for Generating Triton Operatorscited by 75
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2025CudaForge: An Agent Framework with Hardware Feedback for CUDA Kernel Optimization
- 2026AgenticCANN: Automated Ascend C Operator Generation via Knowledge-Augmented Agentic Evolution
- 2026KernelGenBench: Can LLMs and Agents Write Efficient Kernels Across Operator Sources and Hardware Platforms?
- 2026KernelCraft: Benchmarking for Agentic Close-to-Metal Kernel Generation on Emerging Hardware
- 2025AKG kernel Agent: A Multi-Agent Framework for Cross-Platform Kernel Synthesis
- 2026Kernel Forge: An Agent Harness for LLM-based Generation and Optimization of CUDA Kernels
- 2026AscendKernelGen: A Systematic Study of LLM-Based Kernel Generation for Neural Processing Units
- 2026EGG: An Expert-Guided Agent Framework for Kernel Generation