Guided Generation of Linux Kernel Semantic Patches with Small Local Language Models
Not on the map. Why?
Abstract (arXiv)
When a Linux kernel API changes, hundreds of drivers are converted by hand over months, and the earlier conversions are reviewed examples for the later ones. We ask whether small open language models running on a laptop can turn such examples into Coccinelle semantic patches, the rules kernel maintainers already use for tree-wide changes. We adapt guided code generation to this task: the training examples are decomposed by script into a tree of change variants, the model writes one small rule per variant under feedback from applying it to the examples, deterministic components repair SmPL syntax and generalise driver-specific names, rules are composed greedily, and a compile critic repairs or rejects a rule whose output does not build. We evaluate on a pre-registered test set of 7 migrations whose new APIs appeared after the training cutoffs of all three models (Qwen2.5-Coder 7B, Llama 3.1 8B, Gemma 3 4B), with 122 held-out driver conversions, counting a conversion as solved only if the rule's output matches the human fix and compiles. With the framework, Qwen2.5-Coder solves 35.3 conversions on average over three seeds (range 32-41), against 1.0 when prompted directly; Spinfer solves 41 and a frontier LLM agent 66. The local model solves fewer conversions than Spinfer but its rules are the most precise on the test set (0.74 of the files they change are solved, against 0.55 for Spinfer and 0.70 for the frontier agent), and the compile critic removes every output that matches the human fix but does not build. The two general-purpose models stay weak even with guidance (at most 12 solved). All code, prompts, model responses and results are released.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Builds on 7 of its 15 references that are in the map. Submitted 12 Nov 2026.
Builds on
7 of 15 references.
References · 7
- 2024The Llama 3 Herd of Modelscited by 16,113
- 2025Gemma 3 Technical Reportcited by 2,058
- 2024Qwen2.5-Coder Technical Reportcited by 1,301
- 2025Guided Code Generation with LLMs: A Multi-Agent Framework for Complex Code Taskscited by 9
- 2025MigGPT: Harnessing Large Language Models for Automated Migration of Out-of-Tree Linux Kernel Patches Across Versionscited by 3
- 2025PortGPT: Towards Automated Backporting Using Large Language Modelscited by 3
- 2025LLM-Driven Kernel Evolution: Automating Driver Updates in Linuxcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026AdaExplore: Failure-Driven Adaptation and Diversity-Preserving Search for Efficient Kernel Generation
- 2026Outrunning LLM Cutoffs: A Live Kernel Crash Resolution Benchmark for All
- 2025Rethinking Kernel Program Repair: Benchmarking and Enhancing LLMs with RGym
- 2025Evolution of Kernels: Automated RISC-V Kernel Optimization with Large Language Models
- 2026Beyond Crash-to-Patch: Patch Evolution for Linux Kernel Repair
- 2026Refine After Generation: Toward Correct and Concise Patches in LLM-based Program Repair
- 2026CUDA-Harness: Harnessing Agentic CUDA Kernel Generation and Optimization from Natural Language
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generation