How few bits does a closed-loop robot controller need before it falls over?

The same trained Go1 policy, quantized several ways, walking in real MuJoCo physics compiled to WebAssembly. Everything on this page runs in your browser: the simulation, the neural network, and the timing.

Variants

All ONNX files are the same size. Quantization here is simulated — weights are rounded to the target grid and stored back as float32 — because the question is what precision does to control, not what it does to a file. A deployment would pack the weights and get the storage win too.

Command and perturbations

— fps

starting…

Measured results

From runs that completed on the reference machine (RTX 3050 Laptop, 4 GB): 100 episodes × 5 seeds, deterministic policy, paired bootstrap 95% intervals. Nothing on this page is estimated.

Cost of precision on flat terrain
schemebits/weightΔreturn vs fp32
fp3232.00
fp1616.00no measurable loss
int8-tensor8.00no measurable loss
int8-channel8.00no measurable loss
int8-act8.00no measurable loss
int4-group324.00−0.73% [−0.88, −0.45]
mixed-head-fp164.19−0.90% [−1.26, −0.70]
int4-channel4.00−2.34% [−2.79, −1.95]
ternary1.58−90.7% [−92.1, −89.1]
Robustness frontier (P50) — where 50% of episodes still succeed
schemefriction ×
lower is better
obs noise σ
higher is better
fp320.189 [0.178, 0.206]0.142 [0.138, 0.145]
int8-channel0.205 [0.188, 0.224]0.142 [0.138, 0.146]
int4-group320.207 [0.190, 0.225]0.140 [0.135, 0.144]
int4-channel0.241 [0.230, 0.252]0.127 [0.122, 0.134]

int4-channel costs only 2.3% of return on flat ground, yet its friction and observation-noise frontiers separate from fp32 with non-overlapping intervals. int4-group32, at the same 4 bits, does not. Finer grouping, not more bits, is what buys the margin back.

The recommender's answer on this data: at a 90% retention bar, the cheapest qualifying scheme is int4-group32 at 4.00 bits; raising the bar to 99% moves it to int8-act at 8.00 bits.

Browser inference latency

100 warmup iterations discarded, then 1000 timed. Measured here, in this browser, on this machine — a latency measured in Python would not describe what this page does.

not measured yet