A Robust Contrastive Alignment Method for Multi-Domain Text Classification

Xuefeng Li, Hao Lei, Liwen Wang, Guanting Dong, Jinzheng Zhao, Jiachi Liu, Weiran Xu, Chunyun Zhang · DOI

TL;DR

This paper introduces a simpler, more robust method for multi-domain text classification that aligns features from different domains into a single space using contrastive learning. This allows a single classifier to handle texts from various sources, outperforming complex multi-classifier approaches and improving robustness through adversarial training.

What Problem Does This Paper Address?

Text classification is powerful, but models trained on one domain often struggle with data from new domains due to differences in language and style. Existing "private-shared" methods try to tackle this by using separate encoders for each domain alongside a shared one, but this becomes inefficient and difficult to manage as new domains emerge. The core challenge is to create a single model that can effectively classify text across diverse domains without needing constant retraining or domain-specific components.

Methods

The proposed Robust Contrastive Alignment (RCA) method tackles multi-domain text classification with a streamlined architecture consisting of a domain feature extractor ($F_d$), a category feature extractor ($F_c$), and a single classifier ($C$).

The key innovations are:

  • Domain Supervised Contrastive Learning (DSCL): This technique trains the domain feature extractor to pull features from the same domain closer together while pushing features from different domains apart. This helps to disentangle domain-specific information and prevent confusion.
  • Category Supervised Contrastive Learning (CSCL): This trains the category feature extractor to align features from the same category across different domains. This ensures that the core classification information is consistent regardless of the source domain.
  • Adversarial Training: To enhance robustness, the model is trained to be resilient against small perturbations in the input. This involves adding noise to the input embeddings and re-calculating the loss, forcing the model to learn more stable representations, especially for samples near the classification boundary.

By combining these, RCA aims to align all domain features into a unified feature space, enabling a single classifier to perform well across all domains.

Datasets

The paper evaluates RCA on two benchmark datasets:

  • Amazon Review Dataset: This dataset comprises four domains: books, DVDs, electronics, and kitchen. It's pre-processed into bag-of-features (unigrams and bigrams), losing word order information.
  • FDU-MTL Dataset: This is a larger dataset containing 16 domains, including movie reviews (IMDB, MR) and various Amazon product reviews (books, electronics, DVDs, etc.). This dataset uses raw text data that is tokenized.

Key Insights and Ideas

  • Simplicity is Key: The paper demonstrates that a single, unified feature space achieved through contrastive alignment can be more effective and efficient than complex private-shared frameworks with multiple classifiers.
  • Contrastive Learning for Alignment: Using contrastive learning for both domain separation and category alignment is a powerful way to force features into a consistent representation space.
  • Robustness Matters: Adversarial training significantly improves the model's ability to handle noisy or slightly perturbed data, leading to better generalization.
  • Universal Classifier Advantage: The success of a single classifier across all domains highlights the effectiveness of feature alignment in creating a truly domain-agnostic representation.

Key Results

  • RCA achieves state-of-the-art (SOTA) results on the FDU-MTL dataset.
  • On the Amazon review dataset, RCA performs comparably to or better than most multi-classifier models, outperforming the baseline CNN-single by 2.92% on Amazon and 4.25% on FDU-MTL.
  • Ablation studies show that removing any of the three core components (DSCL, CSCL, or adversarial learning) leads to a decline in performance, underscoring the importance of each part.

Limitations and Future Work

  • Unlabeled Data: The authors note that their method primarily uses annotated data, whereas some competing methods like MRAN leverage unlabeled data, which might explain why MRAN sometimes outperforms RCA. Future work could explore incorporating unlabeled data.
  • Hyperparameter Tuning: While hyperparameters are provided, the sensitivity of the model to these values in diverse real-world scenarios might warrant further investigation.
  • Scalability: While RCA is simpler than private-shared methods, its scalability to an extremely large number of domains could be a future research direction.

Summary updated

BibTeX
@inproceedings{li2022robust,
  author = {Xuefeng Li and Hao Lei and Liwen Wang and Guanting Dong and Jinzheng Zhao and Jiachi Liu and Weiran Xu and Chunyun Zhang},
  title = {{A Robust Contrastive Alignment Method for Multi-Domain Text Classification}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2022},
  doi = {10.1109/icassp43922.2022.9747192},
}
Figure