EfficientML.ai Lecture 3 - Pruning and Sparsity (Part I) (MIT 6.5940 Fall 2026)
Overview
Pruning reduces neural-network storage and computation by removing redundant weights or channels, motivated by memory access costing over 100 times as much energy as arithmetic. The lecture compares flexible unstructured pruning with hardware-friendly structured patterns such as NVIDIA Ampere's 2:4 sparsity, and explains recovery through iterative fine-tuning alongside selection criteria including weight magnitude, channel scaling, second-order loss estimates, activation sparsity, and regression.
Key takeaways
- Memory access costs more than 100 times the energy of arithmetic in the comparison presented, making reduced parameter storage and movement a central motivation for pruning.
- Iteratively pruning and fine-tuning can reach about 90% weight removal in older models, but the lecture cautions that 95% pruning can damage task outputs.
- Unstructured sparsity offers more freedom to remove redundant weights, while structured channel pruning is easier to run with ordinary dense GPU kernels.
- NVIDIA Ampere's 2:4 pattern requires two zeros per group of four and is associated with up to 2× peak performance and roughly 1.5× measured speedup on supported operations.
- Pruning criteria range from inexpensive weight magnitude and channel-scale rankings to computationally heavier second-order loss estimates and reconstruction-error regression.
- Assigning different sparsity ratios to different layers can improve the latency-accuracy trade-off compared with applying one uniform pruning ratio everywhere.
Chapters
- Lecture 3 begins the efficient-inference section, covering pruning and sparsity before quantization, neural architecture search, and knowledge distillation.
- Later course topics include MCU deployment and writing inference software for a 256 KB microcontroller.
- The course website is EfficientML.ai, where lecture materials are posted.
- Memory access consumes more than two orders of magnitude more energy than arithmetic operations.
- Pruning turns a dense weight matrix into a sparse one by minimizing loss while constraining the number of nonzero weights.
- Reducing nonzero parameters can lower storage requirements, though the practical benefit depends on how the sparse model is executed.
- The brain analogy describes synapse density rising from roughly 2,500 per neuron at birth to about 15,000 in early childhood, then declining to roughly 7,000 in adulthood.
- Neural networks can lose individual connections or entire neurons, with neuron removal eliminating its associated incoming and outgoing connections.
- Pruning alone reduces accuracy, but fine-tuning surviving weights can recover it; AlexNet examples show recovery after removing about 80% of parameters.
- Older fully connected layers could sometimes lose around 90% of weights, while about 50% is offered as a rough modern large-language-model pruning estimate.
- Iterative pruning removes a portion of the connections, retrains the remaining model, and repeats, reaching about 90% pruning in the cited experiments.
- Older networks including AlexNet, VGG, GoogLeNet, ResNet-50, and SqueezeNet showed substantial compression, though more efficient architectures generally had less redundancy.
- Image-captioning examples remain broadly accurate at 90% pruning, while a 95% reduction can visibly distort generated captions.
- The lecture traces pruning research to the 1989 Optimal Brain Damage paper and highlights the 2015 Deep Compression work.
- Sparse computation has been implemented in specialized inference engines and FPGA-based systems, including work on sparse attention and matrix multiplication.
- NVIDIA Ampere supports 2:4 sparsity, requiring two zeros in each group of four weights.
- The cited hardware figures are up to 2× peak performance and about 1.5× measured speedup for supported sparse operations.
- Unstructured, fine-grained pruning can remove any individual weight, offering flexibility and high compression but irregular execution that is difficult to accelerate on GPUs.
- Structured options include fixed-pattern pruning, vector-level groups, whole convolution kernels, and entire channels.
- Removing rows or channels produces smaller dense matrices that can use existing GPU kernels, but may make accuracy preservation and high compression harder.
- Layer sparsity need not be uniform: the lecture contrasts shrinking every layer to 30% with assigning different ratios such as 50%, 30%, and 70%.
- Magnitude pruning removes weights with the smallest absolute values; L1 or L2 norms can score individual weights or groups such as rows.
- Learned channel scaling factors, including batch-normalization scale values, can rank channels for structured removal.
- Second-order pruning estimates loss change using curvature terms such as the Hessian, but computing these estimates can be expensive for large models.
- Automated compression can assign different pruning ratios by layer to seek a better accuracy-versus-latency trade-off.
- A percentage-of-zeros criterion measures post-ReLU activation sparsity across batches; the example removes the channel with 14 zeros out of 32 values.
- Regression-based pruning seeks to minimize reconstruction error between original outputs and outputs after channel selection and weight adjustment.
- The demonstrated optimization alternates between choosing channels with weights fixed and updating weights with channel choices fixed.
- The example uses four input channels and keeps three, representing channel selection with binary coefficients.
Transcript excerpt
0:04 Okay. Hello everyone. Um good afternoon. Let's get started. Uh so today we are going to talk about lecture three about efficient ML. Uh we are going to talk about important technique which is pruning and sparsity. Uh so uh in the previous two lectures we had a overview of this um lectures basics like what what are the basic uh concepts neurons connections weights flops how do we calculate those efficiency metrics um so from today we are going to talk about the first part of this lecture which is efficient inference. So for efficient inference techniques we are going to talk about how to reduce the number of parameters by pruning and sparsity and how to reduce the width the bit width for each parameter. So that's
0:54 quantization. We are going to spend two lectures on sparsity and two lectures on quantization and next we are going to spend two more two more lectures on neuro architecture search. So to arrive at the same accuracy you have you can have so many different neuronet network architectures. Some of them are hardware friendly, some of them are not hardware friendly. Um how do we design the architecture that give you the best trade-off between the accuracy and efficiency and then we are going to talk about knowledge distillation from a teacher model to a student model. How you transfer the knowledge? question. >> We we have the website efficientml.ai. Everything is on online. It will be posted after the lecture.
1:44 >> Yeah. >> So you can see it, right? Um the lecture slides is mostly the same as last year. So you you can also go to previous lecture uh to check the the slides and videos. and then knowledge distillation. Following that we are going to have MCU
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, MIT HAN Lab.