What is real. A 2 → H → H → 3 ReLU network is trained with full-batch Adam on a noisy three-class spiral (think: two vibration features, three machine states). Pruning, quantisation and the accuracy you see are computed on that actual network, on a held-out test set, in your browser.
Quantisation (post-training, symmetric, per-tensor): Δ = max|w| / (2b-1 - 1), ŵ = Δ · clamp(round(w/Δ)). Every weight error is at most Δ/2, so each bit removed doubles the error. Pruning removes the globally smallest |w|; with no re-training accuracy collapses quickly, Fine-tune re-trains the surviving weights with the mask fixed.
Device model (analytic, clearly approximate). Latency uses a roofline: t = max(MACeff/RMAC(bits), bytes/BW) + 20 µs, where MACeff = nnz + (1-η)·zeros (η = how well the hardware skips zero weights). Energy per inference = nnz · eMAC(b) + bytes · emem + wake; eMAC comes from Horowitz (ISSCC 2014, 45 nm): 8-bit int multiply 0.2 pJ, 32-bit add 0.1 pJ, fp32 multiply+add 4.6 pJ, SRAM about 1.25 pJ/byte, DRAM about 160 pJ/byte, scaled by a technology factor per device. Reading weights from DRAM costs far more than the arithmetic, so shrinking the model is what saves energy.
size = nnz·b/8 + index (min(N/8, nnz)) + biases
t_edge = max(MAC_eff/R(b), size/BW) + 20 us
E_edge = nnz·e_MAC(b) + size·e_mem + E_wake
t_cloud = payload/uplink + RTT + 2 ms + MAC/20 TMAC/s
E_cloud = payload·e_byte + E_radio_wake
T_ss = 25 C + P_avg · R_th P_avg = P_idle + rate·E_edge
Scenarios. The toy network has only about 1.2 k MACs. "Keyword-spotting class" and "Image-classifier class" scale the counts to roughly 40 k params / 5 M MACs and 3.4 M params / 300 M MACs (MobileNetV2) so latency, size and energy are on a realistic scale; accuracy is still measured on the toy network only, so treat the accuracy-versus-bits trend as qualitative.
Independent numerical checks (run when the model is trained):
training...
Honest simplifications. Device and link numbers are class-level orders of magnitude, not a specific product; no cache effects, DVFS, or batching; sub-8-bit weights are packed in memory but run at int8 speed on devices without native int4 (a 25 % unpack penalty is added); the NPU has no fp32 path (falls back to its host). Post-training quantisation only; quantisation-aware training would do better at 2-4 bits.
What to try: (1) SBC + image class: lower bits until accuracy drops > 2 points. (2) Microcontroller + image class: make the model fit in 1 MB flash (hint: 4 bit + 80 % sparsity + fine-tune) and compare latency. (3) Link = LoRa: when does the cloud ever win? (4) NPU: watch fp32 become slower than the CPU. Sources: Horowitz, ISSCC 2014; Jacob et al., CVPR 2018 (integer quantisation); Han et al., ICLR 2016 (pruning); Sandler et al., CVPR 2018 (MobileNetV2).