What is AI sparsity?
Sparsity is when a significant share of a neural network's weights, activations or computation is zero or unused; it is created deliberately to cut memory and compute cost by storing fewer values and doing fewer operations.
Pruning creates sparsity by removing weights or structures. A mixture of experts model makes computation sparse by running only some experts per token; sparse attention lets each token attend only to some tokens.
- Topic
- Machine learning, models and training
- Also known as
- Sparse model
How AI sparsity works
- Weight sparsity comes from zeroing unimportant weights during or after training.
- In semi-structured patterns, such as two of every four weights being zero, hardware can speed up directly.
- In activation sparsity only part of the network runs per input; mixture of experts is an example.
- Sparse matrices use special storage formats with index overhead, so gains usually need high sparsity; speed gains depend on hardware and library support.
In more detail
Sparsity combined with quantisation and sparse attention
In large language models, sparsity is often combined with quantisation (such as 2:4 sparsity paired with FP8 or INT4 weights) and dynamic activation sparsity (exploiting ReLU-like gating or MoE routing) to stay within tight VRAM and memory-bandwidth budgets. In attention layers, block-sparse and native sparse attention mechanisms keep long-context compute sub-quadratic without dropping critical tokens.
Commonly confused terms
| Term | How it differs |
|---|---|
| Quantisation | Quantisation reduces the numerical precision (bit width) of every weight or activation while keeping matrices dense, whereas sparsity sets a fraction of values to exact zero or skips computing parts of the network. |
| Low-rank factorisation | Low-rank factorisation (such as SVD or LoRA) approximates a dense matrix as the product of two smaller dense matrices, whereas sparsity keeps the original matrix dimensions with many zero entries. |
Why AI sparsity matters for on-premises AI
A review of over 300 papers on sparsity in deep learning notes sparse networks can generalise as well as, sometimes better than, the original dense networks while reducing memory footprint and training time. An early study using pruning that learns only important connections cut parameters of two image classifiers 9 and 13 times without accuracy loss. For in-house inference, the key question is whether sparsity yields real speed on the hardware and inference engine used.
An energy company sparsifies a fault classifier running on limited field devices; it measures speed and accuracy where the inference stack supports semi-structured patterns and relies only on memory savings on devices that do not.
Common questions
Does sparsity always bring speed?
No. Irregular sparsity does not speed up most standard hardware; gains depend on pattern, hardware and software support.
Is a mixture of experts model sparse?
In computation, yes: only some experts run per token, though all parameters stay in memory.
Related terms
- AI pruning
- Unstructured pruning
- Structured pruning
- Mixture of experts (MoE)
- Sparse attention
- Active parameters
Sources
- Sparsity in Deep Learning: Pruning and growth for efficient inference and training in neural networks, 2021
- Learning both Weights and Connections for Efficient Neural Networks, 2015
In the glossary: Glossary, R to Z