Behavioral Capacity Certificates for Quantized Language Models
Organizations: Department of Electrical and Computer Engineering University of Illinois Chicago
Abstract
Activation and key-value cache precision change what a quantized language model computes without altering its stored weights. Direct weight-code bounds, however, assign identical complexity to deployments that behave differently and charge separately for weight codes that behave identically. Behavioral Capacity Certificates (BCC) charge for behavior using the aggregate prior mass of complete implementations---weights, scales, activation and cache rules---that induce the same bounded loss. When quantization merges implementations, this shared mass lowers the complexity penalty, and a break-even law determines when the saving survives the cost of validating it. BCC supports a three-step deployment workflow, and our experiments verify each step. First, a forward-only screen shortlists per-layer bit-widths by how often candidate perturbations preserve the reference predictions, with quality comparable to Hessian-guided selection at lower preprocessing cost. Second, margin-certified cells identify weights that can be pruned or sign-flipped without changing the deployed behavior: every permitted combination preserves all declared predictions, and on OLMoE-1B-7B and SmolLM2-1.7B, independent probes bound the probability that any permitted combination changes a prediction on new text. Third, BCC bounds the population loss of the deployed model, nonvacuously for complete decoders and more tightly than the compressed-code route. At equal cache memory, giving keys higher precision than values yields lower NLL and higher prediction agreement on GPT-2, Qwen2.5, and SmolLM2, together with a tighter complexity bound in the GPT-2 audit.
Figures & tables
| Weights | A4 fiber/total | A8 fiber/total | Pooled prior mass | Direct cost | BCC cost |
|---|---|---|---|---|---|
| Binary | 10.000 | 8.415 | |||
| Ternary | 15.265 | 11.943 |
| Format | Seed | (bits) | Literal | Compressed | BCC |
|---|---|---|---|---|---|
| W4/A4 | 191 | 3206.4 | 0.6838 | 0.6328 | 0.6017 |
| W4/A8 | 191 | 1459.3 | 0.7044 | 0.6647 | 0.6505 |
| W4/A4 | 193 | 3107.1 | 0.6802 | 0.6285 | 0.5985 |
| W4/A8 | 193 | 1550.2 | 0.7177 | 0.6723 | 0.6572 |
| W4/A4 | 197 | 3125.0 | 0.6839 | 0.6355 | 0.6052 |
| W4/A8 | 197 | 1440.6 | 0.6810 | 0.6363 | 0.6224 |
| Cache | MiB/stream | NLL (nats) | Agree. (%) | (bits) |
|---|---|---|---|---|
| FP16/FP16 | 36.000 | 3.2137 | 100.00 | 1079.91 |
| K8/V8 | 19.125 | 3.2135 | 99.22 | 398.19 |
| K4/V8 | 14.625 | 3.2966 | 85.06 | 405.07 |
| K8/V4 | 14.625 | 3.2139 | 95.80 | 593.00 |
| K4/V4 | 10.125 | 3.2868 | 84.38 | 599.88 |
| Cache | Failed prefixes | Risk upper (%) | Magnitude advantage (pp) | Activation-cost advantage (pp) | Cache saved (%) |
|---|---|---|---|---|---|
| K8/V8 | 4/8192 | 0.217 | 0.978 | 0.689 | 48.44 |
| K8/V4 | 6/8192 | 0.260 | 0.823 | 0.625 | 60.94 |
| Disagreement (%) | NLL | |||
|---|---|---|---|---|
| Selector | Shakespeare | Alice | Shakespeare | Alice |
| BFMS: natural contexts | 39.61 | 39.90 | 0.3936 | 0.3415 |
| HAWQ-style trace | 40.40 | 40.38 | 0.3974 | 0.3441 |
| Covariance-aware Hessian | 40.12 | 40.38 | 0.3907 | 0.3402 |
| Weight-MSE | 45.56 | 45.72 | 0.6340 | 0.5307 |
Appendix figures & tables28 assets
Supplementary material from the paper’s appendix.
Appendix
| Main result | Proof or construction | Page |
|---|---|---|
| Proposition 2.3 | Fixed-routing factorization and feasible-set inclusion | A.2 |
| Theorem 2.1 ; Corollary 2.2 | Countable behavioral prior and positive damage | A.3 |
| Theorem 2.4 | Shared PAC–Bayes event and independent transfer | A.3 |
| Proposition 2.5 | Exact inversion of the comparison | A.3 |
| Corollary 2.6 | Strict probe-budget threshold and integer rounding | A.3 |
| Proposition 4.1 | Simultaneous coordinate edits and half-margin budgets | A.4 |
| Task seed | Coding prior | ||||
|---|---|---|---|---|---|
| 110 | Uniform | 11.000 | 9.366 | 0.02318 | 0.02101 |
| 110 | Huffman | 10.000 | 8.656 | 0.02185 | 0.02007 |
| 49 | Uniform | 16.265 | 12.943 | 0.03012 | 0.02574 |
| 49 | Huffman | 13.000 | 11.046 | 0.02582 | 0.02324 |
| Seed | Formats | Mass | Failures | Risk upper | ||
|---|---|---|---|---|---|---|
| 1 | 22 | 0.08594 | 3.541 | 4.459 | 116/8192 | 1.721% |
| 2 | 29 | 0.11328 | 3.142 | 4.858 | 97/8192 | 1.466% |
| 3 | 18 | 0.07031 | 3.830 | 4.170 | 127/8192 | 1.868% |
| Format | Seed | Test error | Test NLL | ||||
|---|---|---|---|---|---|---|---|
| W4/A4 | 191 | 53,632 | 0.00000 | 0.08855 | 0.07418 | 0.06775 | 0.06383 |
| W4/A8 | 191 | 54,816 | 0.00040 | 0.09309 | 0.07520 | 0.07020 | 0.06842 |
| W4/A4 | 193 | 53,560 | 0.00000 | 0.08796 | 0.07418 | 0.06766 | 0.06387 |
| W4/A8 | 193 | 54,248 | 0.00080 | 0.09678 | 0.07767 | 0.07196 | 0.07006 |
| W4/A4 | 197 | 53,896 | 0.00000 | 0.08858 | 0.07427 | 0.06816 | 0.06434 |
| W4/A8 | 197 | 54,280 | 0.00000 | 0.08810 | 0.07418 | 0.06854 | 0.06678 |
| Format | Seed | (bits) | Empirical | Raw | Compressed | BCC |
|---|---|---|---|---|---|---|
| W4/A4 | 1 | 6840.5 | 3.5146 | 5.3340 | 5.3138 | 5.2446 |
| W4/A8 | 1 | 2645.6 | 3.3011 | 5.1139 | 5.0936 | 5.0670 |
| W4/A4 | 2 | 6986.0 | 3.6270 | 5.4485 | 5.4289 | 5.3585 |
| W4/A8 | 2 | 2589.3 | 3.2965 | 5.1091 | 5.0893 | 5.0633 |
| W4/A4 | 3 | 6804.5 | 3.4993 | 5.3183 | 5.2978 | 5.2290 |
| W4/A8 | 3 | 2657.0 | 3.2776 | 5.0894 | 5.0688 | 5.0421 |
| Audit | Format | Probes | (bits) | ||
|---|---|---|---|---|---|
| Decoder: exact 0–1 | T/A8 | 20,000 | 12.000 | 0.02868 | 0.02035–0.02060 |
| Decoder: Brier | T/A8 | 20,000 | 12.000 | 0.02890–0.03022 | 0.02065–0.02215 |
| GPT-2 FFN | W1/A4 | 1,024 | 13.559 | 0.08062 | 0.07256 |
| GPT-2 FFN | W1/A8 | 1,024 | 13.930 | 0.07851 | 0.06988 |
| GPT-2 FFN | T/A4 | 1,024 | 14.820 | 0.08094 | 0.07058 |
| GPT-2 FFN | T/A8 | 1,024 | 15.116 | 0.07984 | 0.06863 |
| Loss | Seed | Gain | |||||
|---|---|---|---|---|---|---|---|
| 0–1 | 89 | 0 | 0.02868 | 0.02060 | 0.00808 | ||
| 0–1 | 97 | 0 | 0.02868 | 0.02035 | 0.00832 | ||
| 0–1 | 101 | 0 | 0 | 0.02868 | 0.02035 | 0.00833 | |
| Brier | 89 | 0.02958 | 0.02148 | 0.00810 | |||
| Brier | 97 | 0.03022 | 0.02215 | 0.00807 | |||
| Brier | 101 | 0.02890 | 0.02065 | 0.00825 |
| Format | (Mbit) | (bits) | |||
|---|---|---|---|---|---|
| W1/A4 | 4.719 | 13.559 | 0.00595 | 0.08062 0.07256 | |
| W1/A8 | 4.719 | 13.930 | 0.00601 | 0.07851 0.06988 | |
| W1.58/A4 | 7.479 | 14.820 | 0.00594 | 0.08094 0.07058 | |
| W1.58/A8 | 7.479 | 15.116 | 0.00564 | 0.07984 0.06863 |
| Shakespeare | Alice | |||||
|---|---|---|---|---|---|---|
| Selector | Disag. (%) | err. (pp) | NLL | Disag. (%) | err. (pp) | NLL |
| BFMS: natural contexts | 39.61 | 8.27 | 0.3936 | 39.90 | 7.35 | 0.3415 |
| BFMS: unigram-random | 39.50 | 8.24 | 0.3912 | 39.74 | 7.28 | 0.3392 |
| BFMS: uniform-random | 40.06 | 8.34 | 0.3901 | 40.40 | 7.37 | 0.3384 |
| BFMS: Gaussian noise | 39.97 | 8.34 | 0.3906 | 40.38 | 7.31 | 0.3387 |
| Mean escape: natural contexts | 39.26 | 8.23 | 0.3900 | 39.51 | 7.28 | 0.3393 |
| Weights | Selection rule | Blocks | ||||
|---|---|---|---|---|---|---|
| W1 | Positive damage | 3,8,10 | 0.06479 | 0.06042 | 0.04948 | 0.38234 |
| W1 | Teacher-JS | 7,9,10 | 0.06867 | 0.06419 | 0.05288 | 0.39389 |
| W1 | HAWQ-V2 score | 3,8,9 | 0.06706 | 0.06262 | 0.05151 | 0.40241 |
| Ternary | Positive damage | 1,6,9 | 0.04973 | 0.04586 | 0.03604 | 0.25209 |
| Ternary | Teacher-JS | 3,6,9 | 0.05041 | 0.04652 | 0.03659 | 0.25623 |
| Ternary | HAWQ-V2 score | 3,8,9 | 0.05094 | 0.04703 | 0.03742 | 0.25424 |
| Stage | Weights | Rule | / blocks | |||
|---|---|---|---|---|---|---|
| C | W1 | Public behavioral calibration | / 3,8,10 | 0.08752 | 0.04260 | 0.31213 |
| C | W1 | Unit = checkpoint MSE | / 3,8,10 | 0.09219 | 0.04807 | 0.37546 |
| C | T | Public behavioral calibration | / 1,6,9 | 0.07484 | 0.03365 | 0.21646 |
| C | T | Unit | / 1,6,9 | 0.07735 | 0.03493 | 0.23384 |
| C | T | Checkpoint MSE | / 1,6,9 | 0.07852 | 0.03582 | 0.25464 |
| D | W1 | Calibrated sequential BCC | / 1,7,9 | 0.11124 | 0.03696 | 0.22617 |
| Tolerance | .100 | .125 | .150 | .175 | .200 | .225 | .250 | .275 | .300 | .325 | .350 | .375 | .400 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Raw | 0 | 0 | 2 | 16 | 26 | 43 | 52 | 64 | 75 | 85 | 92 | 97 | 100 |
| Full mass | 0 | 0 | 4 | 17 | 30 | 44 | 53 | 65 | 79 | 87 | 94 | 97 | 100 |
| Error | Format | (bits) | Changes | |
|---|---|---|---|---|
| 0.82772 | W1/A8 | 50,623 | 50,623.0 | 0 |
| 0.75770 | T/A8 | 47,676 | 75,564.7 | 0 |
| Pruning: prediction changes | Sign flips: failed patterns | ||
|---|---|---|---|
| Selection | W1/A8 | T/A8 | Out of 16,384 trials |
| Certified cell/bank | 0 | 0 | 0 |
| RMS activation | 57 | 91 | 16,384 |
| Max activation | 2,218 | 72 | 16,384 |
| Setting | Head upper | Deployment signed mean | Deployment signed upper | Measured edit envelope | Edit-loss upper |
|---|---|---|---|---|---|
| BASE | 0.026965 | +0.000000 | 0.000000 | 0.0001277 | 0.023285 |
| K8/V8 | 0.026965 | -0.000344 | 0.026288 | 0.0001276 | 0.023284 |
| K8/V4 | 0.026965 | +0.006865 | 0.033662 | 0.0001280 | 0.023287 |
| Failed prefixes | Lower advantage (pp) | ||||
|---|---|---|---|---|---|
| Setting | Selected | Magnitude | Activation cost | Magnitude | Activation cost |
| BASE | 5 | 133 | 107 | 0.915 | 0.675 |
| K8/V8 | 4 | 137 | 106 | 0.978 | 0.689 |
| K8/V4 | 6 | 125 | 103 | 0.823 | 0.625 |
| Cache | Failed prefixes | Risk upper (%) | Added clipped NLL upper | Cache saved (%) |
|---|---|---|---|---|
| BASE K16/V16 | 4/8192 | 0.228 | 0.024867 | 0.000 |
| K8/V8 | 0/8192 | 0.121 | 0.024867 | 46.875 |
| K8/V4 | 7/8192 | 0.292 | 0.024873 | 59.375 |
| All patterns | Full pruning | |||
|---|---|---|---|---|
| Bank | K8/V8 | K8/V4 | K8/V8 | K8/V4 |
| Margin-selected | 0 | 7 | 0 | 1 |
| Magnitude | 439 | 424 | 43 | 48 |
| Activation cost | 61 | 69 | 15 | 16 |
| Random | 4971 | 4990 | 1015 | 1023 |
| Requirement | BCC | Activation cost | Magnitude | BCC risk upper bound |
|---|---|---|---|---|
| K8/V8 | 65,536 | 2,048 | 0.904% | |
| K8/V4 | 65,536 | 2,048 | 0.935% | |
| Shared across both | 32,768 | 1,024 | 0.630% |
| Method | K8/V8 | K8/V4 | Either setting | Union risk upper bound |
|---|---|---|---|---|
| BCC | 16 | 11 | 26 | 0.630% |
| Activation cost | 582 | 612 | 1,120 | 15.181% |
| Magnitude | 2,258 | 2,356 | 3,412 | 43.758% |
| Format | Edit law | Target | MSE ratio | Upper-bound ratio: queries | |||||
|---|---|---|---|---|---|---|---|---|---|
| Observed | Oracle | 256 | 1,024 | 4,096 | 16,384 | ||||
| W1/A8 | Substitute | Prediction | 0.820 | 5.36 | 5.66 | 2.23 | 1.56 | 1.27 | 1.12 |
| W1/A8 | Substitute | error | 0.942 | 20.10 | 18.33 | 3.24 | 1.93 | 1.38 | 1.18 |
| W1/A8 | Zero | Prediction | 0.917 | 12.97 | 12.55 | 3.18 | 1.93 | 1.39 | 1.17 |
| W1/A8 | Zero | error | 0.965 | 28.69 | 30.64 | 4.58 | 2.42 | 1.61 | 1.25 |
| T/A8 | Substitute | Prediction | 0.858 | 6.61 | 7.20 | 2.32 | 1.64 | 1.28 | 1.13 |
| Side | Bits | Variable words, 128 | Variable words, 1,008 | ||
|---|---|---|---|---|---|
| K | 16 | 1950.972 | 605.528 | 601 | 251 |
| K | 8 | 411.894 | 3.700 | 42 | 1 |
| K | 4 | 619.535 | 10.584 | 42 | 1 |
| V | 16 | 1602.233 | 474.378 | 588 | 220 |
| V | 8 | 984.485 | 394.488 | 90 | 46 |
| V | 4 | 1354.424 | 589.298 | 90 | 46 |
| NLL | Agreement (%) | ||||
|---|---|---|---|---|---|
| Model | Context | K8/V4 | K4/V8 | K8/V4 | K4/V8 |
| Qwen2.5-1.5B | 1,024 | 2.1533 | 10.6837 | 91.37 | 0.57 |
| Qwen2.5-1.5B | 2,048 | 2.0986 | 10.5060 | 91.56 | 0.49 |
| Qwen2.5-1.5B | 4,096 | 2.0613 | 10.3682 | 92.25 | 0.73 |
| SmolLM2-1.7B | 1,024 | 2.0427 | 2.1955 | 95.41 | 81.61 |
| SmolLM2-1.7B | 2,048 | 1.9885 | 2.1168 | 95.46 | 82.87 |
| Model | Context | BF16 NLL | NLL | MiB | Wins | Win lower (%) |
|---|---|---|---|---|---|---|
| Qwen2.5-1.5B | 1,024 | 2.1203 | +0.0330 | 11.269 | 512/512 | 99.069 |
| Qwen2.5-1.5B | 2,048 | 2.0614 | +0.0372 | 22.206 | 512/512 | 99.069 |
| Qwen2.5-1.5B | 4,096 | 2.0281 | +0.0332 | 44.081 | 512/512 | 99.069 |
| SmolLM2-1.7B | 1,024 | 2.0366 | +0.0061 | 80.361 | 463/512 | 86.880 |
| SmolLM2-1.7B | 2,048 | 1.9820 | +0.0065 | 158.361 | 450/512 | 84.028 |
| SmolLM2-1.7B | 4,096 | 1.9616 | +0.0056 | 314.361 | 433/512 | 80.369 |
| Unsafe contexts | |||||
|---|---|---|---|---|---|
| Cache | KV MiB | Original | FP16 subset | Old common | Extended common |
| K8/V4 | 14.625 | 18 | 18 | 0 | 0 |
| K4/V8 | 14.625 | 25 | 25 | 3 | 0 |
| Format | QAT | PTQ | QAT | PTQ | QAT | PTQ |
|---|---|---|---|---|---|---|
| W1/A4 | 0.03179 | 0.55200 | 0.474 | 0.000 | 0.001547 | 0.008371 |
| W1/A8 | 0.00440 | 0.54858 | 0.969 | 0.036 | 0.000116 | 0.002154 |
| T/A4 | 0.00028 | 0.49127 | 0.997 | 0.010 | 0.000018 | 0.007001 |
| T/A8 | 0.00198 | 0.48880 | 1.000 | 0.081 | 0.000024 | 0.001984 |
| Tolerance | QAT coverage | PTQ coverage | W/T/L |
|---|---|---|---|
| 0.000 | 0.000 | 0/12/0 | |
| 0.693 | 0.000 | 11/1/0 | |
| 0.860 | 0.032 | 12/0/0 | |
| 0.958 | 0.434 | 12/0/0 |
| Task | Members | Uniform direct | Mixture direct | Mixture BCC | Extra saving |
|---|---|---|---|---|---|
| 110 | 7 | 11.000 | 11.000 | 9.387 | 1.613 |
| 49 | 10 | 16.265 | 15.498 | 13.062 | 2.436 |
LLM Quantization
Large language model quantization reduces numerical precision to lower memory use and accelerate training or inference.
See all 381 papers