Quantization & Efficiency

Pruning

Remove the least important weights from a trained model. Unstructured pruning zeros individual weights for higher sparsity; structured pruning removes whole rows, columns, or heads for real speedup.

Card 168 of LLMs Visual Card

Quantization keeps every weight but stores each one in fewer bits. Pruning deletes weights entirely, leaving zeros where parameters used to sit.

The card compares two strategies side by side. Unstructured pruning marks individual cells in a weight matrix as zero, scattered randomly across the grid. That can reach high sparsity fractions, but the remaining nonzero entries form an irregular pattern that standard dense matrix hardware cannot accelerate without specialized sparse kernels. Structured pruning removes whole columns or rows uniformly, so the matrix that remains is literally smaller and dense hardware can run it faster.

A comparison panel below the grids states the tradeoff plainly. Unstructured pruning achieves higher sparsity but is harder to turn into speed. Structured pruning sacrifices some sparsity for layouts that actually shrink the compute. The card marks structured pruning as the practical choice for inference.

The lower panel lays out a typical recipe: measure importance per weight using magnitude or gradient information, drop the lowest-importance fraction, then fine-tune briefly to recover accuracy lost by the deletion. Pruning is rarely a one-shot cut; a short recovery training pass often closes much of the quality gap. The goal is to delete the least useful weights and keep the rest.

Keep exploring

Each card is part of a larger map of LLM concepts. Move to the next card, follow a related concept, or return to the full curriculum view.

About the visual cards Browse the map