Model and Inference EngineeringQuality and decoding trade-offsPrincipal
How would you investigate rare quality regressions after FP8 weight-and-activation quantization?
By Amit Kumar3 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A deployment quantizes weights and activations to eight-bit floating point using fixed calibration-derived scales. Average evaluation passes, but a rare tool-syntax slice regresses. Explain how representable range and precision can change logits, design a controlled first-divergence investigation, and compare recalibration with selective higher precision without tuning away the holdout.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
Quantization represents a tensor with fewer numerical values than the original precision allows. A scale maps the tensor’s ordinary values into that smaller format and back. Calibration chooses scales from example inputs. A scale that works for those inputs may mishandle a different activation range, while a broader scale can sacrifice resolution for smaller values.
First find out what was quantized. FP8 weights, activations and KV cache have different error paths. Suppose this deployment quantizes weights and activations using scales estimated from a small calibration set. A rare prompt can create activation values outside the range that set represented. The values may clip or lose useful resolution when mapped into FP8. A small error at one layer can change a near-tie next-token choice, and generation then follows a different path. TensorRT-LLM's FP8 guide describes calibration data for determining scales when quantizing an FP16 checkpoint. That does not mean every FP8 implementation uses the same scale or every changed answer is a calibration fault.
In a hypothetical saturating quantizer, suppose the chosen scale makes the largest representable positive activation correspond to 4. An activation of 8 then reconstructs as 4 after clipping. That illustrates range loss without assuming every FP8 format, kernel or scaling method behaves identically. Even values inside the range are rounded to available levels. A changed final answer can therefore arise without clipping, especially when two candidate next-token scores were close.
I would run the same prompts through the reference and quantized models with identical tokenization, template, decoding and weights. Start at the first divergent logits, not the final paragraph. Compare activation ranges and quantization error by layer and by phase. Does the error appear on prefill, after a long prefix, at a particular channel, or only once the KV cache is read? Record clipping rates and the scale used, along with the actual precision of each path. If the scales look fine, check kernel or cache conversion before increasing the calibration dataset blindly.
To isolate that effect, teacher-force the same reference continuation through both paths so earlier sampling differences do not change the later inputs. A logit is a score before probabilities are normalized. Find the first layer and token where the numerical difference becomes material, then inspect whether its scale, clipping or accumulation precision explains it. Repeat with the suspect path restored to higher precision. If parity returns, the intervention provides stronger evidence than a final-answer comparison. Report the affected task severity and the cost of that precision exception on a separate release set.
Average answer accuracy is a poor release gate for a rare but costly class. Build slices for long inputs, unusual scripts, tool syntax, numerical answers and known activation outliers. Recalibrate on representative traffic without leaking private prompts, or use a finer-grained scale or higher precision in the sensitive layers if the engine supports it. Quantization-aware training is another, much more expensive option. Compare quality at the same latency and memory budgets, including the throughput loss from the proposed fix. Keeping one narrow layer at higher precision can beat throwing away the entire speedup.
There is a second trap here. If we change the prompt set until this FP8 build passes, that set is no longer a clean final test. Preserve a separate holdout and track disagreement severity, not only total exact-match rate. A tiny average movement can hide a large regression in a small group of high-consequence prompts.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux