Running a language model locally usually means installing a substantial software environment. The llm.asm project asks how much of that environment can be removed when the machine has one narrowly defined job. Its x86-64 assembly implementation can generate text under Linux or inside a tiny bootable system. The interesting result is the explicit control over computation and memory; the demanding question is whether its advantages survive comparison with C, C++ and Rust.
Return to New Programming Languages versus Rust / C++. Special study: assembly is an established family of languages, not a new entrant. This article connects the execution system with the model it runs. Evidence reviewed on 2 December 2026.
The project
A computer organised around one model

The core experiment implements matrix operations, attention, tokenisation and system services explicitly. Its Linux form still asks Linux to provide services. Its bootable form supplies a small operating system of its own. In the published KVM trials, a Linux host and virtualisation remain part of the complete machine.
The examined documentation lists a 15,064-byte Linux executable and a 27,164-byte kernel. The approximately 24 KB figure circulated for an earlier kernel: one independent reproduction measured 24,252 bytes. These sizes exclude the model weights and working memory. Current project map · Earlier reproduction.
Part I. What assembly changes beside C, C++ and Rust
The original fast path uses CPU vector instructions, including AVX2 and fused multiply-add operations. Several values can be processed together, while data layout and the order of memory accesses are chosen manually. There is no GPU inference in this experiment. A text display nevertheless exists: doing the numerical work on the CPU does not mean dispensing with display hardware. Inference implementation · System design.
C, C++ and Rust also produce native machine instructions and can use processor-specific operations. Rust’s no_std environment supports software without its usual operating-system-dependent standard library. The distinguishing choice here is how much is written and maintained by hand. Assembly removes many abstractions, but the author must supply allocation, bounds discipline, concurrency and hardware support. Rust without the standard library · Rust’s processor intrinsics.
Rust’s safe interfaces enforce rules about references and lifetimes that this assembly code does not supply. Unsafe routines and external assembly still require their own correctness arguments. A compact privileged kernel can contain serious memory errors; fewer lines or dependencies do not certify its security. Nor does memory safety establish that the model’s answers are reliable. The boundary of unsafe Rust.
The author’s CPU comparison with llama.cpp
The clearest published comparison keeps both programs under Linux: Qwen3-0.6B, Q8_0 weights, an AMD EPYC 7642 with 47 cores online, 34 input tokens and 64 generated tokens. The table reports the mean of three runs. It compares llama.cpp’s CPU path with the default fast assembly path, which also quantises activations. It does not isolate a language effect from differences in arithmetic, layout and implementation. Test conditions and complete table.

| Threads | llama.cpp | Fast assembly | Reported gain |
|---|---|---|---|
| 4 | 51.08 | 69.24 | 35.6% |
| 8 | 80.79 | 103.64 | 28.3% |
| 16 | 103.03 | 121.86 | 18.3% |
Two counterexamples matter. The assembly path using floating-point activations is slower than llama.cpp throughout the published thread sweep. Processing the input prompt is also substantially slower in the reported assembly implementation: llama.cpp batches matrix operations, whereas this path processes tokens individually. Faster subsequent generation therefore does not guarantee a shorter wait for an answer. A community proposal for batched prompt processing had not been incorporated into the reviewed revision. Alternative path and prompt processing · Proposed improvement.
The reports still leave replication gaps. A community issue requests the exact llama.cpp revision, commands and clarification of results. The overview’s KVM values also mix some peak figures with detailed averages. Consequently, the figure above uses only the explicitly labelled Linux means; it does not turn the highest virtual-machine result into a general percentage advantage. Questions about reproducibility · Detailed KVM results.
What other users reproduced
A community trial on a Xeon Gold 5418Y compared the same assembly inference under Linux and KVM, using 128 generated tokens and medians of repeated runs. With eight threads, processor affinity and large memory pages brought Linux to 48.15 tokens/s, beside 48.59 for the specialised system. This result identifies memory placement and scheduling as important explanations for the gap on that machine. It supplies no general requirement to remove Linux. Independent conditions and results.
A Ryzen 7 7800X3D trial under WSL2 reported five interleaved-run medians: assembly reached 32.36 against llama.cpp’s 31.39 tokens/s at four threads, and 32.86 against 34.54 at eight. The contributor disclosed substantial variability. An initial numerical-error allegation in the discussion was subsequently corrected: its reference arithmetic had not matched the quantised-activation path. Both the unfavourable speed result and the correction belong in the record. Trial and subsequent correction.
The LinuxGratis reproduction also booted an earlier x86 kernel on an Apple M2 Max through software emulation, reporting approximately 1.85–1.88 generated tokens/s. That demonstrates a working installation in another environment; it cannot reproduce an EPYC hardware-virtualisation speed claim. The quoted 74–94 ms boot interval is narrower still: the kernel starts its timer after some early setup and stops it before displaying its ready banner. It excludes the complete firmware and loader sequence and is not time to the first generated token. Reproduction · Timer start · Timer end.
What the Rust community actually contributes
No equivalent, controlled llm.asm-versus-Rust benchmark was located in the examined sources. There are, however, real Rust implementations of this model and published comparisons with llama.cpp. Candle provides native and WebAssembly examples for Qwen3-0.6B; qwen3-rs provides an educational implementation. These projects provide inspectable implementation alternatives, rather than a speed ranking. Candle native example · Browser example · qwen3-rs.
Frink, previously named Ferrox, supplies its own inference engine instead of wrapping llama.cpp. Its stored Qwen3-0.6B Q8_0 records include generation tests of 128 synthetic tokens, three measured repetitions and one warm-up. The Frink column reproduces the stored values, which equal the medians of its three recorded samples. The llama.cpp column reproduces the archived reference values; these older records neither establish that those values are medians nor preserve their individual repetitions. A common summary statistic is therefore not documented for both columns. How the reports handle statistical summaries. They are historical builds, and these older records omit the llama.cpp revision. The benchmark documentation also warns about earlier thread-setting errors; the archived records do not supply a complete reconstruction of both commands. They are informative reports with unresolved controls, not a definitive contest between languages. Engine · Protocol and limitations.
| Machine and execution path | Frink build | Frink | llama.cpp | Record |
|---|---|---|---|---|
| Ryzen 9 3900X, Linux CPU; Frink 12 threads | 0.21.0 | 35.01 | 40.12 | JSON |
| Ryzen 9 7945HX, Linux CPU; Frink 16 threads | 0.17.1 | 63.64 | 82.39 | JSON |
| Apple M2 Pro, Metal GPU | 0.20.0 | 190.62 | 116.14 | JSON |
The two CPU records favour llama.cpp; the Metal record favours Frink’s accelerated implementation. Metal performs GPU calculations through specialised programs, so that last row is not a measurement of Rust CPU instructions. The machines, builds and even the recorded model-file sizes differ between rows. None can be placed beside the EPYC assembly figure as a common ranking.
A second community comparison, Models, combines Java with Rust numerical routines. Its saved Qwen3-0.6B Q4_0 application trials on an eight-vCPU EPYC Milan report median generation rates of 50.56 tokens/s for Java/Rust and 109.28 for llama.cpp b10012. The records share weight identifiers and prompt hashes, but reuse of prompt prefixes differs and the generated answers are not identical. This is a comparison of complete application configurations, with real Rust computation, rather than a pure Rust engine or an isolated language effect. Division of work · Saved application results.
Two further cases prevent misleading conclusions. Reflex combines Rust and CUDA, but its reported cold-start comparison acknowledges different input text in the reference program, so it cannot settle a speed claim here. Ringzero instead combines a Rust operating-system core with assembly inference derived from llm.asm, using Qwen3.5 models. It demonstrates that the approaches can cooperate; its different model and hardware prevent a head-to-head inference comparison. Reflex’s disclosed limitation · Ringzero’s original report · Current Ringzero architecture.
A separate comparison with C, and the limits of maturity
The repository’s sixth experiment compares a C-plus-assembly implementation built with GCC O3 against a pure NASM version, using a specialised MiniCPM5-2B model and 20 EPYC 7642 threads. The author reports input processing of 248.7 versus 277.6 tokens/s and generation of 34.3 versus 37.6, respectively. This is a useful direct implementation comparison with C. It uses a different model and task from the Qwen3 experiment, and does not establish a result against C++ or Rust. Separate C/assembly measurements.
Other inspectable assembly projects include qwen3_5-assembly for x86 Linux and gpt2.s for AArch64 on Apple Silicon. They support the wider feasibility of the approach, with different models, precision and environments. Meanwhile, llm.asm’s open tokenizer correction and ongoing optimisation proposals show that functional coverage is still developing. A young experiment with active contributors is not yet a general-purpose inference platform. Qwen3.5 assembly project · GPT-2 assembly project · Tokenizer correction proposal.
Part II. The model inside the small system
The model is Qwen3-0.6B, released by Qwen: a small dense language model with 28 Transformer layers and a vocabulary of 151,936 tokens. Assembly provides the machinery that evaluates its learned weights. The model is not a new design created by llm.asm, and converting its weights is not training it again. The repository’s separate MiniGPT training demonstration should not be mistaken for training Qwen3. Official model card · Separate training experiment.
The exporter reads the model configuration, tokenizer and Safetensors files, then writes a specialised representation. Q8_0 matrices use signed eight-bit values in blocks of 32; the compact format stores their scales in 16-bit floating point. Normalisation vectors retain 32-bit precision. The fast execution path additionally quantises activations. These choices reduce some storage and computation costs while changing numerical operations. The model’s Apache 2.0 licence continues to apply to its weights, separately from the software’s MIT licence. Conversion rules · Model licence · Software licence.
| Resource | Documented or calculated amount | Meaning |
|---|---|---|
| Converted model file | Approximately 613.66 MiB | Separate from the executable. |
| Attention cache, 2,048 positions | 448 MiB, calculated | Allocated capacity, additional to weights and other buffers. |
| Attention cache, 4,096 positions | 896 MiB, calculated | The same allocation rule with twice the context. |
| Documented virtual machine | 2 GiB assigned memory | A demonstrated configuration, not a universal minimum. |
The cache calculation follows the source: two caches × 28 layers × context length × eight key/value heads × 128 values × four bytes. The model card advertises 32,768 tokens, while the examined execution interface defaults to 2,048 positions and the exporter separately defaults to 4,096. Extending this cache policy to 32,768 positions would require 7 GiB for the cache alone; that calculation does not demonstrate that the program has been validated at that length. Cache allocation · Execution settings · Exporter settings · Virtual-machine configuration.
Reported agreement across 64 generated tokens under greedy selection is a useful, limited fidelity check. Numerical scores still differ, and a short matching sequence does not establish equivalence for arbitrary prompts, longer conversations or sampling settings. Tokenisation must also agree before scores can be compared. Useful local inference requires measuring correct, completed answers alongside generation speed and first-answer latency. Numerical and sequence checks.
The Models application offers a concrete caution about usefulness. Across nine cases repeated three times in its Java/Rust trials, 12 final responses retain a model answer with citations supplied by the surrounding system, 12 use an extractive fallback and three abstain. Its perfect final system score therefore includes retrieval and protective rules; it is not evidence that the small model independently answered every question correctly. This is a plausible way to constrain a small model’s role, provided the whole application is evaluated. Recorded answers and decisions.
What this language can contribute to artificial intelligence
Assembly has a concrete role in specialised inference kernels: choosing vector instructions, arranging quantised data and controlling memory access for a specific processor. llm.asm makes those choices unusually visible across an entire experimental system. For an established adjacent example, PyTorch documents Arm’s KleidiAI CPU kernels in its inference stack. That industrial use concerns a different architecture and software component; it is not adoption of llm.asm. No influential AI provider’s internal use of this particular project was established by the reviewed sources. Hosting Qwen weights or supporting a vendor’s processor does not establish such adoption. PyTorch and KleidiAI · llm.asm’s scope.
The potential local value is direct access to an inspectable execution path and a small software component dedicated to a bounded workload. The evidence supports measured acceleration in some CPU generation configurations. It supplies no energy measurement, general memory-safety guarantee or proof of safer model behaviour. Removing services changes the attack surface, but placing inference in a privileged kernel also changes the consequences of defects. Those security effects need their own assessment.
Where this special study earns its place
llm.asm deserves examination as a working experiment in how little execution software a local language model can require. Its strongest contribution is the connection between processor instructions, numerical representation and a specialised system. The documented comparisons also show where it loses: prompt processing, some independent generation trials, portability and the safeguards supplied by higher-level systems. C and C++ remain substantial performance references; Rust offers inspectable inference alternatives and stronger safe-language memory rules, while also allowing carefully bounded assembly. The evidence supports this specific experiment, with its costs exposed. It does not support a universal victory for assembly or a claim that removing Linux is necessary for fast local AI.
Visitas: 0
Liked this post? Follow this blog to get more.