[Paper Review] Automatic Attention Pruning: Improving and Automating Model Pruning using Attentions
This paper proposes Automatic Attention Pruning (AAP), a novel structured pruning method that uses activation-based attention maps to identify unimportant filters and applies adaptive pruning policies to automatically meet user-defined objectives for accuracy, model size, and latency. AAP achieves state-of-the-art performance, reducing parameters by up to 89.11% and FLOPs by 80.60% with minimal accuracy loss on CIFAR-10 and ImageNet benchmarks.
Pruning is a promising approach to compress deep learning models in order to deploy them on resource-constrained edge devices. However, many existing pruning solutions are based on unstructured pruning, which yields models that cannot efficiently run on commodity hardware; and they often require users to manually explore and tune the pruning process, which is time-consuming and often leads to sub-optimal results. To address these limitations, this paper presents Automatic Attention Pruning (AAP), an adaptive, attention-based, structured pruning approach to automatically generate small, accurate, and hardware-efficient models that meet user objectives. First, it proposes iterative structured pruning using activation-based attention maps to effectively identify and prune unimportant filters. Then, it proposes adaptive pruning policies for automatically meeting the pruning objectives of accuracy-critical, memory-constrained, and latency-sensitive tasks. A comprehensive evaluation shows that AAP substantially outperforms the state-of-the-art structured pruning works for a variety of model architectures. Our code is at: https://github.com/kaiqi123/Automatic-Attention-Pruning.git.
Motivation & Objective
- To address the limitations of unstructured pruning, which hinders hardware acceleration and requires manual tuning.
- To develop an automated, structured pruning framework that adapts to diverse user objectives such as accuracy, memory, and latency constraints.
- To improve filter importance estimation beyond weight magnitude by leveraging activation-based attention maps.
- To eliminate manual hyperparameter tuning in iterative pruning by introducing adaptive thresholding based on layer-wise contributions.
- To enable hardware-efficient, small, and accurate models for deployment on resource-constrained edge devices.
Proposed method
- Proposes a novel activation-based attention mapping function that computes a 1D importance score per filter using its 2D activation feature map.
- Applies iterative structured pruning by removing filters with the lowest attention scores, guided by a global threshold that adapts to pruning objectives.
- Introduces layer-wise threshold adjustment by normalizing each layer’s remaining parameters or FLOPs relative to the total model, enabling differentiated pruning aggressiveness per layer.
- Implements three adaptive pruning policies: FLOPs-guaranteed, model-size-guaranteed, and accuracy-guaranteed, each dynamically adjusting pruning aggressiveness to meet user-defined constraints.
- Uses a global threshold that is updated iteratively based on the target metric (e.g., FLOPs, size, accuracy) to control pruning progress.
- Employs a retraining phase after each pruning round to recover accuracy, following the Lottery Ticket Hypothesis framework.
Experimental results
Research questions
- RQ1Can activation-based attention maps provide a more accurate and input-robust measure of filter importance than weight magnitude for structured pruning?
- RQ2How can structured pruning be automated to meet diverse user objectives (accuracy, size, latency) without manual hyperparameter tuning?
- RQ3Does layer-wise thresholding, based on relative contribution to model size and FLOPs, improve pruning efficiency and model performance?
- RQ4Can adaptive pruning policies outperform fixed or heuristic pruning strategies in terms of accuracy, parameter reduction, and FLOPs reduction?
- RQ5To what extent does AAP achieve hardware efficiency and real inference speedup on edge devices like Raspberry Pi?
Key findings
- On ResNet-56 with CIFAR-10, AAP achieves 79.11% parameter reduction without accuracy drop, outperforming prior works by 22.81% to 66.07% in reduction.
- For the same level of FLOPs and parameter reduction, AAP reduces accuracy loss by 0.08% to 2.61% compared to state-of-the-art methods on ResNet-50 with ImageNet.
- On VGG-19 with CIFAR-10, AAP achieves 89.11% parameter reduction and 62.51% FLOPs reduction under a 1% accuracy loss constraint, exceeding prior methods by 6.45% to 29.61% in parameter reduction.
- Inference speedup on Raspberry Pi 3B+ reaches up to 3.60× for VGG-16 with 73.89% FLOPs reduction and only 0.59% accuracy drop.
- The attention values are robust to input variation, remaining consistent across different input batches, validating the stability of the importance metric.
- AAP enables multi-objective optimization, achieving 83.11% parameter reduction and 80.60% FLOPs reduction while minimizing accuracy loss under 80% reduction constraints.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.