internalsGet Pro

Module 13 · Lesson 7 of 8Pro

Smaller models: pruning and distillation

Level
Advanced
Topic
Tuning and efficient training
Reading time
18 min

When you finish this page you can

  1. Explain why zeroing weights with unstructured pruning leaves the file size and speed of a dense model unchanged.
  2. Prune a PyTorch model with a mask, retrain it, and make the pruning permanent.
  3. Distil a large model into a small one with temperature-softened labels and a two-part loss.
  4. Choose between training small, pruning and distilling from three checks: file size, time on the target device and per-class accuracy.
  1. Design: a classifier for product photos28 min
  2. Vision architectures: ResNet to vision transformers17 min
  3. Transfer learning: reusing pretrained models17 min

Video lesson · coming soon

A 102 MB model for a 25 MB slot

is the online store this course uses as its example. In Design: a classifier for product photos, Farah, an ML engineer, fine-tuned a ResNet-50 that reads a listing’s main photo and suggests one of 20 categories. It gets about 94% right on photos people have checked. It runs on a server.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan