Back to ML Engineer Mind Map
中文·English
💻 ML EngineerID: mle-quantization-pruning-basics

Model Compression, Pruning & Quant

模型压缩、剪枝与量化基础
🎯Core Definition
Model Compression, Pruning & Low-Bit Quantization optimize neural networks for deployment onto edge hardware or high-throughput cloud inference clusters by slashing memory footprints and memory-bandwidth bottlenecks; it encompasses 3 core pillars: 1) Pruning (Structured channel pruning and unstructured magnitude/Hessian weight pruning inducing sparsity); 2) Knowledge Distillation (transferring dark knowledge from large teacher models to compact student nets via temperature-softened logits pT=softmax(zT/T)p_T = \text{softmax}(z_T / T)); 3) Uniform Affine Quantization, mapping continuous floats to INT8/INT4/FP8 integers via xq=clamp(round(xS)+Z,qmin,qmax)x_q = \text{clamp}\left(\text{round}\left(\frac{x}{S}\right) + Z, q_{\min}, q_{\max}\right) across Post-Training Quantization (PTQ) and Quantization-Aware Training (QAT).
💡Use Cases
Mobile on-device ML deployment (NCNN, CoreML, TFLite), cloud LLM throughput optimization (vLLM, TensorRT-LLM, AWQ), and inference cost reduction.
Key Problems Solved
Heavy multi-billion parameter networks exceed edge device RAM and saturate GPU memory bandwidth in cloud serving; compression and quantization slash memory footprints by 4-8x and triple throughput with negligible accuracy loss.
🎯5 High-Frequency Exam Points
1
Derive the mathematical scale factor SS and zero-point ZZ formulas in uniform asymmetric affine quantization?
2
Explain why QAT utilizes FakeQuantize nodes in the forward pass and Straight-Through Estimators (STE) in the backward pass to bypass non-differentiable rounding?
3
Why does structured channel/head pruning achieve direct hardware speedups while unstructured sparse matrices require specialized sparse Tensor Cores?
4
Explain how high distillation temperatures TT soften output logit entropy to reveal dark knowledge across non-target classes?
5
Explain how SmoothQuant mathematically migrates activation quantization difficulty onto weights and how AWQ protects salient weight channels?
🔗Foundational Prerequisite Cards (Click to Review)
📖 In-depth Guide:📄 mle-core-cheatsheet
Updated 2026-08-14
🎯
Test Your Knowledge: Practice Questions for "Model Compression, Pruning & Quant"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardEnsemble Stacking & BlendingNext CardLive Coding: Multi-Head Self-Attention

🔗 More ML Engineer Knowledge Cards

Bias-Variance Tradeoff & OverfittingLoss Function Taxonomy & GradientsOptimizer Convergence & MomentumLive Coding: Numerically Safe Softmax