Coding agents beat llama.cpp kernels on Arm CPUs but stumble on SME2
A new benchmark from Carnegie Mellon and Arm tests AI coding agents on 99 real CPU routines across four generations of Arm chip features. Agents do well on familiar vector instructions and poorly on Arm's newer matrix instructions.
scienceunderway.com/articles/coding-agents-beat-llama-cpp-kernels-on-arm-cpus-but-stumble-on-sme2

AI illustrationWhat the study shows
The study asks a practical question. When a processor gains new instructions, can an AI coding agent learn to use them to write faster code? The focus is on kernels: small routines, such as matrix multiplication, that do most of the work when an AI model runs on a computer.
The authors, from Carnegie Mellon University and Arm, built a benchmark called KernelShift. It holds 99 kernels taken from four open-source projects: ncnn and llama.cpp, two widely used tools for running AI models, plus Arm's SIMD Loops and KleidiAI. Each task starts from plain, slow code. The agent has 40 tool calls to compile, test and inspect its code on a real Arm machine. The result is compared with the expert version from the original library. The paper is a preprint and has not been peer reviewed.
The tasks span four generations of Arm chip features. Neon and SVE handle many numbers at once in a row, a style called vector processing. SVE2 adds more operations of the same kind. SME2 is different: it adds dedicated matrix storage, called tiles, and needs a new way of writing code.
On SVE, tested on Amazon's Graviton3 cloud processor, the best agent systems beat the library code on three of four sources. The authors report up to about 2.7 times the speed of ncnn's kernels and about 1.9 times llama.cpp's. Every system was faster than the compiler-optimised starting code. On Arm's own hand-tuned KleidiAI kernels, no system caught up: the best, Claude Code with Claude Opus 4.8, reached about 70% of expert speed.
The move to SVE2 cost little. The move to SME2 hurt most agents. Three of five models fell to under half their SVE performance relative to the expert. Only Claude Opus 4.8 used the new matrix tiles in most of its final solutions. In a separate test on Apple's M4 chip, one model got slower when SME2 was made available, and none of its final kernels used the tiles.
The authors also swapped agent-written kernels into llama.cpp for two models, Qwen3.5-4B and Llama-3.1-8B-Instruct, on Graviton4. Prefill, the step where a model reads the prompt, ran about 1.3 to 1.6 times faster. Output quality was unchanged.
Our reading
In our reading, the headline speedups need care. The authors themselves show that agents gain most where the library code was weak. In one llama.cpp routine the expert version was barely faster than plain code, and agents beat it by about six times. Where the expert code was already strong, agents fell short. So a big number often says more about the reference than about the agent.
The more useful finding is the split between kinds of hardware change. When a new feature extends a familiar style, agents cope. When it demands a new mental model, as SME2's matrix tiles do, most agents fall back to older instructions or plain code. This matters because new chip features are exactly where expert-tuned software is scarce. That is where automated help would be most valuable, and it is where agents are weakest today.
A concrete example: a team deploying a small language model on Arm cloud servers could plausibly use an agent to write kernels tuned to its model's exact shapes, as the authors did for llama.cpp. A team targeting a new Apple or Arm chip with SME2 should not expect the same agent to unlock the matrix hardware without expert review.
The rest of this story is for members. Membership is free: read it at scienceunderway.com/articles/coding-agents-beat-llama-cpp-kernels-on-arm-cpus-but-stumble-on-sme2
Read the rest of this story
Membership is free. You get every article in full, and can save stories and follow topics.
We send a sign-in link, no password needed. Already a member? Sign inReadiness assessment
| Level | Status | Evidence |
|---|---|---|
| I Lab only | Met | Research benchmark and agent study with hardware-in-the-loop experiments. |
| II Benchmarked | Met | Results are reported on a 99-kernel benchmark against compiler baselines and expert libraries (ncnn, ggml, Arm SIMD Loops, KleidiAI) on Graviton3, Graviton4 and Apple M4, with seed variance and bootstrap confidence intervals. |
| III Open source | Met | The paper states that the benchmark code and evaluation scripts are at github.com/cmu-l3/kernel-shift and the dataset (144 kernel definitions) is on Hugging Face at l3lab/KernelShift. Source libraries are under BSD-3, MIT and Apache-2.0 licences. |
| IV In production | Not yet | No named organisation reports using the benchmark or the agent-written kernels in production. The end-to-end test is a research experiment on two models, though Arm staff are co-authors. |
What would move it up
Level 4 needs documented adoption by a named organisation: for example, agent-written kernels shipped in a release of llama.cpp or ncnn, or a vendor using KernelShift in its release testing. Independent replication on other hardware, and more SME2 kernels with expert references, would also strengthen the evidence.
The study
Shuaiwei Huang, Weihua Du, Allen Wu et al.. KernelShift: Benchmarking Kernel Optimization Across Evolving Hardware. arXiv, 22 November 2026. Read the paper
Notes
- Huang, Du, Wu et al. KernelShift: Benchmarking Kernel Optimization Across Evolving Hardware. arXiv preprint, November 2026. CC BY 4.0. Source
- Benchmark code and evaluation scripts. Source
- Dataset of 144 kernel definitions (the 99 evaluated kernels plus the end-to-end GEMMs). Source
- Project website. Source
- Exact figures, SVE on Graviton3 (Table 2): best geometric-mean Speedup@40 vs expert of 2.743 (ncnn, nanobot + GLM-5.3), 1.954 (llama.cpp, nanobot + GLM-5.3), 1.555 (SIMD Loops, Claude Code + Opus 4.8), 0.701 (KleidiAI, Claude Code + Opus 4.8). Speedup over the -O3 SVE starting code: 2.4 to 19.8x.
- Exact figures, adaptation (Tables 3 and 4): SME2-to-SVE ratios 0.42, 0.46, 0.41 for DeepSeek-V4-Pro, GLM-5.3, GPT-5.6-luna; 1.29 and 1.03 for Claude Opus 4.8 and Sonnet 4.6. SVE2-to-SVE ratios 0.94 to 1.05. Apple M4 ladder: 0.141 Neon only, 0.059 streaming SVE, 0.085 full SME2.
- Exact figures, end to end (Table 6): prefill 1.298 to 1.568x, decode 1.045 to 1.102x over llama.cpp's repacked i8mm path, 1 to 16 threads. Correlation of agent gain with expert strength: Spearman rho = -0.69 over 79 kernels.
- Readiness: level III, open source available. Code and dataset released; no documented production use by a named organisation.
Edited and signed by
Stefan PerdalEditor and publisher142 stories editedStefan read the study, set the readiness level and approved this story. An AI system found the paper and wrote the first draft.
How this was made
An AI model read the study and wrote this article in the structure Science Underway uses. An editor reviewed it and approved it for publication. Check the original study before you rely on the details.
How we workNo corrections


