What is Pruning?

Zeroing out low-impact weights in a neural network to reduce computation and memory. Structured pruning, which follows fixed patterns, is easier to accelerate in hardware.

Field: AI Hardware & Software Stack

Japanese name: プルーニング

Which weights to remove, and how

The most basic method treats weights with small magnitude as unimportant and sets them to zero. Other methods use gradients or similar information to estimate how much the loss would rise if a weight were removed. Removing many weights at once hurts accuracy badly, so the usual procedure is to prune a little, retrain (fine-tune) to recover accuracy, and repeat. Higher sparsity cuts more computation, but beyond some point accuracy drops sharply.

Unstructured, structured and N:M sparsity

Unstructured pruning zeroes individual weights freely and keeps accuracy well even at high sparsity, but the zeros are scattered and their positions must be stored in an index, so ordinary matrix hardware gains little speed. Structured pruning removes whole channels, filters or attention heads, leaving a smaller dense model that runs faster even on ordinary hardware with no special sparsity support. In between is 2:4 sparsity, in which two of every four consecutive weights are zero; tensor cores that support it can accelerate the computation.

Combining techniques, and other kinds of pruning

Pruning is combined with quantization, which reduces the number of bits per weight, and knowledge distillation, which trains a small model to imitate a large one, to cut inference computation and memory. A lower parameter count does not always translate into real speed, so the benefit should be checked as actual speed and memory on the target hardware. The word also names unrelated techniques: cutting off unpromising branches in search algorithms, and trimming decision trees to prevent overfitting.

Try it: questions about Pruning

Which statement about pruning neural networks is correct?

  1. AIt removes unimportant weights by zeroing them; unstructured pruning, which zeros scattered weights, is hard to accelerate in hardware
  2. BIt adds weights to always improve accuracy
  3. CIt reduces the training data
Show answer and explanation

Answer: A. It removes unimportant weights by zeroing them; unstructured pruning, which zeros scattered weights, is hard to accelerate in hardware

Pruning zeros out weights with little influence, such as those with small values, to reduce computation and memory. But when zeros are scattered, tracking where they are costs effort, and matrix units and memory operate on contiguous chunks, so the real speedup is small. Structured pruning, which zeros whole channels or layers or follows a fixed pattern, is much easier to accelerate in hardware.

Questions that mention Pruning (1)

Pruning appears in 2 practice questions across 1 topic, including AI Hardware & Software Stack.

  1. Which describes knowledge distillation?

Books on AI Hardware & Software Stack Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary