
- Reduced memory footprint: Fit models on-device or into smaller cloud instances.
- Faster inference: Lower compute cost and reduced latency for real-time applications.
- Lower infrastructure cost: Smaller models reduce CPU/GPU time and energy consumption.
- Offline usage: Enable functionality without persistent network connectivity.
- Easier distribution and updates: Smaller artifacts are faster to transfer and deploy.

- Deploy to edge and mobile devices
- Improve inference throughput and latency
- Reduce cloud infrastructure cost
- Support offline/low-bandwidth scenarios
- Accelerate fine-tuning and iterative development

- Pruning
- Quantization
- Knowledge distillation
- Low-rank factorization

- Magnitude pruning: drop small-magnitude weights.
- Structured pruning: remove entire neurons, channels, or filters for hardware-friendly sparsity.
- Iterative pruning and retraining: prune gradually and fine-tune to recover accuracy.

- FP16 (half precision): often minimal accuracy loss, widely used on GPUs.
- INT8 (8-bit integer): much smaller footprint and faster CPU inference; often needs calibration or quantization-aware training.
- Dynamic (post-training) quantization: convert weights on the fly with no calibration data.
- Static (calibrated) quantization: uses calibration dataset to determine ranges.
- Quantization-aware training (QAT): simulates quantization during training to preserve accuracy.

- Can produce compact models that retain much of the teacher’s capability.
- Often combines distillation loss with label loss.
- Commonly used for both classification and generative tasks.
- Requires additional training of the student model.

Choosing the right combination depends on model architecture, deployment hardware, and acceptable accuracy trade-offs. In practice, teams combine techniques—e.g., distill a student model, then quantize it and apply light pruning.

- SageMaker Neo docs: https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-neo.html
- Amazon SageMaker: https://aws.amazon.com/sagemaker/
- Amazon S3: https://aws.amazon.com/s3/
- Understand trade-offs — measure compression impact on accuracy, latency, and memory. Prioritize metrics that matter for your product (e.g., 95th percentile latency vs. mean latency).
- Match technique to hardware — structured pruning and INT8 quantization are often better supported on edge CPU/GPU/ISP stacks.
- Iterate and tune — sweep pruning rates, quantization schemes, distillation temperatures, and rank k values to find the best balance.
- Profile on target device — benchmarks on simulators or desktops can differ from real hardware due to memory hierarchy and instruction set differences.
- Regularize during training — weight decay, dropout, and early stopping improve robustness to compression.
- Combine methods carefully — distill first, then quantize and prune lightly; verify end-to-end accuracy and latency.
When evaluating compressed models, always benchmark real-world inference latency and accuracy on the target device. Simulator or desktop measurements can differ from on-device behavior.
Beware: aggressive compression (very low rank, extreme pruning, or INT8 quantization without calibration) can cause unacceptable accuracy degradation. Validate thoroughly and keep rollback plans for production deployments.
- NumPy SVD documentation
- SageMaker Neo documentation
- Kubernetes Documentation (for deploying model servers)
- Edge AI and On-Device ML resources