Two models typed LLM inference engines as raw hex bytes, and both report beating llama.cpp
Gemini 4 Neon and Claude Opus 5.5 each wrote a Qwen3-0.6B engine in x86-64 machine code with no assembler. The author measures the Gemini engine up to 81 percent faster than llama.cpp on one CPU.
This week we covered llm.asm, which runs Qwen3-0.6B from hand-written assembly. Its author, alesha-pro, has now removed the assembler. In machine-code-llm-battle, published November 26, two coding models were each asked to write an inference engine for the same model as a text file of hex bytes. The file is turned into a program with sed, tr and xxd. No compiler, assembler, linker or C library is involved.
How it works
The task, per the README: write a complete Linux x86-64 engine for the 8-bit Qwen3-0.6B, match a reference output token for token on four prompts, and beat llama.cpp on CPU. Gemini 4 Neon worked in Antigravity and Claude Opus 5.5 in Claude Code, each in its own sandbox.
Writing at this level means typing the file header and every instruction encoding and jump distance by hand. Both engines’ reports describe the same defence: each routine sits in a fixed-size slot at a fixed address, so editing one does not move the others.
The reports are frank about what broke. Both started from the same idea, multiplying 8-bit weights by 8-bit activations, and both found that one token in the reference has its top two candidates about 0.0005 apart, less than the rounding noise. Opus caught this in a NumPy prototype before writing any bytes and used 32-bit floats. Gemini built the 8-bit engine, watched it diverge, and moved to 15-bit integers scaled per block of 32, which kept the fast integer path. Opus also reports a spell of about 270 tokens per second that turned out to be an engine reading a model of all zeros. The verifier failed and exposed it.
The numbers
All figures are from the README and were measured by the author’s harness on one machine, a 48-core AMD EPYC 7642. Decode speed is in tokens per second.
| Threads | llama.cpp | Claude Opus 5.5 | Gemini 4 Neon |
|---|---|---|---|
| 1 | 16.63 | 21.44 | 22.27 |
| 8 | 80.79 | 100.17 | 124.11 |
| 16 | 103.03 | 123.50 | 171.05 |
| 32 | 103.82 | 125.13 | 188.35 |
| 40 | 105.08 | 116.05 | 181.04 |
| Claude Opus 5.5 | Gemini 4 Neon | |
|---|---|---|
| Binary size | 7,331 bytes | 10,752 bytes |
| Time | about 65 min | 1 h 43 min |
| Turns | 175 | 90 |
| API cost at list price | $21.40 | $16.72 |
Gemini’s engine is faster at every thread count, and by a wide margin past eight threads. Opus finished sooner with a smaller binary, and cost more.
The caveats matter. A program written for one model on one chip, with thread placement tuned to that chip’s layout, is being compared with a general-purpose engine. Accuracy was checked on four prompts. The README does not say how much the human steered, and states no license.
Try it yourself
The repo has both engine.hex files, both reports, the reference outputs and the verify script. You need Linux on an x86-64 CPU with AVX2, FMA and F16C, plus weights exported with a script from the llm.asm repo. The README says the engines still match the reference on other CPUs, at different speeds.
We have not built or run either engine. This is based on the README, the two reports and the commit log.
Disclosure: Claude, an Anthropic model, helps write this site.