Worked: Reuse the recipe you already trust. We train a tiny FP32 linear policy (softmax, plain gradient descent) that maps an 8-dim sensor vector to one of 3 actions, then QAT-ternarize it with the non-learnable BitNet absmean scale. Recall from module 2 why non-learnable: a learnable scale drives the zero-ratio to ~90% and blows up the loss, while a fixed absmean self-regulates near a ~26% zero equilibrium. The absmean scale is literally s = mean(|W|), the average magnitude of the weights. Ternarize with Wt = clip(round(W/s), -1, 1); every weight is now -1, 0, or +1.
Your turn: Fill the one gap: compute s. Watch what W/s does, dividing by the mean magnitude puts a typical weight near +/-1, so round snaps it to a trit and clip guards the rare outlier. If you leave s as a wrong constant (say 1.0), the round collapses 92% of the weights to 0, and accuracy does NOT fall off a cliff: it reads 0.917, above the 0.85 bar, because the few largest weights still separate three well-spaced prototypes. That is the zero-ratio failure hiding behind a good score, and it is why the check also demands nonzero_frac >= 0.3. Accuracy alone would pass a collapsed quantizer.
Independent: Now read the inference loop and the tax counter without touching them, and be able to defend both. The ternary MAC uses only += (weight +1, add), -= (weight -1, subtract), and skip (weight 0), there is no * on the hot path. The policy also omits the scale s and the bias b, and it is worth stating precisely WHY each drop is safe: scaling every logit by the same positive s is monotonic, so it can NEVER change an argmax (that part is a theorem, not luck. The bias is different) dropping a bias CAN flip an argmax in general, but this trained bias is tiny (|b|~0.07, near zero), so it flips no decision here, and the bench verifies exactly that (ternary_acc holds). The loop counts a multiply for every weight that is not a trit; with the clip there are none, so multiplies == 0 is measured, not a rounding of "almost zero." Then the tax counter: a naive binary-assuming stack pays store->pack, wire->decode, compute->unpack = 3 re-encodings; the end-to-end trit pays 0, so taxes_removed == 3.