advanced24 min studyLesson 730 in Engineering

Release quantization only after held-out task regression analysis

Evaluate paired changes, critical slices and uncertainty alongside memory and latency gains.

On this page

What you’ll understand

  • Separate aggregate quality from critical task-slice behavior.
  • Compute paired binary changes and an approximate uncertainty interval.
  • Define an artifact-specific acceptance and rollback decision.

Quantization changes a model’s numerical implementation, but users experience answers, tools, retrieval and failures. Elementwise reconstruction and perplexity can diagnose changes without capturing every important task. A release decision needs held-out application evidence for the actual converted artifact, together with memory and latency measurements. Define tolerable regressions and critical slices before looking at final results, so a favorable average cannot quietly redefine what success means.

Measure the artifact users will run

Compare the full-precision baseline and quantized candidate using the same preprocessing, prompts, decoding configuration and evaluation rules. Pin base weights, tokenizer, template, quantizer settings, runtime and selected kernels. Hold unrelated optimizations fixed when attributing a difference to quantization. For stochastic generation, distinguish input-sampling uncertainty from decoding-seed variability and use a declared replication design. A deterministic evaluation is reproducible for its fixed inputs, but it does not eliminate uncertainty about future workloads or cover every possible output path.

Report slices chosen for product importance: long context, specific languages, numerical reasoning, structured tool arguments or rare critical workflows. Aggregate accuracy weights tasks by their sample counts, which may differ sharply from deployment importance. A large easy slice can mask a severe smaller regression. Preserve both deployment-weighted and critical-slice views, and keep memory, prefill latency and decode latency separate. A byte saving is a valid result even when quality fails a release requirement; it does not waive that requirement.

Δ^=1n∑i=1ndi,di=ci−bi∈{−1,0,1}\widehat\Delta=\frac1n\sum_{i=1}^n d_i,\qquad d_i=c_i-b_i\in\{-1,0,1\}
b_i and c_i are baseline and candidate correctness indicators on the same held-out example. Delta is candidate-minus-baseline accuracy, a dimensionless fraction; multiply by 100 for percentage points. Paired examples, not separate accuracy counts, determine uncertainty.↔ Scroll wide equations horizontally.

Pair outcomes and state uncertainty assumptions

For binary outcomes, a candidate-only success contributes plus one and a baseline-only success contributes minus one. Agreements contribute zero, whether both succeed or both fail. The mean of these differences estimates the paired accuracy change. Its sample variance depends on the discordant cases, so two systems with identical headline accuracies can have very different paired uncertainty. Store per-example outcomes or approved aggregate pair counts rather than retaining only separate success totals.

The usual standard error from independent examples is a useful approximate calculation when that sampling assumption is plausible. Multiple questions from the same document or repeated variants can violate it; then resample or analyze at an appropriate independent group level. A normal interval can be poor for small samples or few disagreements. Multiple selected slices also require a predeclared uncertainty policy rather than interpreting every nominal interval as a simultaneous guarantee. An interval containing zero is not proof that the systems are equivalent.

sd2=∑i(di−Δ^)2n−1,SE⁡(Δ^)=sdn,n>1s_d^2=\frac{\sum_i(d_i-\widehat\Delta)^2}{n-1},\qquad \operatorname{SE}(\widehat\Delta)=\frac{s_d}{\sqrt n},\qquad n>1
The estimated variance is in squared accuracy-fraction units and SE in accuracy-fraction units. The approximate interval Delta±1.96 SE assumes enough independent examples for a useful normal approximation; it is not an exact finite-sample guarantee.↔ Scroll wide equations horizontally.

Use a predeclared decision and a reproducible rollback

Choose whether release requires a point estimate, a conservative interval bound or a more formal noninferiority test against a specified margin. Keep final evaluation separate from calibration and repeated configuration selection. If an important slice fails, investigate clipping, scales and kernel agreement using development data, then evaluate a newly versioned candidate under the declared process. Preserve the last accepted artifact and its complete numerical interpretation. Rollback must restore compatible weights, scales, layouts and runtime behavior, not merely a filename referring to the latest compressed checkpoint.

For a simple uncertainty analogy, Reset the sampling lab and set both p=0.5 and n=100. Predict sample-mean variance 0.0025 and standard deviation 0.05. Separately Reset and set both p=0.5 and n=25; predict variance 0.01 and standard deviation 0.1. Play highlights exact binomial outcomes rather than drawing evaluation samples. This independent Bernoulli model illustrates sample-size scaling; it does not model paired three-valued differences, correlated tasks or the release decision itself.

A favorable aggregate can hide a failing task

A fixed held-out suite has 1,000 general examples and 100 critical math examples. Baseline successes are 900 and 80; candidate successes are 895 and 65. On math, five examples are candidate-only successes and 20 are baseline-only successes. Compute aggregate change and an approximate paired 95% interval for the math change.

  1. Aggregate baseline accuracy is 980/1,100≈89.09%; candidate accuracy is 960/1,100≈87.27%. The overall change is about -1.82 percentage points, while the math slice changes by (65-80)/100=-15 percentage points.

  2. For the math pairs, the sum of differences is 5-20=-15 and the sum of squared differences is 25. Thus mean difference is -0.15 and sample variance is (25-100×0.15²)/99=22.75/99≈0.22980.

  3. The standard error is sqrt(0.22980/100)≈0.04794. A normal approximate interval is -0.15±1.96×0.04794, approximately [-0.244,-0.056], or -24.4 to -5.6 percentage points, under independent-example and normal-approximation assumptions.

The result

An aggregate tolerance of two percentage points would pass the point estimate, while a critical-slice tolerance of five points would fail. These predeclared requirements lead to different evidence-based decisions; the smaller slice must remain visible.

Explore the model

Interactive lab

Interactive lab · sampling

Sample size changes uncertainty, not the true success probability

Reset → set p=0.5 and n=100 → predict variance 0.0025, SD 0.05. Separate Reset → set p=0.5 and n=25 → predict variance 0.01, SD 0.1.

Sample size changes uncertainty, not the true success probabilityExact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Current readings: Mean sample proportion: 0.5; Sample-mean variance: 0.0125; Uniform CDF error bound: ≤ 0.1062. All parameters are adjustable with the labeled controls below.Exact distribution of the mean of 20 independent Bernoulli variables with success probability 0.5; playback highlights outcome 0.00.250.50.75100.0580.1150.1730.23Sample mean · k / nProbability massNormal bin masses are an approximationk = 0 · exact probability = 9.54e-7
Exact binomial massNormal interval massHighlighted outcome / mean
Mean sample proportion
0.5
Sample-mean variance
0.0125
Uniform CDF error bound
≤ 0.1062
t = 0 s

Exact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forPlayback highlights exact binomial outcomes. This iid binary sample-mean model does not calculate paired regression intervals or correct correlated evaluation groups.

Check your understanding

A paired accuracy-change interval includes zero. What conclusion is justified by that fact alone?

Try it yourself

For 400 independent paired held-out examples, there are 10 candidate-only successes and 18 baseline-only successes. Compute mean change, SE and a normal approximate 95% interval. Under a predeclared rule requiring the lower endpoint above -0.01, does the candidate pass?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

The difference sum is -8 and squared-difference sum is 28. Compute sample variance as (28-400×mean²)/399 before dividing by 400 for the variance of the mean.

Compare with the solution

Mean change is -8/400=-0.02. Sample variance is (28-0.16)/399≈0.06977; SE≈0.01321. The approximate interval is -0.02±0.02589, or [-0.04589,0.00589]. Its lower endpoint is below -0.01, so this rule fails even though zero lies in the interval. A broader or grouped sampling design would require its corresponding uncertainty analysis.

Take it with you

  • Evaluate the exact converted artifact on untouched task data.
  • Critical slices and paired disagreements expose changes an aggregate can hide.
  • Uncertainty, tolerances and rollback criteria should be declared before final selection.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.