Four Times Faster, With 25x of Headroom Left
Kimi K3 is 2.78 trillion parameters and a 1.45 TB expert pool, and I run it across a DGX Spark and an RTX 5090 on the next desk. A week ago it served a token every 58.15 seconds. This morning the self-improvement loop's own ledger has five independent benchmarks in it:
14.745 → 14.412 → 14.307 → 14.089 → 13.735 seconds/token
13.735 s/token, and the best single configuration I have measured is 10.87. Four to five times faster than a week ago, from a model that does not fit in any one machine in this house.
None of that came from a better algorithm. It came from measuring where the work actually is. And the measurement that came out of this week is better than the speedup: we are running 25 times above our own memory floor. Everything between here and there is compute, and compute is the part you get to fix.
Where the mass is
Everything that is not an expert — attention, norms, routers, embeddings, the recurrent KDA state — is the trunk. It is resident, it is read on every single token, and by the safetensors headers it is 114.4 GB of bf16.
Classified by role:
| role | GB | share |
|---|---|---|
| attention q/k/v/o | 55.54 | 49% |
| mlp | 26.22 | 23% |
| attention (other) | 16.82 | 15% |
| other | 9.89 | 9% |
| embeddings | 4.71 | 4% |
| router/gate | 1.18 | 1% |
| KDA state (F32) | 0.04 | ~0 |
| norms | 0.01 | ~0 |
Half the trunk is attention. That one fact sets the entire strategy. Any policy that touches attention halves the model; any policy that spares it cannot matter much whatever else it does. And at the other end, norms and the recurrent state — the two places where low precision does real compounding damage — are 0.05 GB combined. Protecting them is free. Not approximately free. Free.
At the 240 GB/s I measured on this box, 114.4 GB is 477 ms of pure bus time per token. Add the experts and the 40 ms cross-desk lane and the floor is ~543 ms.
We are at 13,735 ms.
That is the headline. Not the 4x we already took — the 25x still sitting there. If we were near the memory floor, the remaining work would be arguing with physics. We are nowhere near it, which means the loss is in how the compute is organized, and that is entirely ours to change. A bit-exact CUDA trunk kernel already measured 17.5x on this hardware in isolation. The road is open.
Eight bits are free
To go faster the trunk also has to shrink, so: which format, and what does it cost in answer quality? I loaded real K3 weights and round-tripped them through each candidate.
Two numbers, and the second is the one that gets skipped:
- weight error — how wrong the weights are.
- GEMV output error — how wrong the answer is. Weight error that cancels across a 7168-term dot product is harmless; error that correlates is not. Only the second predicts damage, because only the second is what the model experiences.
| role | format | weight err | output err |
|---|---|---|---|
| attn q/k/v/o | MXFP4 (E2M1) | 11.7% | 12.0% |
| attn q/k/v/o | int4 affine g32 | 7.9% | 8.1% |
| attn q/k/v/o | int4 affine g16 | 6.5% | 6.7% |
| attn q/k/v/o | int8 affine g32 | 0.47% | 0.48% |
| mlp | MXFP4 | 12.2% | 11.9% |
| mlp | int4 affine g32 | 9.0% | 9.1% |
| mlp | int8 affine g32 | 0.53% | 0.53% |
Int8 costs half a percent. Half the trunk bytes, for an error small enough that it is competing with the noise in my own benchmark. That is as close to a free 2x as this field offers, and it is buildable now.
Int4 costs fifteen times more. Across 93 layers, a 7–9% per-layer output perturbation is not a model you want to talk to — so four bits, done naively, is not viable, and that is a quality verdict rather than a bandwidth one. It does not get fixed by a better packer. It gets fixed by better quantization: GPTQ or AWQ-class error compensation, which reconstruct each layer's output rather than each layer's weights, and typically land at 1–2% where naive rounding lands at 7–9%. Well-understood, plenty of public prior art, and a real project rather than an afternoon.
The scales are not free, and I had priced them as if they were
My first version of this ladder said "int8: 57 GB at 0.5% output error." That is two different configurations welded together. Int8 halves the weights, but every group needs a scale stored alongside it, and the finer the groups the more scales you carry. Measured on real weights:
| scheme | scales per row | output err (attn) | GB |
|---|---|---|---|
| per-row symmetric | 1 | 1.49% | 57.2 |
| symmetric, group-128 | 56 | 0.69% | 59.0 |
| symmetric, group-32 | 224 | 0.54% | 64.4 |
| affine, group-32 | 224 | 0.46% | 71.5 |
The 0.5% figure I quoted costs 71.5 GB — a 1.6x reduction, not 2x. And 57 GB really is available, but it costs 1.49%, three times the error I claimed for it.
The sweet spot is unambiguous once it is on one axis: group-128 symmetric halves the error of per-row for 3% more bytes, and saves 12.5 GB against affine-group-32 for 0.2% more error. That is the one to build.
There is a lesson in the shape of the mistake, not just the number. I had taken the best error from one column and the best size from another, and they were never available at the same time. A trade-off flattened into a single row always reads better than the trade-off actually is.
So the ladder, corrected:
| trunk | GB | bus ms | end-to-end ms | tok/s (ceiling) | status |
|---|---|---|---|---|---|
| bf16 | 114.4 | 477 | 543 | 1.84 | measured today: 13,735 ms |
| int8 g128 | 59.0 | 246 | 312 | 3.2 | 0.69% error — build this now |
| int4 | ~30 | 125 | 191 | 5.2 | needs error-compensated quantization |
Every tok/s in that column is a ceiling — what a perfect implementation would
reach if moving bytes were the only cost. I am labelling them that way in the
value itself, because I had this table with a row reading bf16 today … 1.8 and
within a day it got read as a throughput result rather than a floor. It is in
the same units and the same column as real numbers, and nothing on the page
marked which side of the projection line it sat on. Tables get quoted; context
does not survive the trip. Label it inside the number.
The format your model already ships is not automatically the right one
Look at the MXFP4 rows again: it is the worst of the three. That is genuinely counter-intuitive, because MXFP4 is what K3 itself uses. All 82,432 experts are already in it. The packer exists, the kernels exist, it is sitting right there.
MXFP4 has eight magnitudes — 0, 0.5, 1, 1.5, 2, 3, 4, 6 — with a shared power-of-two scale per group of 32. Those are not evenly spaced. They are a fixed non-uniform code book, and K3's experts were trained onto it: quantization-aware training pushed those weights toward values that land cleanly on those eight points.
The trunk was deliberately left in bf16. It was never trained for any grid. So the fixed code book fits it badly, while a plain affine int4 — 16 uniform codes stretched across whatever range each group actually occupies — fits it measurably better at identical bit width and group size.
Copying the format your model already uses is a trap when only part of the model was trained for it. The artifact looks like an endorsement. It is a record of a training decision that does not transfer to the rest of the network. This is the most portable thing I learned this week, and it cost nothing but a bake-off that took twenty minutes.
Two bugs worth naming, because of what they would have concluded
Both of these were on the road to four bits, and both would have produced a confident wrong conclusion rather than an error.
A rounding direction. The first bake-off reported 21% for MXFP4, not 12%.
Twenty-one percent closes the question — 4-bit attention is impossible, go find
your 5x elsewhere. The cause was floor where ceil belonged when picking the
power-of-two group scale: with floor the scale comes out too small, amax / scale lands in [6, 12) while 6.0 is the largest representable magnitude, and
every group's top values clamp. No exception, no NaN — a clamping quantizer
produces well-formed output that is simply worse, and reports a completely
plausible error figure.
A kernel that returned zeros. In the C engine's int4 group matmul, the
per-group bf16 scale was being decoded as (float)(u16 >> 16). bf16 is the
top 16 bits of an f32, so the decode is a left shift into a 32-bit word; a right
shift of a 16-bit value by 16 is always exactly zero. Every scale was zero.
Every output was zero, for every row of every matrix, for as long as the kernel
had existed. It compiled without a warning, was wired into the live weight-dtype
dispatch, and had no test — there is a scale_test in that tree which passes,
and which turns out to be about memory scaling. A name collision was doing
duty as coverage.
That second one is the instructive one. Had I not caught it, I would have quantized the trunk to int4, run it through this kernel, gotten fluent nonsense out of a trillion-parameter model, and had my own table in front of me saying int4 costs 7–9% error. The conclusion writes itself: four bits is too lossy for this model. Wrong, about the wrong component, and supported by a real measurement.
Both are now pinned by tests with mutation guards. Reverting the kernel fix fails three of five assertions with the diagnosis in the message:
output is not identically zero (scale decode is live) FAIL
worst relative error 1.000e+00 at row 0 (y=0.000000 ref=2.968750)
output depends on x (kernel is not ignoring its input) FAIL
Note which assertions pass under the mutation: "every output element is finite," because zero is extremely finite — and the sophisticated per-group scale check, because when every scale is zero, changing one of them still gives zero. Had I written only the clever assertion, the suite would have been green on a kernel that computed nothing. The elegant test was the vacuous one. The assertion that caught it is the crudest thing imaginable: is the output identically zero.
What happens next
Now: the int8 trunk. 114.4 GB down to 59.0 GB at 0.69% output error, with norms and KDA state left in full precision because they cost 0.05 GB. The engine has an int8 dispatch path already, but it carries a single per-row scale, which measured 1.49% — so this needs a group-128 kernel rather than the one sitting there. That kernel is close to free to write: the int4 kernel already uses exactly this layout, a run of bf16 group scales followed by packed weights, so int8 is the same loop with a wider code.
Then: the 25x. This is the bigger prize and it is all compute — the CUDA trunk kernel that already measured 17.5x, plus expert-tier residency, which is worth more than any format change.
After that, if a token a second still isn't enough: error-compensated int4, measured against a hash-gated scorer, so that "it got faster" can never quietly mean "it got worse."
A week ago this model produced a token a minute. It now produces one every thirteen seconds, we know where all 114 gigabytes of the hot path go, and the distance to the physical limit is a factor of twenty-five that belongs entirely to software.
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.