Introduction
Large-scale pre-trained Transformers, such as BERT and BART, have become indispensable for state-of-the-art performance in Natural Language Processing (NLP). However, their massive parameter counts lead to significant computational and memory overhead, complicating deployment in resource-constrained environments. Traditionally, practitioners have relied on two primary compression techniques: weight pruning and knowledge distillation.
Weight pruning can reduce model size by over 90%, but often results in "unstructured" sparsity—scattered weights that standard hardware like CPUs and GPUs cannot process efficiently. Conversely, distillation creates smaller, dense models (e.g., DistilBERT) that are fast but often less efficient at capturing the full knowledge of the teacher model compared to aggressive pruning. This paper introduces Block Movement Pruning, a technique designed to bridge this "sparsity-speed gap" by pruning models in structured, hardware-friendly chunks.
Methodology: Block Movement Pruning
The core innovation lies in applying "movement pruning"—which retains weights based on the evolution of their importance scores during fine-tuning—to fixed-size blocks rather than individual parameters.
The Block Approach
Instead of masking individual weights, the algorithm masks contiguous blocks (e.g., 32x32). If the collective importance score of a block falls below a specific threshold, the entire block is removed. This ensures that the remaining weights are stored in contiguous memory, which is critical for achieving high throughput on modern hardware.
Hybrid and Hybrid Filled Pruning
The researchers observed that different Transformer components benefit from different pruning shapes. They developed a Hybrid strategy:
- Multi-Head Attention (MHA): Uses square blocks.
- Feed-Forward Networks (FFN): Employs "dimension pruning," removing entire rows or columns.
In the Hybrid Filled variant, once rows or columns in the FFN are identified for pruning, the remaining weights are "crunched" together into a smaller, dense matrix. This allows the model to leverage standard, highly-optimized linear algebra libraries during inference, maximizing speed gains.
Experimental Results
The authors evaluated Block Movement Pruning across several benchmarks, including SQuAD (v1.1 and v2), GLUE (MNLI, QQP, SST-2), and CNN/DailyMail for summarization.
Performance and Speedup
On the SQuAD v1.1 task, the method achieved a 2.4x speedup and a 74% reduction in model size, with only a 1% decrease in F1 score. As shown in the performance curves, the Hybrid Filled approach consistently outperforms standard movement pruning and block pruning in the speed-to-accuracy trade-off.
Comparison to Distillation
On the QQP task, Hybrid Pruning achieved a 2.3x speedup with a 1% loss in F1, surpassing the efficiency of standard distilled models like DistilBERT. This suggests that task-specific pruning can "discover" more optimal sub-structures than fixed, human-designed distilled architectures.
Key Insights
- Emergent Component Pruning: Even with 32x32 blocks, the model naturally learns to prune entire functional units, such as individual attention heads.
- The Large Teacher Advantage: Pruning a BERT-base model using a BERT-large teacher (Hybrid Filled LT) yielded significantly better results than using a BERT-base teacher. The higher-quality "dark knowledge" from the larger teacher appears to be a critical factor for aggressive compression.
- Quantization Compatibility: The method is compatible with 8-bit quantization, enabling further gains in storage and execution speed without substantial accuracy loss.
Conclusion and Future Work
Block Movement Pruning provides a robust framework for deploying high-performance Transformers where latency and memory are constrained. While the method requires more training epochs than standard fine-tuning and could benefit from further GPU kernel optimization, it represents a significant step toward making Transformers fast, not just small. Future work may explore more specialized kernels to reach the theoretical maximum speedups offered by block-sparse structures.
Summary updated