Sensitivity
Sensitivity measures how much a model's output changes in response to small changes in its input. In local AI, sensitivity is relevant when evaluating how robust a quantized model is: a highly sensitive model may produce different answers after quantization, especially at low bit widths. Operators encounter sensitivity when comparing Q4 vs Q8 outputs for the same prompt—higher sensitivity means the quantized model diverges more from the original.
Deeper dive
Sensitivity is often analyzed per layer or per weight group. In quantization, sensitivity tells you which parts of the model are most affected by reduced precision. Techniques like GPTQ and AWQ use sensitivity metrics to decide which weights to quantize with higher precision. For operators, understanding sensitivity helps in choosing quantization methods: a model with high sensitivity to weight perturbations may benefit from mixed-precision quantization or a higher bit width. Sensitivity also relates to adversarial robustness—small input perturbations (e.g., typos) causing large output changes indicate a sensitive model, which may be less reliable in production.
Practical example
When quantizing Llama 3.1 8B from FP16 to Q4, an operator might run the same prompt (e.g., "What is the capital of France?") before and after. If the Q4 model answers "Paris" but the FP16 model answers "Paris is the capital"—that's low sensitivity. If the Q4 model answers "London", the model is highly sensitive to that quantization. Tools like llama.cpp's --perplexity can quantify sensitivity by measuring perplexity change.
Workflow example
In llama.cpp, after quantizing a model with ./quantize model.gguf Q4_K_M, an operator can compare outputs by running ./main -m model.gguf -p "What is the capital of France?" and noting differences from the original. For systematic sensitivity analysis, use ./perplexity -m model.gguf -f test.txt to compute perplexity; a large increase indicates high sensitivity to quantization. In Hugging Face Transformers, sensitivity can be probed by adding small noise to inputs and measuring output logit changes.
Reviewed by Fredoline Eruo. See our editorial policy.