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

- Category: Code
- Readiness level: III (Open source) on Science Underway's four-step scale, as proposed
- Published: 2026-11-24
- Editor: Stefan Perdal
- URL: https://scienceunderway.com/articles/coding-agents-beat-llama-cpp-kernels-on-arm-cpus-but-stumble-on-sme2

## The study

KernelShift: Benchmarking Kernel Optimization Across Evolving Hardware (preprint, not peer reviewed). arXiv 2611.29590. https://arxiv.org/abs/2611.29590

## At a glance

- What it shows: AI coding agents, given feedback from real Arm chips, can make many small performance-critical routines faster than the versions in popular open-source libraries. When the chip offers a genuinely new way of working, most agents fail to use it.
- What it does not show: It does not show that agents beat expert-written code in general, or that they can adapt to new hardware reliably. Tests cover Arm CPUs only, on a single core, and nothing has been used in production.
- Why it matters: Chips gain new features faster than engineers can hand-tune software for them. This study shows where agents can help with that today and where a human expert is still needed.

## What 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 the article (what it means, limits, what to watch) is free for members: https://scienceunderway.com/articles/coding-agents-beat-llama-cpp-kernels-on-arm-cpus-but-stumble-on-sme2

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

---
Source: Science Underway, https://scienceunderway.com/. Please link to the article when you cite it.
