Pruning Lab
Remove low-importance weights and measure sparsity, masks, and compression impact.
Pruning removes unimportant weights to make models smaller and faster. It introduces sparsity: many weights become zero and can be skipped at inference time.
This lab focuses on weight pruning. You can try unstructured pruning (individual weights) or structured variants (row or column groups).
Threshold: drop weights with |w| below a cutoff.
Global Top-K: keep the largest K weights globally.
Target Sparsity: automatically find a threshold to reach a given sparsity.
Row/Column Top-K: keep top weights per row or per column to approximate structured sparsity.
Random / Iterative: baseline and scheduled pruning to show gradual compression.
- Generate a matrix and optionally edit values.
- Choose a pruning strategy and its parameters.
- Compare the pruned matrix and mask with the original.
Matrix Generator
Pruning Settings
Summary
Original Matrix (click to edit)
Click a cell to edit. Press Enter to save; empty values become zero.
Pruned Matrix
Mask (1 = keep, 0 = prune)
JSON Export
Notes
- Unstructured pruning yields high sparsity but irregular memory access.
- Structured pruning is easier to accelerate on hardware but can remove entire features.
- Iterative pruning simulates training-time schedules for stable compression.