Module contents
Lesson 24 of 28Advanced 120 min

Quantization II: post-training quantization of LLMs

Activation outliers can make a shared quantization scale too coarse. Study LLM.int8(), SmoothQuant, GPTQ and AWQ, implement layer reconstruction and apply GPTQ to a small model on the local GPU.

After this lesson you can

  • Locate and characterize outlier channels and massive activations in a real LLM.
  • Implement SmoothQuant and prove its transformation is exact and can be folded into the preceding normalization.
  • Derive the GPTQ update from Optimal Brain Surgeon and implement Cholesky and block updates.
  • Implement an AWQ-inspired scale search and compare it with GPTQ.
  • Evaluate a quantized model with perplexity and downstream tasks while avoiding misleading comparisons.

Before you start

A shared scale can lose detail

Quantizing an entire layer with one scale forces the grid to cover the largest-magnitude value. If a few activation components are much larger than the rest, the step may be too coarse for typical components. The difficulty depends on architecture, layer, data and method: there is no universal size beyond which all naive quantization fails.

Activation outlier channels are dimensions whose magnitudes can repeatedly dominate a layer’s inputs. LLM.int8() studies systematic outlier features in large models. Massive activations at particular positions are another phenomenon and should not automatically be equated with all high-magnitude channels.

To diagnose the first phenomenon, record per-channel magnitude distributions across many tokens and sequences, not just the global maximum. A large channel in one token may be a one-off event; one standing out in many sequences suggests a systematic direction. Calibration input selection matters: a small prompt may omit a language, format or length appearing in production. Inspect quantiles and frequency of large values by layer, and check them against held-out data.

Massive Activations studies exceptionally large activations at particular positions and analyzes their role in some transformers. Their mechanism cannot be deduced or their incidence extrapolated to a different model merely by looking at a figure of maxima. In particular, selecting channels with the highest maxima and displaying them again on the same prompt is exploratory selection, not an unbiased frequency measurement.

This figure comes from a specific prompt run at layer 0 of SmolLM2-135M, revision 93efa2f097d58c2a74874c7e644dbc9b0cee75a2: the 16 channels with the largest absolute maximum among its 32 tokens were selected. This deliberate selection makes peaks visible, but is not representative and does not prove the presence of large-model scaling phenomena. The surface uses nearest-neighbor interpolation; scales come from the same data and the maximum of the corresponding column of q_proj.weight.

InteractiveSelected activations from a real model
Surface: token (horizontal axis) and selected channel (side axis); height proportional to |X/s|. Nearest-neighbor interpolation.
0.50
Original maximum1.180
Transformed maximum2.336
Change α and examine the surface or movable map. The transformed activation magnitude is shown, not task error.

Separate or move the difficulty

LLM.int8() decomposition separates problematic dimensions and computes their contribution at 16-bit precision while quantizing the rest with vector scales. If OO is the set of chosen channels, XW=XOWO+XOˉWOˉXW=X_O W_O+X_{\bar O}W_{\bar O}. The first term retains higher precision and the second is approximated with integer arithmetic. Partitioning and conversions have costs and must be measured in the specific kernel. The original work reported that more than 99.9% of values in its procedure were multiplied in 8 bits under its experimental conditions.

The decomposition sums contributions from the same product; it does not remove large channels. For the integer path, remaining activations and their weights are quantized with appropriate scales, integer products are accumulated and the result is rescaled; the high-precision contribution is added at the end. A lower threshold may protect more values but increase work in that branch. A higher threshold reduces that cost and may leave larger quantization errors. The proportion of INT8 values alone does not determine latency: implementation, batch size and overhead of splitting and joining paths matter.

If the layer input comes from RMSNorm with gain γ\gamma, dividing each component of γ\gamma by sjs_j incorporates D−1D^{-1} before projection. If several projections receive the same output, all must absorb the corresponding transformation. The identity holds before rounding; error appears after quantizing X′X' and W′W'. SmoothQuant uses this migration for W8A8.

For input uu, write RMSNorm as zj=γjuj/r(u)z_j=\gamma_j u_j/r(u), where r(u)r(u) is the root mean square with its stability term. Replacing gain with γj/sj\gamma_j/s_j produces exactly zj/sjz_j/s_j without changing r(u)r(u), because the denominator is calculated from uu, not the gain. Multiplying the corresponding row of WW by sjs_j then cancels that division. If normalization also has a per-channel bias, it must be divided by the same scale; changing gain alone is insufficient.

With α=0\alpha=0 the scale depends on the weight and with α=1\alpha=1 it depends on the activation. The change redistributes range, without removing information before quantization. For a channel whose maximum activation is 20 and maximum weight is 0.1, α=1/2\alpha=1/2 gives s=200s=\sqrt{200}: the activation maximum divided by ss and weight maximum multiplied by ss both become 2\sqrt 2. If a magnitude is zero, set a safe positive scale instead of dividing by zero. The best allocation depends on the quantizer and inputs; it is not necessarily 1/21/2.

Folding into RMSNorm has an architectural condition: normalized output is multiplied by a per-channel gain and all consuming branches must be rescaled consistently. A residual sum or other operation taking the same output without the corresponding transformation can break equivalence of the entire block. First check the floating-point result and then the loss due to rounding, to separate implementation error from quantization error.

InteractiveDistribute magnitude between activation and weight

Selected channels in original magnitude order: activation blue, weight orange.

Per-tensor W8A8 errors for the partial product of 16 channels and first 32 outputs, using these 32 tokens; best α is searched in 0.05 steps on the same sample. This does not measure full-layer quality.

0.50
Activation MSE0.0000276
Weight MSE0.0000053
Partial-product MSE0.0000400
Best α on grid0.45
Change α and compare per-channel maxima in the real sample; the transformation before quantization preserves the product.

The displayed errors use only the 16 selected channels and the first 32 output rows of the projection, with the prompt’s 32 tokens: they calculate the partial product of those contributions and compare it after quantizing both factors to simulated per-tensor INT8. The best exponent is chosen on a grid over the same sample; this is not validation on new data. Weight maxima used for scales were calculated over all output rows, while product error uses only the first 32.

Layer reconstruction

Layerwise reconstruction minimizes error on calibration inputs. If X∈Rd×nX\in\R^{d\times n} and W∈Rm×dW\in\R^{m\times d}, the objective is ∥(W−W^)X∥F2\|(W-\hat W)X\|_F^2. For one row, with perturbation δ=w^−w\delta=\hat w-w, it is δ⊤XX⊤δ\delta\T XX\T\delta and its Hessian is H=2XX⊤H=2XX\T. Because HH can be singular, positive damping is added before inversion or factorization.

This loss weights weight errors by their effect on observed outputs. If two input channels are correlated, changing one column can be partly compensated by another; isolated weight error does not reveal that possibility. If n<dn<d, matrix XX⊤XX^\top has rank at most nn and cannot be invertible. Even with more samples it can be ill-conditioned if some dimensions barely vary. One can add λI\lambda I with λ\lambda proportional to the mean diagonal and check factorization stability. Excessive damping gives too much weight to the isotropic penalty and reduces the effect of correlations.

The loss is local: approximating one layer well on original-model inputs does not prove the whole model preserves its output distribution. Quantizing earlier layers changes the inputs of later ones. An implementation can capture all statistics from the original model, as this lesson’s local cell does, or recalibrate sequentially after quantizing each block. The second strategy better reflects changed inputs, although it requires more passes and resources. In either case final model measurement must use data separate from calibration.

Proof

With multiplier λ\lambda, the stationary condition for δ⊤Hδ−λ(ej⊤δ−d)\delta\T H\delta-\lambda(e_j\T\delta-d) gives 2Hδ=λej2H\delta=\lambda e_j. Thus δ=(λ/2)H−1ej\delta=(\lambda/2)H^{-1}e_j. Enforcing ej⊤δ=de_j\T\delta=d yields λ/2=d/[H−1]jj\lambda/2=d/[H^{-1}]_{jj}. Substituting into the objective gives the stated expression. Positive definiteness guarantees a unique minimum. If loss 12δ⊤Hδ\tfrac12\delta\T H\delta is used, the increase also has a factor 1/21/2.

∎

The idea of GPTQ applies second-order compensation while quantizing columns, organizes updates into blocks and uses factorizations to make them efficient. Order and group scales change the problem. The following comparison is a four-column example with an integer grid, not a full GPTQ implementation or a guarantee that rounding all coordinates always improves on independent rounding.

In a sequence of columns, constraints already imposed on earlier ones must remain fixed. The remaining problem uses the inverse curvature conditioned on those coordinates; repeatedly applying the corresponding column of the original inverse as if none had been fixed is insufficient. GPTQ organizes that information through a triangular factorization of the damped inverse and defers updates to the rest of the matrix until a block is complete. This changes computational organization, not the ideal compensation rule for the same grid and order.

If UU is upper triangular and U⊤U=(H+λI)−1U^\top U=(H+\lambda I)^{-1}, a column’s normalized error is (wi−qi)/Uii(w_i-q_i)/U_{ii}. Its product with row Ui,i:U_{i,i:} is subtracted from columns still free. Within a block, its columns are updated immediately; contributions to future blocks are accumulated and applied as a matrix multiplication. Damping λ>0\lambda>0 stabilizes a rank-deficient calibration Hessian but also changes the optimized objective. A group scale can be fixed beforehand or recalculated as the matrix changes: these are different procedures and must be described when comparing results.

InteractiveCompensate before rounding

Current weights: 0.40 · 0.60 · −0.40 · −0.60. The grid is integer-valued and the first 0 columns are fixed.

01234

Blue: error after each fixation; dashed orange: final independent rounding. The horizontal axis counts columns. Compensation minimizes each constrained step, without guaranteeing universal final improvement.

0.6
0
Current error0.0000
Final naive rounding0.2560
Change correlation and advance four columns to compare reconstruction error with independent rounding.

AWQ uses activation statistics to identify sensitive weights and protects them with equivalent scales before weight-only quantization. Its paper reports that protecting 1% of salient weights can greatly reduce error; the method avoids keeping them as an irregular mixture of precisions. Scale choice must be evaluated on calibration inputs and does not ensure a better result on every task.

The intuition is that an error in a weight column has a greater effect if its corresponding input dimension is often large. Multiplying that column by a scale before quantization and undoing the scale in the activation changes that channel’s effective grid without changing the floating-point product. Scale selection must account for weights sharing grids by group: favoring one channel can hurt its neighbors. The following experiment searches an exponent over a simple family of scales and chooses by output error, but does not show that the same choice generalizes beyond calibration.

For example, if a row contains two small weights and a very large one, a shared scale must cover the large one and the two small ones may round to zero. Rescaling a sensitive channel before choosing the grid changes their relative positions. After dividing the contribution by the same scale, the unquantized weight product is recovered exactly; with quantized weights, the effect redistributes error. This protection is not free: the new range can increase the shared quantization step and worsen other channels in the group. That is why an observed reconstruction criterion is needed alongside magnitude-based intuition.

Verify the identity

[ ]Equivalent rescalingBrowser
import numpy as np
X = np.array([[20., 1., .5], [3., -.5, .2]])
W = np.array([[.1, -.04], [.4, .2], [.8, -.3]])
alpha = .5
a = np.max(np.abs(X), axis=0)
b = np.max(np.abs(W), axis=1)
s = a**alpha / b**(1-alpha)
print('escalas:', np.round(s, 6))
print('diferencia máxima:', np.max(np.abs((X/s) @ (s[:, None]*W) - X@W)))

Lab: layerwise reconstruction

This synthetic layer has correlated inputs and two amplified channels. The first 384 columns are used for calibration and the last 128 for test. Rounding and GPTQ use the same symmetric W4 grid and static scales per row and group. Triangular factorization of the damped inverse allows errors to be accumulated within a block and applied jointly to future columns. The assertion compares block sizes one and eight; second-order compensation does not guarantee improvement on every test set.

The AWQ-inspired search tries exponents for scales based on mean absolute activations and chooses the lowest calibration reconstruction error. This is a teaching version of the search, not the paper’s complete implementation. SmoothQuant compares per-tensor W8A8 before and after rescaling, maintaining the identity at full precision. Each result depends on this example’s distribution.

[ ]GPTQ, activation scales and SmoothQuantBrowser
import numpy as np

def group_scales(W, bits=4, group=8):
    limit = 2**(bits-1)-1
    scales = np.empty_like(W)
    for start in range(0, W.shape[1], group):
        end = min(start+group, W.shape[1])
        maximum = np.max(np.abs(W[:, start:end]), axis=1, keepdims=True)
        scales[:, start:end] = np.maximum(maximum/limit, 1e-12)
    return scales

def quantize(W, bits=4, group=8):
    limit = 2**(bits-1)-1
    scales = group_scales(W,bits,group)
    return np.clip(np.round(W/scales),-limit,limit)*scales

def gptq_quantize(W, H, bits=4, group=8, blocksize=8, damp=.01):
    W = W.copy().astype(float)
    n = W.shape[1]
    H = H.copy() + np.eye(n)*damp*np.mean(np.diag(H))
    inverse = np.linalg.solve(H, np.eye(n))
    upper = np.linalg.cholesky(inverse).T
    scales = group_scales(W,bits,group)  # grupos estáticos
    limit = 2**(bits-1)-1
    Q = np.empty_like(W)
    for start in range(0,n,blocksize):
        end = min(start+blocksize,n)
        local = W[:,start:end].copy()
        errors = np.zeros_like(local)
        for k in range(end-start):
            i = start+k
            q = np.clip(np.round(local[:,k]/scales[:,i]),-limit,limit)*scales[:,i]
            Q[:,i] = q
            error = (local[:,k]-q)/upper[i,i]
            errors[:,k] = error
            local[:,k:] -= error[:,None]*upper[i,i:end][None,:]
        W[:,end:] -= errors @ upper[start:end,end:]
    return Q

def awq_search(W, X, bits=4, group=8):
    magnitude = np.maximum(np.mean(np.abs(X),axis=1),1e-8)
    target = W@X
    best = None
    for alpha in np.linspace(0,1,21):
        scale = magnitude**alpha
        scale /= np.sqrt(scale.max()*scale.min())
        candidate = quantize(W*scale[None,:],bits,group)/scale[None,:]
        loss = np.mean((candidate@X-target)**2)
        if best is None or loss < best[0]:
            best = (loss,alpha,candidate)
    return best

rng = np.random.default_rng(24)
d, m = 24, 12
mix = rng.normal(size=(d,d))
X = mix @ rng.normal(size=(d,512))/np.sqrt(d)
X[:2] *= 8
train, test = X[:,:384], X[:,384:]
W = rng.normal(size=(m,d))*.2
H = 2*[email protected]/train.shape[1]
naive = quantize(W)
gptq = gptq_quantize(W,H)
loss, alpha, awq = awq_search(W,train)
def mse(candidate, inputs): return np.mean(((candidate-W)@inputs)**2)
for name, candidate in [('redondeo',naive),('GPTQ',gptq),('AWQ simplificado',awq)]:
    print(name, 'calibración',round(mse(candidate,train),6),'test',round(mse(candidate,test),6))
print('exponente AWQ:',alpha)
assert np.allclose(gptq_quantize(W,H,blocksize=1), gptq_quantize(W,H,blocksize=8), atol=1e-10)

a = np.max(np.abs(train),axis=1); b = np.max(np.abs(W),axis=0)
s = np.sqrt(np.maximum(a,1e-8)/np.maximum(b,1e-8))
transformed_X = train/s[:,None]; transformed_W = W*s[None,:]
assert np.allclose(transformed_W@transformed_X,W@train)
def quant_tensor(x,bits=8):
    limit=2**(bits-1)-1
    scale=max(np.max(np.abs(x))/limit,1e-12)
    return np.clip(np.round(x/scale),-limit,limit)*scale
direct = quant_tensor(W)@quant_tensor(train)
smooth = quant_tensor(transformed_W)@quant_tensor(transformed_X)
print('W8A8 directo y SmoothQuant:',round(np.mean((direct-W@train)**2),6),round(np.mean((smooth-W@train)**2),6))

Local lab: applying GPTQ to a model

This experiment uses SmolLM2-135M and WikiText-2 raw, with pinned revisions. It needs PyTorch, Transformers and Datasets; it downloads data and model if missing. It uses 256 training tokens to capture inputs of each block’s linear projections via hooks. From these it computes a curvature matrix per module, damped before Cholesky. Inputs are captured with the original model: they are not recalibrated after quantizing previous blocks.

Internal linear projections are quantized without changing the embedding table or output head, using symmetric 4 bits and groups of 128. The initial value BLOCKS=1 limits the experiment to the first block; BLOCKS=None includes all. Scales are static and calculated from original weights; activation ordering is not applied. The original model, independent rounding and GPTQ compensation are evaluated on the same 512 test tokens in independent windows of 128. A total of 508 tokens are scored: each window loses its first. Quantized matrices are stored in floating point to check quality; they are not packed 4-bit weights or an INT4 inference kernel.

[ ]GPTQ on SmolLM2 projectionsLocal GPU
import time, math, torch
import torch.nn.functional as F
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer

MODEL = 'HuggingFaceTB/SmolLM2-135M'
REV = '93efa2f097d58c2a74874c7e644dbc9b0cee75a2'
DATA_REV = 'b08601e04326c79dfdd32d625aee71d232d685c3'
BLOCKS = 1  # None cuantiza todas las capas; un entero limita la prueba
CAL_TOKENS, TEST_TOKENS, CONTEXT = 256, 512, 128
device = 'cuda' if torch.cuda.is_available() else 'cpu'
tokenizer = AutoTokenizer.from_pretrained(MODEL,revision=REV)
data = {split:load_dataset('Salesforce/wikitext','wikitext-2-raw-v1',split=split,revision=DATA_REV) for split in ('train','test')}
ids = {split:tokenizer('\n\n'.join(row for row in data[split]['text'] if row.strip())[:12000],return_tensors='pt').input_ids for split in data}
model = AutoModelForCausalLM.from_pretrained(MODEL,revision=REV,dtype=torch.float32).to(device).eval()
BLOCKS = model.config.num_hidden_layers if BLOCKS is None else BLOCKS
modules = [(name,layer) for name,layer in model.model.layers.named_modules() if isinstance(layer,torch.nn.Linear) and int(name.split('.')[0])<BLOCKS]
original = {name:module.weight.detach().cpu().clone() for name,module in modules}
activation = {}
handles = []
for name,module in modules:
    def hook(mod,args,name=name):
        x = args[0].detach().reshape(-1,args[0].shape[-1]).float()
        activation[name] = (x.T @ x / len(x)).cpu()
    handles.append(module.register_forward_pre_hook(hook))
with torch.no_grad(): model(ids['train'][:,:CAL_TOKENS].to(device),use_cache=False)
for h in handles: h.remove()

def scales_for(W,group=128):
    scales=torch.empty_like(W)
    for start in range(0,W.shape[1],group):
        end=min(start+group,W.shape[1])
        scales[:,start:end]=(W[:,start:end].abs().amax(dim=1,keepdim=True)/7).clamp_min(1e-12)
    return scales

@torch.no_grad()
def gptq(W,H,group=128,blocksize=128,damp=.01):
    W=W.float().clone(); n=W.shape[1]
    H=H.float().clone()
    H.diagonal().add_(damp*H.diagonal().mean().clamp_min(1e-8))
    lower=torch.linalg.cholesky(H)
    U=torch.linalg.cholesky(torch.cholesky_inverse(lower),upper=True)
    scales=scales_for(W,group)
    Q=torch.empty_like(W)
    for start in range(0,n,blocksize):
        end=min(start+blocksize,n); local=W[:,start:end].clone(); errors=torch.zeros_like(local)
        for k in range(end-start):
            i=start+k
            q=(local[:,k]/scales[:,i]).round().clamp(-7,7)*scales[:,i]
            Q[:,i]=q
            error=(local[:,k]-q)/U[i,i]
            errors[:,k]=error
            local[:,k:] -= error[:,None]*U[i,i:end][None,:]
        W[:,end:] -= errors@U[start:end,end:]
    return Q

@torch.no_grad()
def evaluate():
    total=0.; count=0
    test=ids['test'][0,:TEST_TOKENS]
    for start in range(0,len(test)-1,CONTEXT):
        x=test[start:start+CONTEXT].unsqueeze(0).to(device)
        if x.shape[1]<2: break
        logits=model(x,use_cache=False).logits[:,:-1]
        total += F.cross_entropy(logits.reshape(-1,logits.shape[-1]),x[:,1:].reshape(-1),reduction='sum').item()
        count += x.shape[1]-1
    return math.exp(total/count),count

print('dispositivo',device,'módulos',len(modules),'calibración tokens',CAL_TOKENS,flush=True)
print('base:',evaluate(),flush=True)
with torch.no_grad():
    for name,module in modules:
        W=original[name].to(device); scale=scales_for(W)
        module.weight.copy_((W/scale).round().clamp(-7,7)*scale)
print('redondeo W4:',evaluate(),flush=True)
start=time.perf_counter()
with torch.no_grad():
    for name,module in modules:
        module.weight.copy_(gptq(original[name].to(device),activation[name].to(device)))
        print('cuantizado',name,round(time.perf_counter()-start,1),flush=True)
print('GPTQ W4:',evaluate(),flush=True)
This cell needs the local lab (PyTorch with your GPU). Start it with npm run lab and open the connection link.

The test is an end-to-end check for a small fragment, not a WikiText-2 benchmark evaluation. Expanding calibration, test split and context length can change perplexity and method ranking. The earlier AWQ variant is teaching NumPy; it is not presented as a comparison with a full AWQ library. Comparison with a production implementation also requires fixing weight format, granularity and available kernels.

In an FP32 run on an RTX 3060, with all 30 blocks and their 210 internal projections, the 508 scored tokens gave approximate perplexities of 28.30 for the baseline, 47.51 for W4 rounding and 44.91 for GPTQ W4. In the first-block-only test they were 28.30, 29.43 and 28.44 respectively. These are examples from this short protocol and calibration; they do not prove a general GPTQ advantage or full-corpus perplexity. No GPTQ or AWQ libraries were installed in that run’s environment for an independent comparison.

Interpreting evaluation

Perplexity is the exponential of mean negative log loss per scored token. Comparing variants requires scoring the same tokens with the same tokenization and available context. Splitting a corpus into independent windows discards each window’s first token and does not give the same context as a sliding window. Separate calibration and test; reporting only calibration reconstruction error can hide overfitting or a different deployment domain.

Perplexity also does not replace downstream tasks. A small average difference may be concentrated in questions, code, languages or long contexts that matter in use. Evaluate those tasks with fixed prompts, seeds, scoring rules and context length; in generation tasks the decoding rule itself can affect the result. For latency and memory, count packed weights, scales, activations and cache, and measure a kernel that actually consumes the advertised format. Replacing weights with rounded values in floating-point tensors helps study quality but does not compress memory or demonstrate W4 speedup.

The advertised bit count also does not always include metadata. If a group of 128 weights shares a scale stored with 16 bits, that scale adds 16/128=0.12516/128=0.125 bits per weight, in addition to the four code bits. Zero points, padding, indices and tensors remaining at higher precision can add more. This ideal calculation explains the difference between nominal format and actual file size or model size in memory. The local experiment does not pack codes or store those scales as a deployment format and therefore does not provide this measurement.

In the local cell the symmetric grid uses integers from −7-7 to 77: fifteen levels, although each code could be stored in four bits. Range is calculated per output row and group of input columns. Choosing an asymmetric range, different groups or recalculating scales during compensation would change reconstructed values and metadata. Before attributing a difference to GPTQ, keep these choices constant between the compensated variant and independent rounding, as the comparison does.

Activation ordering, which prioritizes columns with greater estimated curvature, can improve some reconstructions. If scales are also grouped after reordering, the resulting layout can complicate kernel accesses. Static groups retain an assignment compatible with original order, at the cost of solving a different scaling problem. The decision depends on the model and hardware pair; comparing local loss alone does not reveal the format’s cost.

Exercises

Numeric
For α = 0.5, maximum activation 20 and maximum weight 0.1, what is the SmoothQuant scale?
Proof
Prove: Prove the SmoothQuant identity.
0
D is diagonal and invertible.

Step 1 of 2. What product results after the change?

Proof
Prove: Derive the displacement minimizing error with one coordinate fixed.
0
H is positive definite and δ_j = d.

Step 1 of 2. What stationary condition is obtained?

Quiz
Which combination matches the primary goal of each method?
Code
Implement compensate(H, j, d) to minimize δᵀHδ subject to δ[j] = d, with positive-definite H.
import numpy as np
def compensate(H, j, d):
  pass
Shift+Enter to run
Code
Implement gptq_quantize(W, H, bits, group, blocksize, damp) with static symmetric scales per row and group and triangular block compensation.
import numpy as np
def gptq_quantize(W, H, bits=4, group=8, blocksize=8, damp=.01):
  pass
Shift+Enter to run
Key idea
Equivalent transformations redistribute magnitude before quantization; second-order reconstruction uses input structure to compensate errors.