QUANTIZATION · ONE SUPER-BLOCK, 144 BYTES
Q4_K Block Layout
Quantize 256 weights into one Q4_K super-block, pack every byte the way llama.cpp does, and see how one outlier coarsens only its own sub-block.
Your experiment
Start with one outlier of 0.3 at weight 70. Read which sub-block becomes coarse and why the others do not, then switch to one scale for the whole block, shrink the outlier, try a loud sub-block and a shifted block, and change the seed.
Every input recomputes the result immediately; there is no animation because nothing here unfolds over time. An input outside its allowed range is rejected with a message and the previous valid result stays on screen.
Bytes and one sub-block, original > dequantized
Computed data
Metrics
The block layout, the 6-bit scale packing, the nibble order and the dequantization x = d x sc x q - dmin x m are those of block_q4_K and dequantize_row_q4_K in llama.cpp. The search for each sub-block's scale and minimum is a plain min-max fit; llama.cpp's make_qkx2_quants searches further, so its errors are somewhat smaller. The one-scale comparison stores 132 bytes and is not a llama.cpp type. Weights are seeded random values, not a trained checkpoint.
A super-block in 144 bytes
Q4_K quantizes weights in super-blocks of 256. Each super-block stores two fp16 numbers, d and dmin, then 12 bytes that pack eight 6-bit scale codes and eight 6-bit minimum codes, then 128 bytes of 4-bit quants. A weight is rebuilt as d x sc x q - dmin x m, where sc and m are its sub-block's codes and q is 0 to 15. That is 144 bytes for 256 weights, 4.5 bits per weight. The text panel shows the bytes; the low nibbles of each 32-byte group belong to one sub-block and the high nibbles to the next.
One outlier, one coarse sub-block
The opening block, chosen with Weights in the block, has one weight of 0.3 at index 70 among weights with standard deviation 0.02. Sub-block 2, weights 64 to 95, must stretch its 16 levels to reach 0.3, so its step is 0.02229, 1.15 times its typical weight: COARSE STEP in 1 of 8 sub-blocks, and most of its small weights collapse onto a few levels. Its scale code is 63, the largest; the other sub-blocks get codes 13 to 20 and keep steps between 0.0046 and 0.007, under 0.43 of their typical weight.
Why sub-blocks matter
Switch Scales to one scale and min for all 256 and the same outlier sets one step, 0.0242, for every weight: 8 of 8 sub-blocks are coarse and the RMSE rises from 0.0028 to 0.00706, while the block shrinks only from 144 to 132 bytes, 4.125 bits per weight. With normal weights both schemes stay fine, but Q4_K's RMSE is 0.00168 against 0.00256. A loud sub-block, every weight of sub-block 3 scaled up, is harmless in Q4_K because it gets its own scale; with one scale 7 of 8 sub-blocks become coarse.
Where the boundary sits
Shrinking the Outlier size slider moves the boundary: at 0.15 sub-block 2 has step 0.012287, 0.63 of its typical weight, and all 8 sub-blocks are fine; at 0.2 its ratio reaches 0.8 and it is coarse again; at 1 the ratio is 3.55 and the other sub-blocks fall to scale codes 4 to 6, so their 6-bit scales lose resolution too. For the loud pattern the same slider sets how far sub-block 3 is scaled up. A shifted block, every weight plus 0.03, is absorbed by the minimum codes: all 8 sub-blocks stay fine. The Random seed draws a different set of normal weights while the pattern stays the same, so the exact steps and codes move a little.
Reading the tool and its limits
The chart overlays original and dequantized weights with sub-block boundaries, the lanes give the byte layout and each sub-block's step, the table lists codes, steps and errors, and the text panel prints d, dmin, eight weights per line for the sub-block picked by Sub-block shown in the text panel, and a hex dump; that control changes only the text panel, not the verdict. The coarse rule, a step above three quarters of the sub-block's typical weight, is a readable threshold, not a llama.cpp criterion. Importance-weighted quantization with an imatrix would also change which errors matter most.