TL;DR
This paper investigates how quantizing Large Language Models (LLMs) to lower precision (like 4-bit) impacts their confidence in predictions. They found that quantization can decrease confidence, especially for examples the original model was already uncertain about, and can amplify existing calibration issues. This highlights the need to consider model confidence when deploying quantized LLMs.
What Problem Does This Paper Address?
Large Language Models (LLMs) are incredibly powerful but also computationally expensive, requiring significant memory and processing power. Quantization, a technique that reduces the precision of model weights, offers a way to make LLMs more efficient by decreasing their size and speeding up inference. While effective for compression, prior research has hinted that quantization might negatively affect LLM performance and introduce biases. However, a deeper understanding of how quantization impacts the confidence of these models, particularly how they express certainty in their predictions, has been lacking. This paper aims to fill that gap by systematically analyzing the effect of post-training quantization on LLM confidence and calibration across various models and datasets.
Methods
The researchers employed a post-training quantization technique called GPTQ (Generalized Post-Training Quantization), specifically using a 4-bit configuration. GPTQ is an iterative weight quantization method that aims to minimize approximation errors and accelerate inference.
For evaluation, they focused on zero-shot settings, meaning the models were tested directly without any further fine-tuning. This approach isolates the impact of quantization itself. They measured performance using:
- Accuracy (Acc.): The standard measure of how often the model predicts correctly.
- Calibration Error (CE): This assesses how well a model's predicted probabilities reflect the true likelihood of an outcome. They used Expected Calibration Error (ECE) for binary tasks and Adaptive Calibration Error (ACE) for multi-class tasks.
- Confidence Metrics: They specifically analyzed:
- Conf.: The mean confidence in predictions.
- Conferr: The mean confidence when the model makes an incorrect prediction.
- Conftrue: The mean confidence when the model makes a correct prediction.
- Jensen-Shannon Divergence (JSD): To measure the dissimilarity between the probability distributions of the full (unquantized) and quantized models.
- Predictive Entropy (H): As a measure of model uncertainty.
Datasets
The study evaluated LLMs on six standard commonsense reasoning datasets:
- ARC EASY: Science fact knowledge.
- BOOLQ: Question answering involving reading comprehension.
- PIQA: Physical commonsense reasoning.
- HELLASWAG: Natural text entailment.
- OBQA (OpenBookQA): Science fact knowledge.
- XSTORY-EN: Natural text entailment.
These datasets were chosen to cover a range of linguistic inference abilities.
Key Insights and Ideas
- Quantization amplifies existing calibration issues: The study found that quantization tends to worsen pre-existing calibration errors in LLMs, rather than fixing them.
- Confidence drops most where it's already low: Quantization disproportionately affects samples where the original, full-precision model was already uncertain. This suggests that quantization doesn't just uniformly reduce confidence, but rather exacerbates uncertainty in already ambiguous cases.
- Overconfidence persists: Even after quantization, LLMs tend to remain overconfident, particularly in their incorrect predictions.
- Model family and scale matter: The impact of quantization on confidence varies significantly across different LLM families (e.g., BLOOM, OPT, Mistral, LLaMA) and their sizes, indicating that pre-training and architecture play a role in quantization susceptibility.
- JSD decreases with scale: Larger models show less dissimilarity in their probability distributions after quantization compared to smaller models, suggesting that scale might offer some resilience to quantization's impact on output distributions.
Key Results
- Quantization with GPTQ to 4-bit generally leads to a decrease in confidence for correct predictions.
- The calibration error (CE) increases after quantization across most models and benchmarks. For instance, LLaMA-7B saw a ~10% increase in calibration error on the HELLASWAG dataset.
- Models exhibit overconfidence, with average confidence levels around ~0.95 for incorrect predictions, both before and after quantization.
- Entropy (uncertainty) increases for quantized LLMs, reflecting a greater variance across answers.
- The Jensen-Shannon distances between full and quantized models decrease as model size increases, with LLaMA-7B being an exception.
Limitations and Future Work
- Limited Quantization Method: The study exclusively used 4-bit GPTQ. Future work could explore other quantization factors (e.g., 2-bit, 3-bit) and training-aware quantization approaches.
- Zero-Shot Evaluation: While this isolates quantization's effect, future work could investigate few-shot analysis, which might reveal different impacts on confidence and quantization loss.
- Generative Tasks: The current analysis focuses on classification tasks. Extending the analysis to generative tasks, by examining token-level predictions rather than just label predictions, is a promising direction.
- Integrating Calibration: The authors suggest that future work could focus on calibrating LLMs, particularly for uncertain examples, and potentially integrating calibration techniques (like temperature scaling) directly into the quantization pipeline.
- Benchmarking based on Confidence Shifts: The observed varying susceptibility to quantization across model families suggests a direction for future research in benchmarking LLMs based on their response to quantization-induced confidence shifts.
Summary updated