Efficient Transformer-based Large Scale Language Representations using Hardware-friendly Block Structured Pruning

Bingbing Li, Zhenglun Kong, Tianyun Zhang, Ji Li, Zhengang Li, Hang Liu, Caiwen Ding

Abstract

Large-scale language models (LLMs) like BERT and RoBERTa offer state-of-the-art performance but are difficult to deploy on edge devices due to their immense parameter counts. Traditional weight pruning often results in irregular sparsity that standard hardware cannot efficiently accelerate. This paper introduces Hardware-friendly Block Structured Pruning (BSP), which organizes weight matrices into uniform blocks for pruning. By employing a reweighted Group Lasso optimization within a three-stage pipeline, the authors demonstrate that models can be compressed by up to 5x with negligible accuracy degradation across the GLUE benchmark.

Introduction

Large-scale language models (LLMs) are incredibly capable but notoriously "heavy." Models like BERT and RoBERTa contain hundreds of millions—and now billions—of parameters, creating a massive bottleneck for deployment on edge devices with limited memory and processing power.

While "weight pruning" (deleting unnecessary connections) is a common solution, it usually results in irregular sparsity. This "irregularity" often requires complex indexing that eats up storage savings and fails to provide actual speedups on standard hardware like GPUs. This paper tackles the challenge of achieving high compression rates in the sensitive domain of NLP while maintaining a structure that hardware can efficiently process.

Methods

The authors introduce Hardware-friendly Block Structured Pruning (BSP). Instead of pruning individual weights, they divide the weight matrices into small, uniform blocks.

Overview of the Row and Column Pruning process within blocks.

Key components include:

  • Block-Level Granularity: Pruning is executed by excluding entire rows or columns within these blocks. This significantly reduces the metadata (indices) needed to store the model and allows for parallelized matrix multiplication.
  • Reweighted Group Lasso Optimization: To decide which blocks to cut, a "Group Lasso" regularization technique is used. The "reweighted" version dynamically adjusts the penalty for different blocks during training, allowing the model to protect "important" semantic information while aggressively pruning redundant areas.
  • Three-Stage Pipeline: The process involves (1) Reweighted Training to encourage block sparsity, (2) Pruning blocks below a threshold, and (3) Retraining to recover accuracy.

Experimental Setup

The method was evaluated using the GLUE (General Language Understanding Evaluation) benchmark across three major architectures: BERT-base, RoBERTa-base, and DistilBERT. The benchmark includes tasks ranging from single-sentence classification (CoLA, SST-2) to inference tasks (MNLI, QNLI, RTE, WNLI).

Results

Performance comparison across GLUE tasks for various models and compression rates. Source, p. 6

Performance comparison across GLUE tasks for various models and compression rates.

The results demonstrate that BERT-Base can achieve up to 5.0× compression on certain tasks with negligible accuracy degradation. Notably, the method is orthogonal to Knowledge Distillation; applying BSP to an already-compact model like DistilBERT yielded an additional 1.79× average compression. Because the sparsity is structured, these models are compatible with compiler-assisted acceleration frameworks, enabling actual execution speedups on edge devices rather than just theoretical storage savings.

Discussion and Limitations

The paper identifies a "sweet spot" between layer-wise and weight-wise pruning. However, task-specific sensitivity remains a challenge; some tasks (like MNLI and QNLI) are more sensitive to high compression than others. Additionally, while the structure is hardware-friendly, the reweighted Lasso approach requires careful hyperparameter tuning, which can be computationally expensive during the training phase.

Conclusion

BSP provides a viable path for deploying high-performance NLP models on mobile and embedded systems by balancing the flexibility of fine-grained pruning with the efficiency of coarse-grained methods. Future work may focus on automating hyperparameter searches and conducting detailed wall-clock latency benchmarks across specific mobile hardware.

Summary updated

BibTeX
@inproceedings{li2020efficient,
  author = {Bingbing Li and Zhenglun Kong and Tianyun Zhang and Ji Li and Zhengang Li and Hang Liu and Caiwen Ding},
  title = {{Efficient Transformer-based Large Scale Language Representations using Hardware-friendly Block Structured Pruning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.findings-emnlp.286},
}
Figure