Gradual pruning

Also known as: iterative pruning

On this page 7

Gradual pruning is a model compression technique that removes neural network weights in many small steps during training or fine-tuning, rather than all at once, so that the remaining weights can adapt after each step and accuracy is largely preserved. In edge AI, it is one of the standard ways to make models small enough for phones, microcontrollers and embedded accelerators without a large loss in quality.

The method is also called iterative pruning. Its best-known formulation, the polynomial sparsity schedule introduced by Zhu and Gupta in 2017, raises sparsity from an initial value to a final target over a fixed number of training steps, pruning quickly at first and more gently as the network approaches its target.

How gradual pruning removes weights step by step

Gradual pruning interleaves pruning events with ordinary training steps. At each pruning event, a criterion scores every weight, the lowest-scoring weights are set to zero and masked, and training continues so that the surviving weights compensate for the removed capacity before the next event.

In the cubic schedule, the target sparsity at step t is the final sparsity minus the remaining gap multiplied by a factor that shrinks as one minus progress raised to the third power. This shape prunes aggressively while many redundant weights remain and slows down near the end, when each removed weight hurts more. Pruning events are typically spaced every 100 to 1,000 steps.

The parameters below define a gradual pruning schedule and determine how much recovery time the model receives.

ParameterMeaningTypical range
Initial sparsityShare of zero weights at the start0 to 10 percent
Final sparsityTarget share of zero weights50 to 95 percent
Pruning frequencySteps between pruning events100 to 1,000 steps
Pruning windowTraining span over which sparsity risesRoughly 30 to 70 percent of training
Schedule exponentCurvature of the sparsity curveUsually 3 (cubic)
Recovery fine-tuningTraining after the final target is reachedSeveral epochs at a reduced learning rate
Key parameters of a gradual pruning schedule

Pruning criteria and granularity

Gradual pruning is a schedule, not a criterion, so it can be combined with different ways of choosing which weights to remove. The most common choice is magnitude pruning, which removes the weights with the smallest absolute values, but gradient-based and second-order scores are also used.

CriterionScore usedTrade-off
MagnitudeAbsolute weight valueCheap and robust, ignores interactions
MovementHow weights change during fine-tuningStrong for transfer learning, needs gradients
First-order TaylorWeight times gradientEstimates loss impact, noisier
Second-orderApproximate Hessian informationMore accurate, more compute and memory
Criteria commonly paired with gradual pruning

The schedule also applies at different granularities. Unstructured gradual pruning removes individual weights and reaches the highest sparsity, while structured variants remove whole filters, channels or attention heads, and N:M sparsity keeps, for example, two nonzero weights in every block of four so that supported hardware can accelerate the result.

Gradual pruning compared with other compression approaches

The main alternative is one-shot pruning, which removes all target weights in one operation and then fine-tunes. One-shot methods such as SparseGPT are attractive for very large language models because full retraining is expensive, but at high sparsity levels gradual pruning usually retains more accuracy.

MethodHow it worksBest suited for
Gradual pruningRaises sparsity over many training stepsHigh sparsity with retraining budget
One-shot pruningRemoves all weights at once, then fine-tunesLarge models with limited compute
Lottery ticket rewindingPrunes, rewinds weights, retrains repeatedlyResearch on trainable sparse subnetworks
QuantizationLowers numeric precision of weightsMemory and speed gains on integer hardware
Knowledge distillationTrains a smaller student modelChanging architecture size entirely
Gradual pruning and related compression methods

These methods are complementary rather than exclusive. A classic deep compression pipeline prunes gradually, then applies weight clustering or INT8 quantization, and finally compresses the sparse result, which can shrink storage by an order of magnitude.

Applying gradual pruning to edge deployments

On edge devices, the value of gradual pruning depends on whether the runtime can exploit sparsity. Unstructured zeros reduce model file size after compression, but many mobile CPUs and NPUs only run faster when sparsity is structured or follows a supported N:M pattern.

The decision table below matches common edge targets with a suitable pruning setup and explains the reasoning.

Deployment targetRecommended setupReason
Microcontroller with tight flashUnstructured gradual pruning plus INT8Sparse storage formats save memory
Smartphone NPUStructured channel pruningDense smaller layers map well to accelerators
GPU with sparse tensor coresGradual 2:4 sparsityHardware supports this pattern directly
Over-the-air model updatesHigh unstructured sparsity and compressionSmaller downloads and update packages
Choosing a gradual pruning setup for edge targets
  • Start from a well-trained dense model rather than pruning from random initialization.
  • End pruning before training ends so that the network has time to recover at the final sparsity.
  • Measure latency on the real device, because parameter counts do not predict speed reliably.

Limitations and common mistakes

The main cost of gradual pruning is extra training time, since the schedule needs many steps and often a full fine-tuning run. For models with billions of parameters, this budget is frequently unavailable, which is why one-shot methods gained ground for language models.

Typical mistakes include pruning too fast with an overly short window, applying the same sparsity to every layer although first and last layers are usually more sensitive, and forgetting to keep masks fixed during fine-tuning, which lets pruned weights grow back. Teams also overestimate speed gains by reporting sparsity instead of measured latency and energy on the target hardware.

Understanding it simply

A neural network has millions of small numbers called weights. Many of them matter very little. Gradual pruning removes these weak weights a little at a time. After each round, the network keeps learning and adjusts to the loss.

Think of trimming a hedge over several weeks instead of cutting it back in one day. The plant has time to recover between cuts. In the same way, slow and steady removal keeps the model accurate while making it much smaller, so it can run on a phone or a small device.

Applied in practice

An engineering team builds a keyword spotting model for a battery-powered smart doorbell with a microcontroller that has 1 MB of flash. The trained dense model is accurate but too large. The team applies gradual magnitude pruning with a cubic schedule, raising sparsity from 0 to 80 percent over the middle half of a fine-tuning run, with pruning events every 200 steps.

After a final recovery phase and INT8 quantization, the compressed model fits comfortably in flash, and accuracy on the wake-word test set drops by less than one percentage point. Because the runtime stores weights in a sparse format, the update package for over-the-air delivery also becomes much smaller, which reduces data costs across the installed device fleet.