# Guided Generation of Linux Kernel Semantic Patches with Small Local Language Models

[Canonical reading](https://escapemeridian.com/readings/guided-generation-of-linux-kernel-semantic-patches-with-small-1164f544)

Mohanned Ahmed asks whether small open language models running on a laptop can help convert Linux kernel API changes into Coccinelle semantic patches, rules used for tree-wide code changes. The approach turns earlier human conversions into examples: scripts split them into change variants, the model writes a rule for each variant, and feedback comes from applying rules to examples. Deterministic components repair SmPL syntax and generalise driver-specific names; a compile critic repairs or rejects rules whose output does not build. In a pre-registered test of 7 migrations and 122 held-out driver conversions, a conversion counted as solved only if it matched the human fix and compiled. Ahmed reports that guided Qwen2.5-Coder 7B solved 35.3 conversions on average over three seeds, compared with 1.0 when prompted directly. Spinfer solved 41 and a frontier LLM agent 66. The local model solved fewer than Spinfer, but its rules were more precise on this test: 0.74 of files they changed were solved, versus 0.55 for Spinfer and 0.70 for the frontier agent. The results describe this task and test set; they do not establish performance on other migrations. Ahmed says the code, prompts, model responses and results are released.

Headline and summary by Escape Meridian, prepared by Luna from the attributed source. A source check is not independent confirmation of the source’s claims.

## Original source

arXiv cs.AI · Article

Original source date: Nov 12, 2026 (2026-11-12).

Date basis: Date basis not provided.

Added to Escape Meridian: 2026-11-13T10:46:40.110Z. First observed: 2026-11-13T07:39:44.971Z. Retrieved: 2026-11-13T10:32:09.708Z.

- [Guided Generation of Linux Kernel Semantic Patches with Small Local Language Models](https://arxiv.org/abs/2611.16215)

## Limits

The evaluation covers 7 migrations and 122 held-out driver conversions; the reported results do not establish performance on other migrations. The source describes results for the tested models and setup, not a general comparison across all small local language models.


## Open question

How would the reported results change on Linux kernel migrations beyond the 7 included in this test?


## Source-stated

Ahmed evaluates guided code generation on 7 migrations and 122 held-out driver conversions, counting a conversion as solved only when the output matches the human fix and compiles.

> a pre-registered test set of 7 migrations whose new APIs appeared after the training cutoffs of all three models

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source-stated

In this evaluation, Qwen2.5-Coder 7B solved 35.3 conversions on average over three seeds with the framework, compared with 1.0 when prompted directly.

> Qwen2.5-Coder solves 35.3 conversions on average over three seeds (range 32-41), against 1.0 when prompted directly

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source-stated

The local model solved fewer conversions than Spinfer, while a greater share of the files it changed were solved in the test.

> 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

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source-stated

The compile critic removes outputs that match the human fix but do not build.

> the compile critic removes every output that matches the human fix but does not build.

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source and contributor context

Ahmed, Mohanned · Article author

These are credits stated by the source; they do not establish a profile match or authorship of every passage.


## Source media

No suitable media was found by the supported page extraction.


## Terms and references

Reference context selected by Escape Meridian; separate from source evidence. Entity mentions do not establish authorship, involvement or endorsement.


## API

An application programming interface: a defined way for software to request data or actions from another system.

- [Definition reference](https://developer.mozilla.org/en-US/docs/Glossary/API)

## Large language model

A language model with many learned numerical settings, used to process and generate language.

- [Definition reference](https://developers.google.com/machine-learning/glossary#large-language-model)

## Held-out set

Data kept aside during training and used only to test how well a model works on examples it has not seen.

- [Definition reference](https://developers.google.com/machine-learning/glossary#holdout-data)

## arXiv

arXiv is a research manuscript repository where authors share papers that may not yet have been peer reviewed.

- [Explore this context](/entities/arxiv)
- [Reference](https://arxiv.org/)
- [Reference](https://info.arxiv.org/help/api/index.html)

## Editorial provenance

Version 1. Publication ID: 76b37e9d-3478-4e37-81a0-366eb9fc23b7.

Prepared by gpt-6-luna; grounding review by gpt-6-luna.

Source check: uncertain by anthropic/claude-opus-5.5 on 2026-11-13T10:46:40.110Z. This checks fidelity to the source, not whether its claims are independently true.

Editorial selection: accept; reasons: material\_development.

Observation: 24aa5950d83440a4b3dc47747e922dbb8a6283cc25e040d8ccf3ab4e924e0117. Source text hash: 165f340828c1a8f7a843768ee6ba3e6e1f794e858df61f51bfbdfcdf2b1197b8.


## Revision and source-check history

### Version 1 — 2026-11-13T10:46:40.110Z

Mohanned Ahmed asks whether small open language models running on a laptop can help convert Linux kernel API changes into Coccinelle semantic patches, rules used for tree-wide code changes. The approach turns earlier human conversions into examples: scripts split them into change variants, the model writes a rule for each variant, and feedback comes from applying rules to examples. Deterministic components repair SmPL syntax and generalise driver-specific names; a compile critic repairs or rejects rules whose output does not build. In a pre-registered test of 7 migrations and 122 held-out driver conversions, a conversion counted as solved only if it matched the human fix and compiled. Ahmed reports that guided Qwen2.5-Coder 7B solved 35.3 conversions on average over three seeds, compared with 1.0 when prompted directly. Spinfer solved 41 and a frontier LLM agent 66. The local model solved fewer than Spinfer, but its rules were more precise on this test: 0.74 of files they changed were solved, versus 0.55 for Spinfer and 0.70 for the frontier agent. The results describe this task and test set; they do not establish performance on other migrations. Ahmed says the code, prompts, model responses and results are released.

## Original source

arXiv cs.AI · Article

Original source date: Nov 12, 2026 (2026-11-12).

Date basis: Date basis not provided.

Added to Escape Meridian: 2026-11-13T10:46:40.110Z. First observed: 2026-11-13T07:39:44.971Z. Retrieved: 2026-11-13T10:32:09.708Z.

- [Guided Generation of Linux Kernel Semantic Patches with Small Local Language Models](https://arxiv.org/abs/2611.16215)

## Limits

The evaluation covers 7 migrations and 122 held-out driver conversions; the reported results do not establish performance on other migrations. The source describes results for the tested models and setup, not a general comparison across all small local language models.


## Open question

How would the reported results change on Linux kernel migrations beyond the 7 included in this test?


## Source-stated

Ahmed evaluates guided code generation on 7 migrations and 122 held-out driver conversions, counting a conversion as solved only when the output matches the human fix and compiles.

> a pre-registered test set of 7 migrations whose new APIs appeared after the training cutoffs of all three models

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source-stated

In this evaluation, Qwen2.5-Coder 7B solved 35.3 conversions on average over three seeds with the framework, compared with 1.0 when prompted directly.

> Qwen2.5-Coder solves 35.3 conversions on average over three seeds (range 32-41), against 1.0 when prompted directly

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source-stated

The local model solved fewer conversions than Spinfer, while a greater share of the files it changed were solved in the test.

> 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

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source-stated

The compile critic removes outputs that match the human fix but do not build.

> the compile critic removes every output that matches the human fix but does not build.

- [Supporting source](https://arxiv.org/abs/2611.16215)

## Source and contributor context

Ahmed, Mohanned · Article author

These are credits stated by the source; they do not establish a profile match or authorship of every passage.


## Source media

No suitable media was found by the supported page extraction.


## Terms and references

Reference context selected by Escape Meridian; separate from source evidence. Entity mentions do not establish authorship, involvement or endorsement.


## API

An application programming interface: a defined way for software to request data or actions from another system.

- [Definition reference](https://developer.mozilla.org/en-US/docs/Glossary/API)

## Large language model

A language model with many learned numerical settings, used to process and generate language.

- [Definition reference](https://developers.google.com/machine-learning/glossary#large-language-model)

## Held-out set

Data kept aside during training and used only to test how well a model works on examples it has not seen.

- [Definition reference](https://developers.google.com/machine-learning/glossary#holdout-data)

## arXiv

arXiv is a research manuscript repository where authors share papers that may not yet have been peer reviewed.

- [Explore this context](/entities/arxiv)
- [Reference](https://arxiv.org/)
- [Reference](https://info.arxiv.org/help/api/index.html)

## Editorial provenance

Version 1. Publication ID: 76b37e9d-3478-4e37-81a0-366eb9fc23b7.

Prepared by gpt-6-luna; grounding review by gpt-6-luna.

Source check: uncertain by anthropic/claude-opus-5.5 on 2026-11-13T10:46:40.110Z. This checks fidelity to the source, not whether its claims are independently true.

Editorial selection: accept; reasons: material\_development.

Observation: 24aa5950d83440a4b3dc47747e922dbb8a6283cc25e040d8ccf3ab4e924e0117. Source text hash: 165f340828c1a8f7a843768ee6ba3e6e1f794e858df61f51bfbdfcdf2b1197b8.


### uncertain — 2026-11-13T10:46:40.110Z — anthropic/claude-opus-5.5

Publication: 76b37e9d-3478-4e37-81a0-366eb9fc23b7

attribution — pass: Mohanned Ahmed is the sole listed author on the arXiv page. The draft consistently attributes the question, method and results to him with phrases such as 'Ahmed reports' and 'Ahmed says'. It does not present his results as independently established.

> Authors:Mohanned Ahmed

summary — uncertain: The numbers are faithful, but a non-specialist lacks the motivating stake. Repair: add that hundreds of drivers are converted by hand over months when an API changes. The draft also drops the condition that the new APIs appeared after all three models' training cutoffs. Repair: add one clause. It omits the finding that Llama 3.1 8B and Gemma 3 4B stayed weak (at most 12 solved). Repair: add one sentence. Spinfer, SmPL and 'seeds' are used without plain explanation; they need tooltips or brief glosses.

> 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.

date — pass: The originalPublished date of 2026-11-12 matches the v1 submission date on the arXiv page. The feed date of 2026-11-13 is later and is correctly not used.

> \[Submitted on 12 Nov 2026\]

support — pass: Each claim's excerpt appears verbatim in the abstract and supports the claim. The figures are reported accurately: 35.3 versus 1.0, Spinfer 41, the frontier agent 66, and precision of 0.74, 0.55 and 0.70. The limitations correctly confine the results to this test set and these models. The question follows from the evidence and does not assert an answer. No unsupported benefits or costs are implied.

> 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.

media — pass: The selected media is the verified arXiv abstract page for this paper. It is the direct original source and the most useful link available.

## Recorded references

Explicit citations in public readings and public file attachments to this reading. Shared topics are not citations. Other artifact types need an explicit reference adapter.

No public references recorded here yet.

[Reference data (JSON)](/readings/1164f544e3fbea0eb80b1a868d11154297e29c706b0ee6984005b49387935038/references.json)

## Corrections and challenges

[Send a correction or an opposing source](https://escapemeridian.com/corrections/)

[JSON record](https://escapemeridian.com/readings/guided-generation-of-linux-kernel-semantic-patches-with-small-1164f544.json)
