← back
Never miss a thing.
One email per new article, plus upcoming course announcements, nothing else. The full tech-watch news, figures and gifts are reserved for Subscriber Area members.

This article also exists in French: read the French version.

Discuss this article with your AI
The button copies the article with a short introduction for the model. Paste it all into Claude, ChatGPT, Le Chat or another AI, then ask it your questions.

One level down: #007.1 The rules: bits, KL, BFCL, and 4 bits

One level down: #007.1 The rules: bits, KL, BFCL, and 4 bits

In short

This is a technical companion to #007 Herbert against OVH's engines, on their own model, published the same evening. It gives the rule that decides whether an optimization is accepted, what "4 bits" means in Herbert, and the details of the tool-calling test against vLLM. The speeds are in #007.

The rules

The reference is OVH's code in transformers, on its no-cache path, all in 32 bits (see token 18 in the previous article for the difference between its two paths).

First check: the same bits. An optimization passes it if it gives exactly the logits of the previous code: same md5 fingerprint on a 512-token prompt and on a 2,048-token one, in 16 bits and in --q4, for each block size involved. Nothing else to check in that case.

Second check, when the bits change:

The options added since November 25 only went through the gap measurement, on a wider gate: 16 long prompts and 12 to 36 short ones, with a rule written before the measurement. The tool test was not rerun for them. Two options accepted separately can interact: I have not measured that.

Before each campaign, the prediction is written in a _predictions.md file, filed with the logs. Each optimization gives a measured value and an integration cost. The decision to make it the default comes afterwards, and it is stated.

What "4 bits" means here

With --q4, Herbert puts ten of the fourteen candidate families of matrices in 4 bits. The router stays in 32 bits. The embedding and the small matrices of the TPA attention (A factors, offsets) stay in bf16. Four families read values that are too large or too sensitive for 4 bits: they are kept wider. That is where the engines differ.

FamilyCUDAVulkan (RX, Arc)Metalx86 processorARM processor
Mamba-3 input projections (in_proj, in_proj_dyn)4 bits4 bits4 bits4 bits4 bits
Attention: c_q, W_B_k, W_B_v, gate_proj4 bits4 bits4 bits4 bits4 bits
Routed experts input, down to the latent (down_proj)4 bits4 bits4 bits4 bits4 bits
Shared expert, input (fc_1)4 bits4 bits4 bits4 bits4 bits
Output head (lm_head)4 bits4 bits4 bits4 bits4 bits
Mixer output (mixer_proj)bf16bf168 bitsbf16 at prefill, 8 bits at decodebf16
Routed experts output (output_experts)bf16bf168 bitsbf16 at prefill, 8 bits at decodebf16
Back up from the latent (up_proj)bf16bf168 bitsbf16 at prefill, 8 bits at decodebf16
Shared expert, output (fc_2)bf16bf168 bitsbf16 at prefill, 8 bits at decodebf16
Router (moe_gate)32 bits32 bits32 bits32 bits32 bits
Embedding, A factors and offsets of the attentionbf16bf16bf16bf16bf16

The 4 bits is the same everywhere: groups of 32 numbers, one scale per group, chosen by least squares among 15 candidates. The scale is in f16 on graphics cards and in f32 on the processor. The 8 bits uses groups of 64, with an f32 scale. On a graphics card, the activations stay in bf16. On the processor, those of the 4-bit matrices go to 8 bits.

Why these four families. With everything in 4 bits, the answer breaks from the second token on, on Metal as on the processor: the mean gap to the 16-bit version (KL, two prompts) is 0.40 and 0.17 on Metal, 0.51 and 0.28 on the processor. By keeping the four families wider, it drops to 0.17 and 0.06 on Metal, 0.30 and 0.09 on the processor. Three of them read huge values: I measured up to 2.9 × 10^16 at the input of mixer_proj, layer 1 (the transformers reference gives 2.93 × 10^16 at the same place). The llama.cpp documentation talks about roughly 10^14: our measurement is higher. The fourth one, fc_2, does not read any outlier (at most 2.4). And yet, when it alone is put in 4 bits on the processor, it is the one that flips the second token. So magnitude does not explain everything, and I do not claim it does.

Why 8 bits on Metal and at decode on the processor. At decode, memory is the limit: 8 bits instead of 16 means half as many bytes to read. On the Mac, 8 bits keeps the fidelity of --q4 and takes decode from 248.3 to 266.5 tokens/s. On the x86 processor, Herbert keeps both copies, bf16 for prefill and 8 bits for decode, hence the 11.7 GB. On the ARM processor, the 8-bit copy does not exist yet.

The processor recipe. The first recipe chose each group's scale as its maximum divided by 7. It also put output_experts and up_proj in 4 bits, where the graphics cards keep them in bf16. On the tool test, it got 48 questions out of 100 right, against 68 for the NVIDIA card in --q4. Aligned with the graphics cards, it gets 75 right, and its gap to the NVIDIA card in 16 bits goes from 0.0565 to 0.0383. It costs 15% on prompt reading (852 tokens/s instead of 1,002 at 512 tokens), 3% on writing (36.4 instead of 37.6), and 11.7 GB of memory instead of 5.2 (Ryzen 9 9900X, at the time of the recipe change). On the published commit, the 100 answers of the test are identical, message for message, to those of the first measurement.

Herbert does not read an already quantized file. It reads the original weights and prepares this mix at load time, for the machine it runs on.

Logs: 2026-11-19-olala-metal-q4, 2026-11-19-olala-jit-q4, 2026-11-20-olala-q8-families, 2026-11-21-olala-activations-max, 2026-11-22-olala-cpu-fidelity-diag, 2026-11-22-olala-cpu-q4-recipe.

Tool use, against vLLM

BFCL, 7 categories, 2,551 questions, on a rented RTX 6000 Ada (same architecture as the RTX 4080, same md5 of the logits), commit of November 25 (1bdf00b), vLLM 0.33.0 in 16 bits, most likely token at each step, answers limited to 2,048 tokens. The prompts sent are identical, token by token, question by question. As a percentage of questions answered correctly:

CategoryHerbert 16 bitsHerbert --q4vLLM 16 bits
simple_python80.072.578.25
multiple81.576.077.5
parallel62.055.056.0
parallel_multiple65.556.563.5
irrelevance92.992.592.5
live_simple66.760.966.3
live_multiple57.553.256.2
Average excluding live76.470.573.6
Total over the 2,551 questions68.162.966.3
Answers cut off at 2,048 tokens318517364

Question by question (McNemar on the total): Herbert 16 bits against vLLM, +1.8 points, p = 0.017, but no category shows a gap on its own. Part of the gap comes from answers that are cut off less often (318 against 364). So I write that Herbert 16 bits is on par with vLLM, not ahead of it. Herbert --q4 against vLLM: −3.45 points, p = 0.0001; against Herbert 16 bits: −5.3 points, p < 0.0001. On this test, --q4 costs about 5 points: it is a setting for speed and memory, and it does not come for free.

OVH reports 59.6% on BFCL V3 in the model card on Hugging Face. That figure covers the test's 23 categories (4,981 questions, including multi-turn conversations), with randomly sampled tokens (temperature 0.8), a "high" reasoning effort, and no limit on answer length. I am measuring something else: 7 simple categories, the most likely token at each step, the default effort, and a limit of 2,048 tokens per answer. In our runs of November 21, 46% of the failures were in fact answers cut off at that limit. So our scores cannot be compared with OVH's figure. They compare with each other: Herbert and vLLM get the same questions with the same settings. It is the gap between the two that tells whether Herbert reproduces OVH's model.

One level down, or several...

  1. One level down: #000 an inference engine that writes its own code · 03-Oct-2026
  2. One level down: #001 a compiler for an LLM engine · 11-Oct-2026
  3. One level down: #002 the same compiler on a GPU · 18-Oct-2026
    1. One level down: #002.1 follow-up, the Arc in f16 · 02-Nov-2026
  4. One level down: #003 what CUDA has that Vulkan lacks · 25-Oct-2026
  5. One level down: #004 the same compiler on Apple's chips · 01-Nov-2026
  6. One level down: #005 Is Herbert better than Llama.cpp? · 15-Nov-2026
  7. One level down: #006 I started porting Olala, OVHcloud's model · 22-Nov-2026
  8. One level down: #007 Herbert against OVH's engines, on their own model · 29-Nov-2026
    1. One level down: #007.1 The rules: bits, KL, BFCL, and 4 bits · 29-Nov-2026
    2. One level down: #007.2 Graphics cards, one track at a time · 29-Nov-2026
    3. One level down: #007.3 The processor: AVX-512, AVX2 and SME · 29-Nov-2026
    4. One level down: #007.4 The option turned down, then accepted · 29-Nov-2026