QAT uses MSE on the model output to update weights and quantization thresholds to restore accuracy.
Minimal call
epochs=1, qat_wbit=8, qat_abit=8.
What happens on the platform
QAT is a black box you drive with a few parameters. End to end:1
You provide the model and images
Upload your ONNX model (or a checkpoint the SDK exports first) and a representative set of calibration images.
2
The engine fine-tunes with quantization in the loop
R3AL’s engine trains the model on GPU with lower precision simulated during the forward pass, and automatically protects accuracy-sensitive layers.
3
You get a standard quantized ONNX bundle
The engine exports a standard quantized ONNX model plus
r3alai_manifest.json, downloaded into your output_dir.Key fields
epochs
How many times the model trains over your calibration data.
qat_wbit: weight bits
Precision of the model’s weights.
8: safe default4: aggressive, roughly 4x smaller weights, needs QAT to recover accuracy3: very aggressive, only with QAT and enough epochs
QuantConfig(qat_wbit=...).
qat_abit: activation bits
Precision of the intermediate tensors (layer outputs). Activations typically have different value ranges than weights, so you can set qat_abit independently:
qat_wbit=4, qat_abit=8: aggressive weight compression, safer activationsqat_wbit=8, qat_abit=8: conservative, minimal accuracy risk (recommended starting point)
QuantConfig(qat_abit=...).
Full example
Calibration images for QAT
QAT usescalibration_data for both calibration and training, unlike PTQ where calibration is only a measurement pass.
Calibration runs first and sets each layer’s starting clip threshold; training then tunes those thresholds together with the weights. qat_calib_method chooses how the starting value is derived: percentile (the default, at quantile qat_calib_q), max, or entropy.

