Four decisions do most of the work. They are the reason this
fits in a tab at all, and the reason the numbers above are believable.
Memory
Compression that is never undone
Half a billion weights as 32-bit floats is about 2 GB — past what the tab
can hold. Stored at four to six bits each it is 469 MB, and it is never
decompressed. Each block of 32 values is unpacked inside the innermost loop,
used, and discarded.
The dequantised model never exists in memory.
Speed
Integers, not decimals
The activation vector is quantised to int8 once per matrix. After that the
inner loop is integer dot products, which map onto i16x8.extmul
and i32x4.extadd_pairwise — instructions WebAssembly actually
has, rather than the half-precision floats it has to emulate.
4,716 v128 instructions in the shipped binary.
Formats
Five quantisations, written by hand
Q4_0, Q5_0, Q8_0, Q4_K and Q6_K, because one Q4_K_M file uses all of them.
Q4_K packs eight six-bit scales and eight six-bit minimums into exactly
96 bits — the single most likely place for a silent numerical bug.
Verified bit-exact against ggml on real blocks.
Correctness
Plausible is not correct
“It looks like English” proves nothing: a broken engine produces fluent,
confident nonsense. Every intermediate activation is checked against PyTorch
layer by layer, and a fixed prompt with a fixed seed has to reproduce an exact
token sequence.
177 tests, 12 of them against the real model.