---
title: Compare unstructured pruning, structured pruning and distillation for shrinking a model for on-device inference.
url: https://gurkanozkan.ai/learn/questions/mle-pruning-and-knowledge-distillation-61/
markdown: https://gurkanozkan.ai/learn/questions/mle-pruning-and-knowledge-distillation-61.md
kind: question
role: ML engineering
stage: Technical
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/mle-pruning-and-knowledge-distillation-61.json
robots: noindex
---

# Compare unstructured pruning, structured pruning and distillation for shrinking a model for on-device inference.

ML engineering · Technical · Medium

## Answer

*Model answer, written in a candidate's voice*

### In short

- Unstructured pruning removes individual weights; speed-ups need sparse kernels/hardware.
- Structured pruning removes channels, filters, heads or layers; gives dense smaller models and real latency gains.
- Distillation trains a small student on teacher soft logits at temperature and useful intermediate features.
- Combine pruning/distillation with quantisation and retraining.
- Measure latency, memory, energy and accuracy on the target device, not just params or FLOPs.

### In full

The core trade-off is that unstructured pruning can preserve accuracy by zeroing individual weights, but it does not reliably speed up on-device inference unless the runtime and hardware support sparse kernels, so dense mobile accelerators may see little gain. Structured pruning is usually the safer route for latency because removing channels, filters, heads or layers produces a smaller dense model that maps directly to existing kernels, though it is coarser and often needs retraining and careful sensitivity analysis. Distillation is different: it trains a small student to reproduce the teacher's soft logits at a temperature and, when useful, intermediate features, which can recover accuracy at a much smaller size but costs extra training and depends on a good teacher. In practice I would combine these with quantisation and validate on the actual target hardware, measuring latency, memory, energy and task accuracy rather than relying on parameter counts or FLOPs.

*Checked against sources by an independent AI reviewer.*

## What a strong answer covers

- Unstructured sparsity needs sparse kernels to give speed-ups.
- Structured pruning (channels, heads) gives real latency gains.
- Distillation trains a small student on teacher soft targets or logits (temperature) and features.
- Combine with quantisation; measure on the target hardware.

## Common mistakes

- reporting a parameter reduction as a latency reduction.
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
