wikillm

Paper · 2020-06-12 · cs.LG, stat.ML

Dynamic Model Pruning with Feedback

Dynamic pruning with feedback (DPF) trains a sparse network in one pass. Every 16 iterations it recomputes a global magnitude mask from the dense weights, takes the gradient at the pruned weights and applies it to the dense weights, so cut weights can return. Author-reported: WideResNet-28-2 on CIFAR-10 at 99% sparsity reaches 88.92% top-1 vs 83.45% for SNIP.

Network pruningDynamic sparse trainingError feedbackpruningsparsitymodel-compressionsparse-trainingimage-classification

arXivPDFMarkdown14 min read

AI-compiled by claude-haiku-5-5 on 2026-11-06, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

A network with millions of weights is slow and large to run on small devices. Pruning removes weights, leaving a sparse model. Most methods either prune a finished model and then repair it, or prune during training and never bring back a weight they cut. If they cut the wrong weight early, the damage stays.

This method keeps two versions of the weights during training: the full set and a sparse copy chosen by a simple rule (keep the largest-magnitude weights). The sparse copy is the one used to compute each training step, so the model learns to work with the cuts. The update, however, goes to the full set. A weight that was cut by mistake keeps receiving updates, and if it grows large enough it comes back into the sparse copy. The sparse model is ready at the end of the one training run, with no separate repair stage.

TL;DR

  • DPF keeps a dense weight vector x and a sparse model m ⊙ x. The mask m is recomputed by global magnitude pruning every 16 iterations alg. 1 §5.1.
  • The gradient is evaluated at the sparse model and applied to the dense weights §3 eq. DPF.
  • The paper reports sparse accuracy close to dense baselines on CIFAR-10 and ImageNet, with few extra hyperparameters (the paper's claim) and no retraining step §1 §5.2.
  • Author-reported gains: WideResNet-28-2 at 99% sparsity, 88.92% vs 83.45% (SNIP) on CIFAR-10 tab. 2. ResNet-50 at 80% sparsity on ImageNet, −0.47 points top-1 vs dense tab. 4.
  • No official code was found. Several details (schedule units, tie handling, ImageNet schedule) are not stated; see Pitfalls.

Problem

  • One-shot pruning of a trained model needs a dense training run, a pruning step and fine-tuning, and it commits to one mask §1 §3 fig. 2.
  • Dynamic methods often have many hyperparameters that must be tuned §1 §5.1.
  • Pruning before training fixes the mask at initialisation. A wrong early choice strongly affects performance §3.
  • Incremental pruning can only remove weights; it cannot recover from premature pruning §3 fig. 1.

Method

The method is a dynamic mask over the dense weights with feedback from the sparse model §3.

Notation. x_t are the dense weights and m_t a binary mask. The sparse model is x̂_t = m_t ⊙ x_t §3. The error of the compression is e_t = x̂_t − x_t. The sparsity target at epoch t follows a cubic ramp from zero to the final sparsity app. A.2.

Update. The gradient g is a stochastic gradient of the loss. It is evaluated at the pruned weights, and the step is applied to the dense weights §3:

x_{t+1} := x_t - \gamma_t\, g(m_t \odot x_t) = x_t - \gamma_t\, g(\hat x_t) \tag{DPF}

eq. DPF §3

Equivalently, the step is a gradient at the dense point plus the error, x_{t+1} = x_t − γ_t g(x_t + e_t). This links the method to error feedback, as in Stich et al. (2018) and Karimireddy et al. (2019) §3. The paper describes the method as an instance of perturbed-gradient updates to the dense model §3.

Procedure (Algorithm 1, alg. 1, with the training schedule from app. A.2 and the setup from §5.1):

  1. Set the sparsity for the current epoch from the cubic schedule app. A.2.
  2. Every p = 16 iterations, recompute the mask from the dense weights by magnitude, at that sparsity alg. 1 §5.1.
  3. Form the pruned weights x̂ = m ⊙ x alg. 1.
  4. Compute the mini-batch gradient at x̂ alg. 1.
  5. Apply the gradient to the dense weights x with a general optimiser; the paper's runs use SGD with Nesterov momentum 0.9 alg. 1 §5.1.
  6. Output the dense weights x_T and the sparse model x̂_T. The sparse model is the one used for inference alg. 1 §6.
Pseudocode
# Dynamic pruning with feedback (DPF)  [alg. 1]
# Input:  dense weights x, mask period p (= 16), iterations T
# Output: dense weights x and sparse model x_hat = mask * x

def train_dpf(x, T, p):
    # Mask is recomputed from the dense weights every p iterations
    # [alg. 1] [§5.1]
    for t in range(T + 1):
        if t % p == 0:
            # Sparsity for the current epoch; the mapping from
            # iterations to epochs is not stated [app. A.2]
            s = sparsity_at(epoch_of(t))
            mask = magnitude_mask(x, s)
        # Pruned model used for the forward and backward pass
        # [alg. 1]
        x_hat = mask * x
        # Gradient is taken at the pruned weights [§3] [eq. DPF]
        grad = stochastic_gradient(x_hat)
        # Dense weights get the update from any optimiser, e.g. SGD
        # with momentum [alg. 1] [§5.1]
        x = optimizer_step(x, grad)
    return x, mask * x
Pseudocode
# Global magnitude mask over the conv weights  [§5.1] [app. A.1]
def magnitude_mask(x, sparsity):
    # Last FC layer, biases and BatchNorm stay dense  [§5.1] [app. A.1]
    conv = conv_weights(x)
    # Count of conv weights to zero; rounding is not stated  [app. A.1]
    n_zero = sparsity * conv.size
    # One threshold over all conv layers; tie handling is not stated
    threshold = kth_smallest(abs(conv), n_zero)
    # Keep the weights whose magnitude is above the threshold
    return keep_above(x, threshold)
Pseudocode
# Sparsity schedule: cubic ramp from 0 to the final target  [app. A.2]
def sparsity_at(epoch, s_final, n):
    # n: epoch of the second learning-rate decay; t0 = 0, dt = 1 epoch
    # [app. A.2]
    progress = epoch / n
    # Clamping for epochs beyond n is not stated  [app. A.2]
    return s_final * (1 - (1 - progress) ** 3)

Structured extension. The paper also applies the same scheme to filter pruning, using an ℓ2-norm filter criterion. The threshold is applied across layers, and the paper says this is preliminary and only for CIFAR-10 §6 tab. 7.

Quality measure (for the theory). The per-iterate quality of pruning is δ_t = ||x_t − x̂_t||² / ||x_t||² eq. 1 §4.

Hyperparameters

NameValueWhereNotes
mask update period p16 iterations§5.1 alg. 1 app. A.1Fixed for all experiments; described as best in the tested range app. A.3.3
mask scopeall conv layers, one global magnitude threshold§5.1 app. A.1Global over layers, not layer-wise; global gives extra MACs tab. 6
dense layerslast FC layer, biases, BatchNorm§5.1 app. A.1Last FC is 0.05% of MACs for ResNet-50 and 0.0006% for WRN-28-2 §5.1, footnote
sparsity schedules_t = s_f + (s_i − s_f)(1 − (t − t0)/(n·Δt))^3, s_i = 0, t0 = 0, Δt = 1 epochapp. A.2 §5.1Same ramp as ZG; n = epoch of the second LR decay. ImageNet value of n not stated for DPF
optimisermini-batch SGD with Nesterov momentum 0.9§5.1Algorithm 1 allows any optimiser alg. 1
learning rate, CIFAR-10ResNet-a 0.2; WRN-a-b 0.1; VGG 0.2app. A.2Grid search, see below
weight decay, CIFAR-10ResNet 1e-4; WRN 5e-4; VGG 1e-4app. A.2
learning-rate gridlinear grid starting from {0.05, 0.10, 0.15, 0.20}; extended if the best is at an edgeapp. A.2The paper's claim of no extra tuning is about the mask; the LR is tuned §1 §5.1
epochs, CIFAR-10 ResNet-a300; LR ÷10 at 50% and 75% of samples§5.1 app. A.2
epochs, CIFAR-10 WRN-a-b200; LR ÷5 at 30%, 60%, 80% of samples§5.1 app. A.2Figure 4 shows decays at 60, 120, 160 epochs fig. 4
epochs, ImageNet90; LR ÷10 at 30, 60, 80 epochs§5.1 app. A.2Follows Goyal et al. 2017
warm-up, ImageNetLR from 0.1 to 0.4app. A.2Warm-up length not stated
weight decay, ImageNet1e-4app. A.2
batch size128 (CIFAR-10); 1024 (ImageNet)§5.1 app. A.2
extra fine-tuning (Table 3 only)60 epochs, tuned optimiser and LRtab. 3Applied after normal training
framework and hardwarePyTorch; NVIDIA Tesla V100app. A.2ImageNet runs on 4 V100 GPUs fig. 12
sparse storagedense tensors multiplied by binary masksapp. A.2Speedups not measured app. A.3.3
repeatsaverages over three runsfig. 3 tab. 2ImageNet numbers are single values tab. 4

Results

Author-reported. Setup: CIFAR-10 (50K/10K) and ImageNet (1.28M/50K) image classification; ResNet, WideResNet, VGG; training from scratch with the schedules above; baselines SNIP, SM, DSR, One-shot+FT, Incremental (Zhu & Gupta) and the lottery ticket procedure §5.1 tab. 1 §5.2.

Table 2: CIFAR-10, top-1 test accuracy (mean ± std), unstructured pruning, from scratch tab. 2 tab. 5.

ModelDenseSNIPSMDSRDPFTarget sparsity
VGG16-D93.74 ± 0.1393.04 ± 0.2693.59 ± 0.17-93.87 ± 0.1595%
ResNet-2092.48 ± 0.2091.10 ± 0.2291.98 ± 0.0192.00 ± 0.1992.42 ± 0.1470%
ResNet-2092.48 ± 0.2090.53 ± 0.2791.54 ± 0.1691.78 ± 0.2892.17 ± 0.2180%
ResNet-2092.48 ± 0.2088.50 ± 0.1389.76 ± 0.4087.88 ± 0.0490.88 ± 0.0790%
ResNet-2092.48 ± 0.2084.91 ± 0.2583.03 ± 0.74⋆88.01 ± 0.3095%
ResNet-3293.83 ± 0.1290.40 ± 0.2691.54 ± 0.1891.41 ± 0.2392.42 ± 0.1890%
ResNet-3293.83 ± 0.1287.23 ± 0.2988.68 ± 0.2284.12 ± 0.3290.94 ± 0.3595%
ResNet-5694.51 ± 0.2091.43 ± 0.3492.73 ± 0.2193.78 ± 0.2093.95 ± 0.1190%
ResNet-5694.51 ± 0.20⋆90.96 ± 0.4092.57 ± 0.0992.74 ± 0.0895%
WRN-28-295.01 ± 0.0492.58 ± 0.2293.41 ± 0.2293.88 ± 0.0894.36 ± 0.2490%
WRN-28-295.01 ± 0.0490.80 ± 0.0492.24 ± 0.1492.74 ± 0.1793.62 ± 0.0595%
WRN-28-295.01 ± 0.0483.45 ± 0.3885.36 ± 0.80⋆88.92 ± 0.2999%
WRN-28-495.69 ± 0.1093.62 ± 0.1794.45 ± 0.1494.63 ± 0.0895.38 ± 0.0495%
WRN-28-495.69 ± 0.1092.06 ± 0.3893.80 ± 0.2493.92 ± 0.1694.98 ± 0.0897.5%
WRN-28-495.69 ± 0.1089.49 ± 0.2092.18 ± 0.0492.50 ± 0.0793.86 ± 0.2099%
WRN-28-896.06 ± 0.0695.49 ± 0.2195.67 ± 0.1495.81 ± 0.1096.08 ± 0.1590%
WRN-28-896.06 ± 0.0694.92 ± 0.1395.64 ± 0.0795.55 ± 0.1295.98 ± 0.1095%
WRN-28-896.06 ± 0.0694.11 ± 0.1995.31 ± 0.2095.11 ± 0.0795.84 ± 0.0497.5%
WRN-28-896.06 ± 0.0692.04 ± 0.1194.38 ± 0.1294.10 ± 0.1295.63 ± 0.1699%
WRN-28-896.06 ± 0.0674.50 ± 2.23⋆88.65 ± 0.3691.76 ± 0.1899.9%

⋆ = the method did not converge; "-" = not reported tab. 2.

Additional DPF-only rows from the complete CIFAR-10 table tab. 5: WRN-28-2 at 50%, 60%, 70%, 80%: 95.11, 94.90, 94.86, 94.76. WRN-28-4 at 70%, 80%, 90%: 95.58, 95.60, 95.65. WRN-28-8 at 70% and 80%: not reported ("-").

Table 3: CIFAR-10 with extra fine-tuning tab. 3. "Incremental" and "DPF" are trained without extra fine-tuning; "+FT" adds 60 epochs.

ModelDenseOne-shot + FT (HPDT)Incremental (ZG)Incremental + FTDPFDPF + FTTarget sparsity
ResNet-2092.48 ± 0.2090.18 ± 0.1290.55 ± 0.3890.54 ± 0.2590.88 ± 0.0791.76 ± 0.1290%
ResNet-2092.48 ± 0.2086.91 ± 0.1689.21 ± 0.1089.24 ± 0.2888.01 ± 0.3090.34 ± 0.3195%
ResNet-3293.83 ± 0.1291.72 ± 0.1591.69 ± 0.1291.76 ± 0.1492.42 ± 0.1892.61 ± 0.1190%
ResNet-3293.83 ± 0.1289.31 ± 0.1890.86 ± 0.1790.93 ± 0.1890.94 ± 0.3592.18 ± 0.1495%
ResNet-5694.51 ± 0.2093.26 ± 0.0693.14 ± 0.2393.09 ± 0.1693.95 ± 0.1193.95 ± 0.1790%
ResNet-5694.51 ± 0.2091.61 ± 0.0792.14 ± 0.1092.50 ± 0.2592.74 ± 0.0893.25 ± 0.1595%

Table 4: ImageNet, ResNet-50, top-1 and top-5 accuracy, unstructured pruning tab. 4. DSR numbers are taken from [mostafa2019parameter], not re-run. The Incremental row with Gale et al. uses layer-wise sparsity and a tuned schedule.

MethodDense top-1Pruned top-1Diff. top-1Dense top-5Pruned top-5Diff. top-5TargetReachedRemaining params
Incremental (ZG)75.9574.25−1.7092.9191.84−1.0780%73.5%6.79 M
DSR (MW)74.9073.30−1.6092.4092.40080%71.4%7.30 M
SM (DZ)75.9574.59−1.3692.9192.37−0.5480%72.4%7.06 M
DPF75.9575.48−0.4792.9192.59−0.3280%73.5%6.79 M
Incremental (Gale et al. 2019, layer-wise, tuned)76.6975.58−1.11---80%79.9%5.15 M
DPF (same block as the Gale et al. row)75.9575.13−0.8292.9192.52−0.3980%79.9%5.15 M
Incremental (ZG)75.9573.36−2.5992.9191.27−1.6490%82.6%4.45 M
DSR (MW)74.9071.60−3.3092.4090.50−1.9090%80.0%5.10 M
SM (DZ)75.9572.65−3.3092.9191.26−1.6590%82.0%4.59 M
DPF75.9574.55−1.4492.9192.13−0.7890%82.6%4.45 M

Other reported results §5.2 §6 app. A.3 app. A.4.

  • Lottery ticket: retraining DPF's final sparse mask from scratch does not recover its accuracy; the paper concludes that the mask is not a lottery ticket §6 fig. 5. DPF matches the expensive iterative lottery-ticket procedure at mild sparsity and is better at 99% fig. 5.
  • Mask convergence: for 95% sparsity on WRN-28-2 after epoch 157 (43 epochs before the end), only 5% of mask elements still change. Most masks settle early, and late training mainly fine-tunes the mask §6 fig. 4.
  • Structured pruning on CIFAR-10 (ℓ2 filter criterion), DPF vs SFP, WRN-28-8 at 80%: 95.15 ± 0.03 vs 94.22 ± 0.21 tab. 7. The full structured table is below.

Table 7: CIFAR-10, structured (filter) pruning, DPF vs SFP tab. 7.

ModelDenseSFPDPFTarget
ResNet-2092.48 ± 0.2092.18 ± 0.3192.54 ± 0.0710%
ResNet-2092.48 ± 0.2091.12 ± 0.2091.90 ± 0.0620%
ResNet-2092.48 ± 0.2090.32 ± 0.2591.07 ± 0.4030%
ResNet-2092.48 ± 0.2089.60 ± 0.4690.28 ± 0.2640%
ResNet-3293.52 ± 0.1392.07 ± 0.2292.18 ± 0.1630%
ResNet-3293.52 ± 0.1391.14 ± 0.4591.50 ± 0.2140%
ResNet-5694.51 ± 0.2093.99 ± 0.2794.53 ± 0.1330%
ResNet-5694.51 ± 0.2093.57 ± 0.1694.03 ± 0.3840%
WRN-28-295.01 ± 0.0494.02 ± 0.2494.52 ± 0.0840%
WRN-28-295.01 ± 0.0493.34 ± 0.1494.11 ± 0.1250%
WRN-28-295.01 ± 0.0492.07 ± 0.0993.74 ± 0.2560%
WRN-28-295.01 ± 0.0490.66 ± 0.6292.89 ± 0.1670%
WRN-28-295.01 ± 0.0486.00 ± 1.0990.53 ± 0.1780%
WRN-28-495.69 ± 0.1095.15 ± 0.1195.50 ± 0.0540%
WRN-28-495.69 ± 0.1094.86 ± 0.1095.43 ± 0.1650%
WRN-28-495.69 ± 0.1094.47 ± 0.1095.20 ± 0.0560%
WRN-28-495.69 ± 0.1093.37 ± 0.1894.67 ± 0.0870%
WRN-28-495.69 ± 0.1091.88 ± 0.5993.79 ± 0.0980%
WRN-28-896.06 ± 0.0695.62 ± 0.0496.06 ± 0.1240%
WRN-28-896.06 ± 0.0695.59 ± 0.0996.03 ± 0.0250%
WRN-28-896.06 ± 0.0695.40 ± 0.1495.88 ± 0.1660%
WRN-28-896.06 ± 0.0694.99 ± 0.2295.71 ± 0.1670%
WRN-28-896.06 ± 0.0694.22 ± 0.2195.15 ± 0.0380%

Compute overhead, for global versus layer-wise pruning on ResNet-20 (MACs, same parameter count) tab. 6: at 50% target, 22.80 M vs 20.99 M; at 90%, 6.54 M vs 4.67 M. The paper says the mask update adds trivial overhead for ResNet-50 on ImageNet fig. 12, but gives no wall-clock measurements app. A.3.3.

Paper vs code

No official code.

Searched: the paper text, the LaTeX source and the arXiv record for code links (none; the only mention is that baselines use their open-sourced code §5.1); a GitHub repository search for "dynamic model pruning with feedback" and "DPF pruning epfl" (one hit, a third-party PyTorch reimplementation with no license, owner not an author, not used) and "dpf org:epfml" (no hits).

Pitfalls

  • Schedule units are ambiguous. The formula uses t and Δt = 1 epoch app. A.2, while Algorithm 1 updates the mask every 16 iterations and uses iteration t alg. 1. How the epoch schedule maps onto iterations is not stated.
  • The ImageNet ramp length is not stated for DPF. For CIFAR-10 the ramp ends at the second LR decay app. A.2. For ImageNet the same rule would give 60 epochs, but the paper does not say so for DPF.
  • Ties, rounding and clamping are not stated. Threshold ties, the rounding of the count of zeroed weights and the clamping of the cubic schedule past n are not described.
  • "No additional hyperparameters" needs care. The paper says DPF avoids extra hyperparameters §1 §5.1, but the learning rate is grid-searched for DPF app. A.2, and the ImageNet warm-up is given as 0.1 to 0.4 without the warm-up length app. A.2.
  • Theory vs practice. The convergence theorems use plain SGD with a specific step size, smooth and bounded-gradient assumptions, and a random iterate §4 app. B. The experiments use Nesterov momentum with step decays §5.1. Theorem constants (G, L, μ) are not measured. The theorem's step size for the non-convex case depends on f(x_0) − f*, which is unknown in practice.
  • One-shot comparison. The paper argues the final-iterate bound for one-shot pruning is weaker §4. That is a bound, not a measured gap.
  • ImageNet comparison is not like-for-like. Against Gale et al.'s Incremental (same 5.15 M remaining parameters), DPF is lower in absolute pruned top-1 (75.13 vs 75.58) and has a smaller drop (−0.82 vs −1.11), because the dense baselines differ (75.95 vs 76.69) tab. 4. The 80% DPF rows also reach different sparsities (73.5% and 79.9%) tab. 4. The paper's ImageNet claim of a "significant improvement" §5.2 rests on the relative drop from the ZG baseline.
  • Baselines are not all re-run. DSR's ImageNet numbers come from another paper's run, so their dense baseline (74.90) differs from the others (75.95) tab. 4.
  • Results without fine-tuning. Tables 2 and 4 use DPF without extra fine-tuning. The paper says dynamic methods benefit from fine-tuning, so comparisons with fine-tuned baselines need Table 3 tab. 3 §5.2.
  • Small models at extreme sparsity. The paper notes DPF has difficulties with ResNet-20 at 95% sparsity, and attributes this partly to fine-tuning; with 60 extra epochs it reaches 90.34 §5.2 tab. 3.
  • Baseline non-convergence. DSR does not converge at 99% on WRN-28-2 and at 95% on ResNet-20 tab. 2 fig. 3.
  • Global pruning costs MACs. For the same parameter count, global pruning gives more MACs than layer-wise pruning tab. 6. The paper still prefers global pruning for aggressive sparsity app. A.3.3.
  • Sparse storage is dense. The implementation stores sparse tensors as dense tensors times masks app. A.2. The paper did not measure speedups app. A.3.3.
  • The mask is not a lottery ticket. Do not use DPF's final mask as a fixed ticket for a fresh run; the paper's retraining experiment does not recover the accuracy §6 fig. 5.
  • Structured pruning is preliminary. Only CIFAR-10, with an ℓ2 filter criterion and a threshold applied across layers; the paper says a better filter selection could improve results §6 tab. 7.

Lineage

  • Builds on: the lottery ticket hypothesis (Frankle & Carbin 2018, "LT" in the paper) §2; the gradual pruning schedule and Incremental baseline (ZG, Zhu & Gupta) §5.1 app. A.2; error feedback (Stich et al. 2018; Karimireddy et al. 2019) §3.
  • Compared against: SNIP (LAT), one-shot pruning with fine-tuning (HPDT), Incremental (ZG), DSR (MW), Sparse Momentum (DZ), and the iterative lottery-ticket procedure (FDRC) tab. 1 §5.1.
  • Related card, not discussed in this paper: Rigging the Lottery (drop-and-grow sparse training).

Source and license

Adapted from “Dynamic Model Pruning with Feedback” by Tao Lin, Sebastian U. Stich, Luis Barba, Daniil Dmitriev, Martin Jaggi (arXiv:2006.07253), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.