AxFormer: Accuracy-driven Approximation of Transformers for Faster, Smaller and more Accurate NLP Models
Open accessThe DOI matches its Crossref record; 28 of the 28 references it cites were found in a registry or an index.
Abstract
Transformers have greatly advanced the state-of-the-art in Natural Language Processing (NLP) in recent years, but present very large computation and storage requirements. We observe that the design process of Transformers (pre-train a foundation model on a large dataset in a self-supervised manner, and subsequently fine-tune it for different downstream tasks) leads to task-specific models that are highly over-parameterized, adversely impacting both accuracy and inference efficiency. We propose AxFormer, a systematic framework that applies accuracy-driven approximations to create optimized transformer models for a given downstream task. AxFormer combines two key optimizations — accuracy-driven pruning and selective hard attention. Accuracy-driven pruning identifies and removes parts of the fine-tuned transformer that hinder performance on the given downstream task. Sparse hard-attention optimizes attention blocks in selected layers by eliminating irrelevant word aggregations, thereby helping the model focus only on the relevant parts of the input. In effect, AxFormer leads to models that are more accurate, while also being faster and smaller. Our experiments on GLUE and SQUAD tasks show that AxFormer models are up to 4.5% more accurate, while also being up to 2.5× faster and up to 3.2× smaller than conventional fine-tuned models. In addition, we demonstrate that AxFormer can be combined with previous efforts such as distillation or quantization to achieve further efficiency gains. Code is available at https://github.com/amrnag/Specialized-Transformers.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
In the citing paper
“Their technique leads to smaller, faster and more accurate models.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [83]
In the citing paper
“Finally, their technique has small latency since it only requires multiple iterations on a small validation set and no finetuning or retraining.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [83]
In the citing paper
“Also, their models are relatively insensitive to the choice of random seed initialization.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [83]
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018) · arXiv · doi:10.48550/arxiv.1810.04805 · Cited by 73,173 · cited 1×
“Transformer models [2], [15], [1] have revolutionized the field of Natural Language Processing (NLP), greatly advancing”
BackgroundBERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019) · Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) · doi:10.18653/v1/n19-1423 · Cited by 54,325 · cited 1×
“Transformer models [2], [15], [1] have revolutionized the field of Natural Language Processing (NLP), greatly advancing”
BackgroundLanguage Models are Few-Shot Learners
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020) · arXiv · doi:10.48550/arxiv.2005.14165 · Cited by 23,372 · cited 2×
“Current state-of-the-art transformer networks (such as GPT3 [1]) have hundreds of billions of parameters.”
BackgroundDistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
Sanh, V., Debut, L., Chaumond, J., & Wolf, T. (2019) · arXiv · doi:10.48550/arxiv.1910.01108 · Cited by 13,823 · cited 7×
“AxFormer versions of Q8BERT-base and DistilBERT-base models exceed the accuracy of BERT-base models, while being up to 3.7 × faster and 12.1 × smaller than BERT-base .”
BackgroundInfluentialKaugeranna, R., Kaugeranna, E., & Aion, (. S. 4. 6. (2023) · DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · doi:10.4230/lipics.giscience.2023.43 · Cited by 13,690
SQuAD: 100,000+ Questions for Machine Comprehension of Text
Rajpurkar, P., Zhang, J., Lopyrev, K., & Liang, P. (2016) · Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d16-1264 · Cited by 6,208 · cited 1×
“1 [16], a Question Answering task, in Table I.”
BackgroundALBERT: A Lite BERT for Self-supervised Learning of Language Representations
Lan, Z., Chen, M., Goodman, S., Gimpel, K., Sharma, P., & Soricut, R. (2019) · arXiv · doi:10.48550/arxiv.1909.11942 · Cited by 4,308 · cited 1×
“AlBERT [9] uses factorized embeddings and cross-layer parameter sharing.”
MethodGLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding
Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., & Bowman, S. (2018) · Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP · doi:10.18653/v1/w18-5446 · Cited by 4,222 · cited 3×
“For GLUE, we present results on the test set using the GLUE evaluation server to obtain the scores [24], and for SQUAD, we present results on the dev set.”
MethodThe Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks
Frankle, J., & Carbin, M. (2018) · arXiv · doi:10.48550/arxiv.1803.03635 · Cited by 3,763
HuggingFace's Transformers: State-of-the-art Natural Language Processing
Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., et al. (2019) · arXiv · doi:10.48550/arxiv.1910.03771 · Cited by 3,347
TinyBERT: Distilling BERT for natural language understanding
Jiao, X., Yin, Y., Shang, L., Jiang, X., Chen, X., Li, L., Wang, F., & Liu, Q. (2020) · Findings of the Association for Computational Linguistics: EMNLP 2020 · doi:10.18653/v1/2020.findings-emnlp.372 · Cited by 1,786
What Does BERT Learn about the Structure of Language?
Jawahar, G., Sagot, B., & Seddah, D. (2019) · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/p19-1356 · Cited by 1,291 · cited 1×
“this problem utilizes the unique linguistic properties captured by the different transformer layers [7] to guide the ordering of elements for inspection (line 8 in Alg.”
BackgroundPruning Convolutional Neural Networks for Resource Efficient Inference
Molchanov, P. A., Tyree, S., Karras, T., Aila, T., & Kautz, J. (2016) · arXiv (Cornell University) · doi:10.48550/arxiv.1611.06440 · Cited by 1,239
MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices
Sun, Z., Yu, H., Song, X., Liu, R., Yang, Y., & Zhou, D. (2020) · Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2020.acl-main.195 · Cited by 757
Zafrir, O., Boudoukh, G., Izsak, P., & Wasserblat, M. (2019) · 2019 Fifth Workshop on Energy Efficient Machine Learning and Cognitive Computing - NeurIPS Edition (EMC2-NIPS) · doi:10.1109/emc2-nips53020.2019.00016 · Cited by 442
Zafrir, O., Boudoukh, G., Izsak, P., & Wasserblat, M. (2019) · arXiv · doi:10.48550/arxiv.1910.06188 · Cited by 441
Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
Shen, S., Dong, Z., Ye, J., Ma, L., Yao, Z., Gholami, A., Mahoney, M. W., & Keutzer, K. (2020) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v34i05.6409 · Cited by 437
Fine-Tuning Pretrained Language Models: Weight Initializations, Data Orders, and Early Stopping
Dodge, J., Ilharco, G., Schwartz, R., Farhadi, A., Hajishirzi, H., & Smith, N. (2020) · arXiv · doi:10.48550/arxiv.2002.06305 · Cited by 412 · cited 2×
“This leads to unstable models [3] with sub-optimal generalization ability [12].”
BackgroundMethodAre Sixteen Heads Really Better than One?
Michel, P., Levy, O., & Neubig, G. (2019) · arXiv · doi:10.48550/arxiv.1905.10650 · Cited by 404 · cited 1×
“This leads to unstable models [3] with sub-optimal generalization ability [12].”
BackgroundReducing Transformer Depth on Demand with Structured Dropout
Fan, A., Grave, E., & Joulin, A. (2019) · arXiv · doi:10.48550/arxiv.1909.11556 · Cited by 387 · cited 1×
“LayerDrop [4] randomly drops layers during pretraining, thereby enabling their dropping during inference.”
BackgroundBERT-of-Theseus: Compressing BERT by Progressive Module Replacing
Xu, C., Zhou, W., Ge, T., Wei, F., & Zhou, M. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.633 · Cited by 168
Lite Transformer with Long-Short Range Attention
Wu, Z., Liu, Z., Lin, J., Lin, Y., & Han, S. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2004.11886 · Cited by 155 · cited 6×
“Transformers are pre-trained on a large text corpus through a self-supervised NLP task, such as predicting the next word in text given all the preceding words.”
MethodInfluentialDynaBERT: Dynamic BERT with Adaptive Width and Depth
Hou, L., Huang, Z., Shang, L., Jiang, X., Chen, X., & Liu, Q. (2020) · arXiv · doi:10.48550/arxiv.2004.04037 · Cited by 143
When BERT Plays the Lottery, All Tickets Are Winning
Prasanna, S., Rogers, A., & Rumshisky, A. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.259 · Cited by 131
Train Big, Then Compress: Rethinking Model Size for Efficient Training and Inference of Transformers
Li, Z., Wallace, E., Shen, S., Lin, K., Keutzer, K., Klein, D., & Gonzalez, J. E. (2020) · International Conference on Machine Learning · Cited by 125
Poor Man's BERT: Smaller and Faster Transformer Models.Preprint
Sajjad, H., Dalvi, F., Durrani, N., & Nakov, P. (2020) · arXiv (Cornell University) · Cited by 102
Super Tickets in Pre-Trained Language Models: From Model Compression to Improving Generalization
Liang, C., Zuo, S., Chen, M., Jiang, H., Liu, X., He, P., Zhao, T., & Chen, W. (2021) · doi:10.18653/v1/2021.acl-long.510 · Cited by 82 · cited 2×
“Super-tickets [11] demonstrate that accuracy can be improved by finding winning lottery tickets at low levels of pruning.”
BackgroundMethodGood Subnetworks Provably Exist: Pruning via Greedy Forward Selection
Ye, M., Gong, C., Nie, L., Zhou, D., Klivans, A. R., & Liu, Q. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2003.01794 · Cited by 46 · cited 1×
“Pruning has been applied to various classes of neural networks, including transformers ([5], [13], [17]), and pruning strategies have been explored to identify weights and parameters that the output is least sensitive to ([6], [25]).”
Method
Research works printed but not linked: 1
- Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
Cited by
Zhang, H., & Shafiq, M. O. (2024) · Journal Of Big Data · doi:10.1186/s40537-023-00842-0 · Cited by 219
A Survey of Techniques for Optimizing Transformer Inference
Chitty-Venkata, K. T., Mittal, S., Emani, M., Vishwanath, V., & Somani, A. K. (2023) · Journal of Systems Architecture · doi:10.1016/j.sysarc.2023.102990 · Cited by 154
Softermax: Hardware/Software Co-Design of an Efficient Softmax for Transformers
Stevens, J. R., Venkatesan, R., Dai, S., Khailany, B., & Raghunathan, A. (2021) · 2021 58th ACM/IEEE Design Automation Conference (DAC) · doi:10.1109/dac18074.2021.9586134 · Cited by 148
Self-citationA 95.6-TOPS/W Deep Learning Inference Accelerator With Per-Vector Scaled 4-bit Quantization in 5 nm
Keller, B., Venkatesan, R., Dai, S. X., Tell, S. G., Zimmer, B., Sakr, C., Dally, W. J., Gray, C. T., & Khailany, B. (2023) · IEEE Journal of Solid-State Circuits · doi:10.1109/jssc.2023.3234893 · Cited by 74
“Algorithmic optimizations have been employed to reduce network size using techniques, such as knowledge distillation [33], inductive biases [34], and approximations [35], [36], [37], [38].”
MethodWatson, E. ‘., Viana, T., & Zhang, S. (2023) · AI · doi:10.3390/ai4010007 · Cited by 24
“Approximate computing and neuron reuse have also been proposed as optimization methods [376,377].”
Method
Metadata
- Authors
- Nagarajan, A., Sen, S., Stevens, J. R., & Raghunathan, A.
- Affiliations
- Purdue University West Lafayette (US)
- Venue
- 2022 International Joint Conference on Neural Networks (IJCNN)
- Publisher
- IEEE
- Published
- 2022-07-18
- Pages
- 1-8
- ISSN
- 2161-4407 (ISSN-L)
- OpenAlex
- W4312772368
- Semantic Scholar
- af8c3135266e0abd942bb6e72e193afa44cefb25
- Cited by
- 3
- References
- 27
- Citations by year
- 2023: 3
- FWCI
- 0.27
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- International Joint Conference on Neural Networks (IJCNN) (publishedVersion)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Funders
- Semiconductor Research Corporation
- Topics
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Keywords
- sparse attention, model size reduction, inference efficiency, knowledge distillation, quantization
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.