TextPruner: A Model Pruning Toolkit for Pre-Trained Language Models

Ziqing Yang,Yiming Cui,Zhigang Chen
DOI: https://doi.org/10.48550/arXiv.2203.15996
2022-03-30
Abstract:Pre-trained language models have been prevailed in natural language processing and become the backbones of many NLP tasks, but the demands for computational resources have limited their applications. In this paper, we introduce TextPruner, an open-source model pruning toolkit designed for pre-trained language models, targeting fast and easy model compression. TextPruner offers structured post-training pruning methods, including vocabulary pruning and transformer pruning, and can be applied to various models and tasks. We also propose a self-supervised pruning method that can be applied without the labeled data. Our experiments with several NLP tasks demonstrate the ability of TextPruner to reduce the model size without re-training the model.
Computation and Language
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: Although large pre - trained language models (PLMs) have achieved great success in a variety of natural language processing tasks, their high demand for computing resources and memory resources limits their deployment in practical applications. Therefore, reducing the size of pre - trained models and accelerating the inference speed has become a key issue. To solve this problem, the paper introduces TextPruner, an open - source model pruning toolkit for pre - trained language models, aiming to compress models quickly and easily. TextPruner provides structured post - training pruning methods, including vocabulary pruning and transformer pruning, and can be applied to various models and tasks. In addition, the paper also proposes a self - supervised pruning method that can be applied without labeled data. Experiments on multiple NLP tasks have proven that TextPruner can reduce the model size without retraining the model.