mlsanityData to 7 Oct 2026

The Impact of Quantization on the Robustness of Transformer-based Text Classifiers

arXiv 2403.05365 ↗First posted 8 Mar 2024cs.CL cs.LGcited by 2

Not on the map. Why?

Abstract (arXiv)

Transformer-based models have made remarkable advancements in various NLP areas. Nevertheless, these models often exhibit vulnerabilities when confronted with adversarial attacks. In this paper, we explore the effect of quantization on the robustness of Transformer-based models. Quantization usually involves mapping a high-precision real number to a lower-precision value, aiming at reducing the size of the model at hand. To the best of our knowledge, this work is the first application of quantization on the robustness of NLP models. In our experiments, we evaluate the impact of quantization on BERT and DistilBERT models in text classification using SST-2, Emotion, and MR datasets. We also evaluate the performance of these models against TextFooler, PWWS, and PSO adversarial attacks. Our findings show that quantization significantly improves (by an average of 18.68%) the adversarial accuracy of the models. Furthermore, we compare the effect of quantization versus that of the adversarial training approach on robustness. Our experiments indicate that quantization increases the robustness of the model by 18.80% on average compared to adversarial training without imposing any extra computational overhead during training. Therefore, our results highlight the effectiveness of quantization in improving the robustness of NLP models.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 31 of its 54 references that are in the map. First posted on arXiv 8 Mar 2024.

Builds on

31 of 54 references.

References · 31

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
  4. 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
  5. 2017Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inferencecited by 1,548
  6. 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 663
  7. 2017Adversarial Examples for Evaluating Reading Comprehension Systemscited by 568
  8. 2018Generating Natural Language Adversarial Examplescited by 422
  9. 2016Quantized Neural Networks: Training Neural Networks with Low Precision Weights and Activationscited by 413
  10. 2017A Survey of Model Compression and Acceleration for Deep Neural Networkscited by 298
  11. 2019Q8BERT: Quantized 8Bit BERTcited by 296
  12. 2016Adversarial Training Methods for Semi-Supervised Text Classificationcited by 280
19 more
  1. 2018LQ-Nets: Learned Quantization for Highly Accurate and Compact Deep Neural Networkscited by 272
  2. 2021I-BERT: Integer-only BERT Quantizationcited by 250
  3. 2019Improving Adversarial Robustness via Promoting Ensemble Diversitycited by 213
  4. 2015Yara Parser: A Fast and Accurate Dependency Parsercited by 110
  5. 2019Text Processing Like Humans Do: Visually Attacking and Shielding NLP Systemscited by 99
  6. 2019Achieving Verified Robustness to Symbol Substitutions via Interval Bound Propagationcited by 87
  7. 2022Compression of Generative Pre-trained Language Models via Quantizationcited by 79
  8. 2020SAFER: A Structure-free Approach for Certified Robustness to Adversarial Word Substitutionscited by 72
  9. 2020Robust Quantization: One Model to Rule Them Allcited by 63
  10. 2021Model Extraction and Adversarial Transferability, Your BERT is Vulnerable!cited by 51
  11. 2015Neural Networks with Few Multiplicationscited by 46
  12. 2021Generating Syntactically Controlled Paraphrases without Using Annotated Parallel Pairscited by 45
  13. 2018Robust Machine Comprehension Models via Adversarial Trainingcited by 44
  14. 2017Attacking Binarized Neural Networkscited by 28
  15. 2020EMPIR: Ensembles of Mixed Precision Deep Networks for Increased Robustness against Adversarial Attackscited by 28
  16. 2021Automatic Mixed-Precision Quantization Search of BERTcited by 16
  17. 2019White-to-Black: Efficient Distillation of Black-Box Adversarial Attackscited by 14
  18. 2019Discretization based Solutions for Secure Machine Learning against Adversarial Attackscited by 10
  19. 2018SlimNets: An Exploration of Deep Model Compression and Accelerationcited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.