Adversarially Robust and Explainable Model Compression with On-Device Personalization for Text Classification

Yao Qiang, Supriya Tumkur Suresh Kumar, Marco Brocanelli, Dongxiao Zhu

Abstract

Deep Neural Networks (DNNs) for Natural Language Processing (NLP) are often too resource-intensive for mobile deployment. Standard compression techniques frequently compromise adversarial robustness and explainability. This paper introduces a novel framework for compressing Recurrent Neural Networks (RNNs) that maintains security and transparency. By utilizing Guided Complement Entropy (GCE) for robustness and aspect-based feature mapping for explainability, the authors achieve a 10x reduction in model size while enabling on-device personalization using private user data.

Introduction

While Deep Neural Networks (DNNs) have revolutionized Natural Language Processing (NLP), they are notoriously "heavy," requiring significant memory and computational power. Moving these models to mobile devices (on-device AI) usually involves model compression, which often introduces three critical flaws: information loss, adversarial vulnerability, and the "black box" problem. The authors aim to bridge the gap between efficiency and "trustworthy AI" by creating a compression scheme that treats robustness and explainability as first-class citizens during the training process.

Methodology

The authors propose a multi-stage training scheme that transitions from a "Full Model" (Teacher) on the cloud to a "Compressed Model" (Student) on the device.

Overview of the proposed framework, illustrating the transition from a cloud-based pre-trained full network to a compressed on-device model with personalization.

Robust Training and Distillation

Instead of standard Cross-Entropy, the framework uses Guided Complement Entropy (GCE). This loss function encourages the model to distribute predicted probabilities of "false" classes equally, making it harder for adversarial attacks to find a "weak spot" to exploit. To minimize information loss, the student model uses autoencoders to align its internal embedding and latent layers with the teacher’s high-dimensional features.

Explainability and Personalization

The model maps latent features to specific "aspects" (e.g., in a restaurant review, aspects might be food, price, service). By minimizing the distance between general features and these aspect-guided features, the model's decision-making process becomes intrinsically tied to human-understandable concepts. Once deployed, the model is fine-tuned using the user's private data. They use a temperature-scaled distillation loss to help the model adapt to local data distributions while retaining the global knowledge learned on the cloud.

Experimental Setup

The study utilizes several standard and specialized benchmarks:

  • General Classification: Amazon (Sentiment), Yelp (Sentiment), AG’s News (Categorization), and Yahoo (Topic Classification).
  • Explainability: Rest-2014 (SemEval 2014), which contains restaurant reviews labeled with specific aspects.
  • Personalization: Senti140 (from the LEAF benchmark), used to simulate 5,000 different users.

Key Results

The compressed models used roughly 200K parameters, compared to the 2M parameters in the full models—a 10x reduction. Against the "Replaceone" attack (swapping adjacent letters), the proposed model maintained significantly higher accuracy than standard compressed models (e.g., 49.0% vs 37.9% on Amazon).

Performance comparison between the full model, a baseline compact model, and the proposed compact model across accuracy, F1-score, and hit-ratio.

Integrating aspect-based mapping acts as a form of regularization that helps the compressed model maintain a higher "hit-ratio" (accuracy in identifying the pivotal reason for a classification), improving overall performance by 12% compared to baseline compact models. Furthermore, personalization via on-device fine-tuning significantly boosted accuracy for individual users, demonstrating that local adaptation can overcome the limitations of a "one-size-fits-all" global model.

Conclusion

The proposed framework demonstrates that robustness and explainability can be effectively "distilled" into compact models. While the current focus is on RNN-based architectures, the authors plan to extend this framework to Transformer-based models like MobileBERT or TinyBERT to keep pace with industry shifts.

Summary updated

BibTeX
@misc{qiang2021adversarially,
  author = {Yao Qiang and Supriya Tumkur Suresh Kumar and Marco Brocanelli and Dongxiao Zhu},
  title = {{Adversarially Robust and Explainable Model Compression with On-Device Personalization for Text Classification}},
  year = {2021},
  eprint = {2101.05624},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.05624},
}
Figure