The Illusion of Equivalency: Statistical Characterization of Quantization Effects in LLMs
By Baha Rababah, Cuneyt Gurcan Akcora, Carson K. Leung
"Introduces correctness agreement metric to reveal behavioral divergence in quantized LLMs, even when accuracy is preserved, and analyzes layer-wise distortions showing query/key projections are most sensitive."
Abstract
Post-training quantization is widely used to deploy large language models in resource-constrained settings, yet its evaluation relies almost exclusively on accuracy and perplexity. We show that these metrics fail to capture behavioral changes induced by quantization. We introduce correctness agreement, a decision-level metric that measures overlap in correct predictions between a base model and its quantized variants, independent of absolute accuracy. Across multiple models and quantization schemes from 8-bit to 2-bit, we find that behavioral divergence emerges under moderate quantization even when task performance appears preserved. To explain this effect, we analyze quantization as a structural operator on attention weights and quantify layer-wise distortions using statistical and distributional measures. Our results reveal non-linear breakpoints at low bit-widths and show that query and key projections are consistently more sensitive than value and output projections. These findings expose an illusion of equivalence between base and quantized models and motivate behavioral evaluation beyond conventional performance metrics.
Technical Analysis & Implementation
Summary§
This paper challenges the reliance on accuracy and perplexity for evaluating quantized LLMs. It proposes correctness agreement (CA), a decision-level metric measuring overlap in correct predictions between a base model and its quantized variant. Across 8-bit to 2-bit quantization, CA drops significantly even when accuracy remains stable, revealing an illusion of equivalence. The authors also analyze quantization as a structural perturbation on attention weights, finding that query and key projections are consistently more sensitive than value and output projections, and identifying non-linear breakpoints at low bit-widths.
Core Methodology§
Correctness Agreement (CA)§
Let $M$ be the base model and $M_q$ be its quantized version. For a dataset $\mathcal{D}$, define the set of examples correctly predicted by $M$ as $C(M, \mathcal{D})$. Then CA is: $$\text{CA}(M, M_q, \mathcal{D}) = \frac{|C(M, \mathcal{D}) \cap C(M_q, \mathcal{D})|}{|C(M, \mathcal{D})|}.$$ This measures the fraction of base-model-correct examples that remain correct after quantization, decoupling from absolute accuracy.
Quantization as a Structural Operator§
The paper analyzes quantization's effect on attention weights. The self-attention mechanism computes: $$\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right) V.$$ Quantization introduces noise to weight matrices, affecting the projections $Q = XW_Q$, $K = XW_K$, $V = XW_V$, $O = \text{Attention}(Q,K,V)W_O$. Layer-wise distortion is quantified via statistical measures (e.g., KL divergence between original and quantized attention distributions) and distributional measures (e.g., Earth Mover's Distance).
Experimental Setup§
- Models: LLaMA-2 (7B, 13B), OPT (6.7B, 13B), GPT-J (6B).
- Quantization schemes: RTN (round-to-nearest), GPTQ, AWQ, from 8-bit down to 2-bit.
- Tasks: Commonsense reasoning (WinoGrande, Hellaswag), math (GSM8K), and classification (SST-2).
Key Findings§
1. CA reveals hidden divergence: At 4-bit quantization, accuracy drop is <1% for many tasks, but CA drops by 5–10%, indicating behavioral shifts. 2. Layer sensitivity: Query and key projections show consistently higher sensitivity (distortion) than value and output projections across all models and quantization levels. For example, the average KL divergence from base attention is 3× higher when quantizing $W_Q$ vs. $W_O$. 3. Non-linear breakpoints: Below 4-bit, CA and distortion metrics exhibit sharp transitions, suggesting chaotic behavior.
Code Snippet: Computing Correctness Agreement§
import torch
def correctness_agreement(base_model, quant_model, dataloader):
base_correct = set()
quant_correct = set()
for i, (inputs, targets) in enumerate(dataloader):
with torch.no_grad():
base_logits = base_model(inputs).logits
quant_logits = quant_model(inputs).logits
base_preds = base_logits.argmax(dim=-1)
quant_preds = quant_logits.argmax(dim=-1)
for idx, (bp, qp, t) in enumerate(zip(base_preds, quant_preds, targets)):
if bp == t:
base_correct.add(i * dataloader.batch_size + idx)
if qp == t:
quant_correct.add(i * dataloader.batch_size + idx)
intersection = base_correct & quant_correct
return len(intersection) / len(base_correct) if len(base_correct) > 0 else 0.0Implications§
Practitioners should not rely solely on accuracy/perplexity when selecting quantized models. The proposed CA metric provides a more faithful behavioral evaluation. Additionally, allocating more bits to query/key projections could mitigate behavioral divergence.
Interactive LLM Token & Cost Calculator
Estimate token usage and model pricing. Enter your prompt below to see how it is parsed into tokens and calculate the exact API cost for different providers.
Cost Breakdown (USD)
API Pricing Comparison (per Million Tokens)
| Model | Input | Output |
|---|---|---|
| GPT-5.5 Pro | $30.00 | $180.00 |
| GLM 4.7 Flash | $0.06 | $0.40 |
| o3 Mini | $1.10 | $4.40 |
| GPT-5.2-Codex | $1.75 | $14.00 |
| DeepSeek V3.1 | $0.21 | $0.79 |
| GPT-4o-mini | $0.15 | $0.60 |
| Mistral Medium 3.1 | $0.40 | $2.00 |
| MiniMax M1 | $0.40 | $2.20 |
| Gemini 2.5 Flash | $0.30 | $2.50 |
| o3 Pro | $20.00 | $80.00 |
| Gemini 2.5 Pro Preview 06-05 | $1.25 | $10.00 |
| Claude Sonnet 5 | $2.00 | $10.00 |
| Claude Opus 4.8 | $5.00 | $25.00 |
| Qwen Plus 0728 (thinking) | $0.26 | $0.78 |
| Claude Opus 4 | $15.00 | $75.00 |
| o4 Mini | $1.10 | $4.40 |
| GPT-4.1 Mini | $0.40 | $1.60 |
| Claude Opus 4.7 | $5.00 | $25.00 |
| Claude Opus 4.6 | $5.00 | $25.00 |
| Claude Opus 4.5 | $5.00 | $25.00 |
| Claude Opus 4.7 (Fast) | $30.00 | $150.00 |
| o1 | $15.00 | $60.00 |
| Gemini 3.1 Flash Lite | $0.25 | $1.50 |
| GPT-4o (2024-11-20) | $2.50 | $10.00 |
| GLM 4.5V | $0.60 | $1.80 |
| GPT-5 Chat | $1.25 | $10.00 |
| Mistral Large 2407 | $2.00 | $6.00 |
| GPT Chat Latest | $5.00 | $30.00 |
| GPT-5 Nano | $0.05 | $0.40 |
| Claude Sonnet 4.6 | $3.00 | $15.00 |
| gpt-oss-120b | $0.04 | $0.18 |
| GPT-5 Mini | $0.25 | $2.00 |
| MoonshotAI Kimi Latest | $0.66 | $3.41 |
| Google Gemini Flash Latest | $1.50 | $9.00 |
| Qwen2.5 7B Instruct | $0.04 | $0.10 |
| GPT-5.3-Codex | $1.75 | $14.00 |
| Llama 3.2 3B Instruct | $0.05 | $0.33 |
| Gemini 3.1 Pro Preview | $2.00 | $12.00 |
| Qwen3.5 Plus 2026-02-15 | $0.26 | $1.56 |
| Claude Haiku 4.5 | $1.00 | $5.00 |
| Gemini 3.1 Flash | $0.25 | $1.50 |
| Gemini 2.5 Pro | $1.25 | $10.00 |
| Qwen2.5 72B Instruct | $0.36 | $0.40 |
| Command R (08-2024) | $0.15 | $0.60 |
| Mistral Nemo | $0.02 | $0.03 |
| GPT-4o-mini (2024-07-18) | $0.15 | $0.60 |
| GPT-5.6 Luna Pro | $1.00 | $6.00 |
| GPT-5.6 Luna | $1.00 | $6.00 |
| GPT-5.6 Terra Pro | $2.50 | $15.00 |
| GPT-5.6 Terra | $2.50 | $15.00 |
| Mistral Large | $2.00 | $6.00 |
| Llama 4 Maverick | $0.15 | $0.60 |
| GPT-3.5 Turbo (older v0613) | $1.00 | $2.00 |
| Kimi K2.6 | $0.66 | $3.41 |
| Llama 3.2 11B Vision | $0.34 | $0.34 |
| Llama 4 Scout | $0.10 | $0.30 |
| GPT-4o (2024-05-13) | $5.00 | $15.00 |
| Command R+ | $2.50 | $10.00 |
| Mixtral 8x22B Instruct | $2.00 | $6.00 |
| Llama 3 8B Instruct | $0.14 | $0.14 |
| GPT-4 Turbo Preview | $10.00 | $30.00 |
| GLM 4.5 Air | $0.13 | $0.85 |
| Grok 4.20 | $1.25 | $2.50 |
| MiniMax M2.7 | $0.24 | $0.96 |
| GPT-5.4 Nano | $0.20 | $1.25 |
| GLM 5 | $0.60 | $1.92 |
| Claude 3 Haiku | $0.25 | $1.25 |
| Qwen3 Coder 480B A35B | $0.22 | $1.80 |
| UI-TARS 7B | $0.10 | $0.20 |
| Mistral Small 3 | $0.07 | $0.20 |
| Qwen3 30B A3B Instruct 2507 | $0.05 | $0.19 |
| GPT-5.5 | $5.00 | $30.00 |
| Mistral Small 4 | $0.15 | $0.60 |
| GPT-5 | $1.25 | $10.00 |
| GLM 5 Turbo | $1.20 | $4.00 |
| GPT-4o | $2.50 | $10.00 |
| Qwen3 Coder Next | $0.11 | $0.80 |
| DeepSeek R1 | $0.70 | $2.50 |
| Qwen3 Max Thinking | $0.78 | $3.90 |
| MiniMax M2-her | $0.30 | $1.20 |
| GPT Audio | $2.50 | $10.00 |
| DeepSeek V3.1 Terminus | $0.27 | $0.95 |
| Qwen3 30B A3B Thinking 2507 | $0.13 | $1.56 |
| ERNIE 4.0 | $1.20 | $2.40 |
| Mixtral 8x22B | $0.50 | $1.00 |
| Claude Fable 5 | $10.00 | $50.00 |
| Qwen3.7 Plus | $0.32 | $1.28 |
| Mistral Small 3.2 24B | $0.07 | $0.20 |
| Gemma 3n 4B | $0.06 | $0.12 |
| Gemini 2.5 Pro Preview 05-06 | $1.25 | $10.00 |
| Grok 4.3 | $1.25 | $2.50 |
| gpt-oss-20b | $0.03 | $0.14 |
| MiniMax M3 | $0.30 | $1.20 |
| Claude Opus 4.1 | $15.00 | $75.00 |
| o3 | $2.00 | $8.00 |
| Step 3.7 Flash | $0.20 | $1.15 |
| Claude Opus 4.8 (Fast) | $10.00 | $50.00 |
| Qwen3.7 Max | $1.25 | $3.75 |
| Step 3.5 Flash | $0.10 | $0.30 |
| Kimi K2.5 | $0.38 | $2.02 |
| DeepSeek V3.2 | $0.21 | $0.32 |
| Gemini 3.1 Pro | $2.00 | $12.00 |
| Gemini 3.5 Flash | $1.50 | $9.00 |
| Nano Banana Pro (Gemini 3 Pro Image Preview) | $2.00 | $12.00 |
| Llama 3.1 8B | $0.04 | $0.04 |
| GPT-5.1 | $1.25 | $10.00 |
| Qwen3 8B | $0.12 | $0.46 |
| GLM 5V Turbo | $1.20 | $4.00 |
| Grok 4.20 Multi-Agent | $1.25 | $2.50 |
| GPT-4.1 | $2.00 | $8.00 |
| GPT-5 Image Mini | $2.50 | $2.00 |
| Llama 3.3 70B Instruct | $0.10 | $0.32 |
| Mistral Large 3 | $0.50 | $1.50 |
| Command R | $0.15 | $0.60 |
| DeepSeek V4 Pro | $0.43 | $0.87 |
| Grok 4.20 | $1.25 | $2.50 |
| DeepSeek V3 0324 | $0.24 | $0.90 |
| o1-pro | $150.00 | $600.00 |
| Qwen 2.5-Coder 32B | $0.35 | $0.70 |
| GPT-5.4 Mini | $0.75 | $4.50 |
| Seed-2.0-Mini | $0.10 | $0.40 |
| Yi-Lightning | $0.15 | $0.30 |
| Qwen3.5-122B-A10B | $0.26 | $2.08 |
| Qwen3.5-Flash | $0.07 | $0.26 |
| GPT Audio Mini | $0.60 | $2.40 |
| Qwen Plus 0728 | $0.26 | $0.78 |
| Qwen3 235B A22B Thinking 2507 | $0.15 | $1.50 |
| Doubao Pro | $0.80 | $1.60 |
| Mistral Large 2 | $0.60 | $1.80 |
| Seed-2.0-Lite | $0.25 | $2.00 |
| Qwen3.5 397B A17B | $0.39 | $2.45 |
| MiniMax M2.5 | $0.15 | $0.90 |
| GPT-5.1 Chat | $1.25 | $10.00 |
| GPT-5.1-Codex | $1.25 | $10.00 |
| Kimi K2 0711 | $0.57 | $2.30 |
| Mistral Small 3.1 24B | $0.35 | $0.56 |
| GPT-5.6 Sol Pro | $5.00 | $30.00 |
| GPT-5.6 Sol | $5.00 | $30.00 |
| Nano Banana 2 (Gemini 3.1 Flash Image) | $0.50 | $3.00 |
| Llama 3.1 405B | $0.80 | $0.80 |
| DeepSeek V4 Flash | $0.08 | $0.15 |
| GPT-5.1-Codex-Max | $1.25 | $10.00 |
| Ministral 3 14B 2512 | $0.20 | $0.20 |
| Mistral Medium 3 | $0.40 | $2.00 |
| Hy3 preview | $0.06 | $0.21 |
| Seed 1.6 Flash | $0.07 | $0.30 |
| MiniMax M2 | $0.26 | $1.02 |
| Qwen3 VL 32B Instruct | $0.10 | $0.42 |
| GPT-4.1 Nano | $0.10 | $0.40 |
| Qwen3 VL 8B Instruct | $0.12 | $0.46 |
| Llama 4 Maverick | $0.15 | $0.60 |
| GPT-5 Image | $10.00 | $10.00 |
| Hunyuan Pro | $0.60 | $1.20 |
| Grok 4.5 | $2.00 | $6.00 |
| Google Gemini Pro Latest | $2.00 | $12.00 |
| Qwen3.6 35B A3B | $0.14 | $1.00 |
| Qwen3.6 Max Preview | $1.04 | $6.24 |
| Qwen 2.5 72B | $0.40 | $0.80 |
| Ministral 3 8B 2512 | $0.15 | $0.15 |
| GLM 5.1 | $0.97 | $3.04 |
| GPT-5.4 Image 2 | $8.00 | $15.00 |
| Gemma 4 26B A4B | $0.06 | $0.33 |
| Claude Opus Latest | $5.00 | $25.00 |
| o3 Deep Research | $10.00 | $40.00 |
| o4 Mini Deep Research | $2.00 | $8.00 |
| Nano Banana 2 (Gemini 3.1 Flash Image Preview) | $0.50 | $3.00 |
| Qwen3.5-35B-A3B | $0.14 | $1.00 |
| Claude Sonnet 4.5 | $3.00 | $15.00 |
| Llama Guard 4 12B | $0.18 | $0.18 |
| Qwen3 30B A3B | $0.12 | $0.50 |
| Gemma 3 4B | $0.05 | $0.10 |
| Gemma 4 31B | $0.12 | $0.35 |
| Qwen3.6 Plus | $0.33 | $1.95 |
| Qwen3.5-9B | $0.10 | $0.15 |
| GLM 4.7 | $0.40 | $1.75 |
| Gemini 3 Flash Preview | $0.50 | $3.00 |
| GPT-5.2 Chat | $1.75 | $14.00 |
| Ministral 3 3B 2512 | $0.10 | $0.10 |
| R1 0528 | $0.50 | $2.15 |
| Nano Banana (Gemini 2.5 Flash Image) | $0.30 | $2.50 |
| Qwen3 VL 30B A3B Thinking | $0.13 | $1.56 |
| Qwen3 VL 30B A3B Instruct | $0.13 | $0.52 |
| Claude 3.5 Sonnet v2 | $3.00 | $15.00 |
| Gemini 2.0 Flash | $0.10 | $0.40 |
| GPT-5.4 Pro | $30.00 | $180.00 |
| GPT-5.4 | $2.50 | $15.00 |
| GPT-5 Pro | $15.00 | $120.00 |
| GLM 4.6 | $0.43 | $1.74 |
| Qwen3 Max | $0.78 | $3.90 |
| GLM 5.2 | $0.42 | $1.32 |
| GPT-5.3 Chat | $1.75 | $14.00 |
| Gemini 3.1 Flash Lite Preview | $0.25 | $1.50 |
| Qwen3.5-27B | $0.20 | $1.56 |
| Gemini 3.1 Pro Preview Custom Tools | $2.00 | $12.00 |
| Hunyuan A13B Instruct | $0.14 | $0.57 |
| Hy3 | $0.14 | $0.58 |
| Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image) | $0.25 | $1.50 |
| Nano Banana Pro (Gemini 3 Pro Image) | $2.00 | $12.00 |
| Kimi K2.7 Code | $0.72 | $3.50 |
| GLM 4.6V | $0.30 | $0.90 |
| Codestral 2508 | $0.30 | $0.90 |
| Claude Fable Latest | $10.00 | $50.00 |
| Qwen3 Coder 30B A3B Instruct | $0.07 | $0.27 |
| KAT-Coder-Pro V2 | $0.30 | $1.20 |
| Seed 1.6 | $0.25 | $2.00 |
| GPT-5.2 Pro | $21.00 | $168.00 |
| Grok Build 0.1 | $1.00 | $2.00 |
| Mistral Medium 3.5 | $1.50 | $7.50 |
| Anthropic Claude Haiku Latest | $1.00 | $5.00 |
| Anthropic Claude Sonnet Latest | $2.00 | $10.00 |
| Qwen3.5 Plus 2026-04-20 | $0.30 | $1.80 |
| Qwen3.6 Flash | $0.19 | $1.13 |
| Qwen3.6 27B | $0.28 | $2.40 |
| DeepSeek V3.2 Exp | $0.27 | $0.41 |
| Kimi K2 0905 | $0.60 | $2.50 |
| Gemma 3 12B | $0.05 | $0.15 |
| Command A | $2.50 | $10.00 |
| Lyria 3 Pro Preview | $0.00 | $0.00 |
| Lyria 3 Clip Preview | $0.00 | $0.00 |
| GPT-5.2 | $1.75 | $14.00 |
| Devstral 2 2512 | $0.40 | $2.00 |
| GPT-5 Codex | $1.25 | $10.00 |
| GLM 4.5 | $0.60 | $2.20 |
| Gemini 2.5 Flash Lite | $0.10 | $0.40 |
| GPT-4o-mini Search Preview | $0.15 | $0.60 |
| GPT-4o Search Preview | $2.50 | $10.00 |
| Mistral Large 3 2512 | $0.50 | $1.50 |
| Qwen3 235B A22B Instruct 2507 | $0.09 | $0.10 |
| Qwen3 32B | $0.08 | $0.28 |
| MiniMax M2.1 | $0.30 | $1.20 |
| GPT-3.5 Turbo | $0.50 | $1.50 |
| GPT-5.1-Codex-Mini | $0.25 | $2.00 |
| Qwen-Plus | $0.26 | $0.78 |
| DeepSeek V3 | $0.20 | $0.80 |
| Command R7B (12-2024) | $0.04 | $0.15 |
| Llama 3.3 70B Instruct | $0.10 | $0.32 |
| Qwen2.5 Coder 32B Instruct | $0.66 | $1.00 |
| GPT-4o (2024-08-06) | $2.50 | $10.00 |
| Llama 3.1 8B Instruct | $0.02 | $0.03 |
| Kimi K2 Thinking | $0.60 | $2.50 |
| Voxtral Small 24B 2507 | $0.10 | $0.30 |
| gpt-oss-safeguard-20b | $0.07 | $0.30 |
| Qwen3 VL 8B Thinking | $0.12 | $1.36 |
| Llama 3.1 70B Instruct | $0.40 | $0.40 |
| Gemini 2.5 Flash Lite Preview 09-2025 | $0.10 | $0.40 |
| R1 Distill Llama 70B | $0.80 | $0.80 |
| R1 | $0.70 | $2.50 |
| MiniMax-01 | $0.20 | $1.10 |
| Qwen3 VL 235B A22B Thinking | $0.26 | $2.60 |
| Qwen3 VL 235B A22B Instruct | $0.20 | $0.88 |
| Qwen3 Coder Plus | $0.65 | $3.25 |
| Qwen3 Coder Flash | $0.20 | $0.97 |
| Qwen3 Next 80B A3B Thinking | $0.10 | $0.78 |
| Qwen3 Next 80B A3B Instruct | $0.09 | $1.10 |
| Qwen2.5 VL 72B Instruct | $0.25 | $0.75 |
| ERNIE 4.5 VL 424B A47B | $0.42 | $1.25 |
| Claude Sonnet 4 | $3.00 | $15.00 |
| Qwen3 14B | $0.10 | $0.24 |
| Qwen3 235B A22B | $0.46 | $1.82 |
| o4 Mini High | $1.10 | $4.40 |
| Gemma 2 27B | $0.65 | $0.65 |
| Gemma 3 27B | $0.08 | $0.16 |
| Saba | $0.20 | $0.60 |
| o3 Mini High | $1.10 | $4.40 |
| Llama 3.2 1B Instruct | $0.03 | $0.20 |
| Llama 3.2 11B Vision Instruct | $0.34 | $0.34 |
| GPT-4 Turbo | $10.00 | $30.00 |
| GPT-3.5 Turbo Instruct | $1.50 | $2.00 |
| GPT-3.5 Turbo 16k | $3.00 | $4.00 |
| GPT-4 | $30.00 | $60.00 |