๐ 90% Sparse BERT-Large (uncased) Prune Once for All
This is a sparse pre-trained model that can be fine-tuned for various language tasks. By pruning weights to zero, it reduces computational overhead while retaining important information.
๐ Quick Start
Here is an example of how to import this model in Python:
import transformers
model = transformers.AutoModelForQuestionAnswering.from_pretrained('Intel/bert-large-uncased-sparse-90-unstructured-pruneofa')
For more code examples, refer to the GitHub Repo.
โจ Features
- Sparse Pre - training: The model uses weight pruning to create sparse matrices, reducing computational overhead.
- Fine - Tunable: Can be fine - tuned for multiple language tasks such as question - answering, natural language inference, and sentiment classification.
๐ฆ Installation
No specific installation steps are provided in the original document.
๐ป Usage Examples
Basic Usage
import transformers
model = transformers.AutoModelForQuestionAnswering.from_pretrained('Intel/bert-large-uncased-sparse-90-unstructured-pruneofa')
๐ Documentation
Model Details
This model is a sparse pre - trained model. The weight pruning process sets some neural network weights to zero, resulting in sparser matrices and reduced computational overhead. The "sparse" in the model title indicates the sparsity ratio of the weights. For more details, read Zafrir et al. (2021).
Visualization of Prunce Once for All method from Zafrir et al. (2021):

Property |
Details |
Model Authors - Company |
Intel |
Date |
September 30, 2021 |
Version |
1 |
Model Type |
NLP - General sparse language model |
Architecture |
"The method consists of two steps, teacher preparation and student pruning. The sparse pre - trained model we trained is the model we use for transfer learning while maintaining its sparsity pattern. We call the method Prune Once for All since we show how to fine - tune the sparse pre - trained models for several language tasks while we prune the pre - trained model only once." (Zafrir et al., 2021) |
Paper or Other Resources |
Zafrir et al. (2021); GitHub Repo |
License |
Apache 2.0 |
Questions or Comments |
Community Tab and Intel Developers Discord |
Intended Use
Intended Use |
Description |
Primary intended uses |
This is a general sparse language model; in its current form, it is not ready for downstream prediction tasks, but it can be fine - tuned for several language tasks including (but not limited to) question - answering, genre natural language inference, and sentiment classification. |
Primary intended users |
Anyone who needs an efficient general language model for other downstream tasks. |
Out - of - scope uses |
The model should not be used to intentionally create hostile or alienating environments for people. |
Metrics (Model Performance)
All the results are the mean of two separate experiments with the same hyper - parameters and different seeds.
Training and Evaluation Data
Property |
Details |
Datasets |
English Wikipedia Dataset (2500M words). |
Motivation |
To build an efficient and accurate base model for several downstream language tasks. |
Preprocessing |
"We use the English Wikipedia dataset (2500M words) for training the models on the pre - training task. We split the data into train (95%) and validation (5%) sets. Both sets are preprocessed as described in the modelsโ original papers (Devlin et al., 2019, Sanh et al., 2019). We process the data to use the maximum sequence length allowed by the models, however, we allow shorter sequences at a probability of 0:1." |
Ethical Considerations
Ethical Considerations |
Description |
Data |
The training data come from Wikipedia articles |
Human life |
The model is not intended to inform decisions central to human life or flourishing. It is an aggregated set of labelled Wikipedia articles. |
Mitigations |
No additional risk mitigation strategies were considered during model development. |
Risks and harms |
Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al., 2021, and Bender et al., 2021). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups. Beyond this, the extent of the risks involved by using the model remain unknown. |
Use cases |
- |
Caveats and Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. There are no additional caveats or recommendations for this model.
๐ง Technical Details
The weight pruning process forces some neural network weights to zero, creating sparser matrices. This reduces computational overhead during matrix multiplication while retaining enough important information.
๐ License
This model is licensed under the Apache 2.0 license.
BibTeX entry and citation info
@article{zafrir2021prune,
title={Prune Once for All: Sparse Pre-Trained Language Models},
author={Zafrir, Ofir and Larey, Ariel and Boudoukh, Guy and Shen, Haihao and Wasserblat, Moshe},
journal={arXiv preprint arXiv:2111.05754},
year={2021}
}