[Paper Review] Mere Contrastive Learning for Cross-Domain Sentiment Analysis
This paper proposes COBE (Mere Contrastive Learning for Cross-Domain Sentiment Analysis), a contrastive learning framework that uses in-batch negatives to align sentence representations of the same sentiment across domains while separating those of different sentiments. The method achieves state-of-the-art performance on cross-domain and multi-domain sentiment analysis benchmarks, with improved robustness and effective knowledge transfer, as validated by visualization and adversarial testing.
Cross-domain sentiment analysis aims to predict the sentiment of texts in the target domain using the model trained on the source domain to cope with the scarcity of labeled data. Previous studies are mostly cross-entropy-based methods for the task, which suffer from instability and poor generalization. In this paper, we explore contrastive learning on the cross-domain sentiment analysis task. We propose a modified contrastive objective with in-batch negative samples so that the sentence representations from the same class will be pushed close while those from the different classes become further apart in the latent space. Experiments on two widely used datasets show that our model can achieve state-of-the-art performance in both cross-domain and multi-domain sentiment analysis tasks. Meanwhile, visualizations demonstrate the effectiveness of transferring knowledge learned in the source domain to the target domain and the adversarial test verifies the robustness of our model.
Motivation & Objective
- To address the instability and poor generalization of cross-entropy-based models in cross-domain sentiment analysis.
- To explore the effectiveness of contrastive learning in supervised, cross-domain sentiment classification tasks.
- To improve knowledge transfer from source to target domains by learning disentangled, robust sentence representations.
- To enhance model robustness against adversarial examples in low-resource cross-domain settings.
- To demonstrate that contrastive learning outperforms traditional cross-entropy methods in both accuracy and generalization.
Proposed method
- Proposes a modified contrastive loss using in-batch negative samples, where same-label pairs are positive and different-label pairs are negative.
- Trains a BERT-based encoder to optimize the contrastive objective, pushing representations of same-sentiment sentences closer and different-sentiment ones apart in the latent space.
- Saves the trained sentence representations and their labels as a knowledge base for inference.
- Uses a k-Nearest Neighbors (kNN) classifier at inference time, selecting the k most similar representations from the knowledge base to vote on the test sample's sentiment.
- Employs a contrastive loss function that minimizes the distance between positive pairs and maximizes it between negative pairs using cosine similarity.
- Utilizes pre-trained BERT as the backbone model and fine-tunes it end-to-end with the contrastive objective on labeled source domain data.
Experimental results
Research questions
- RQ1Can contrastive learning improve performance and robustness in cross-domain sentiment analysis compared to cross-entropy-based methods?
- RQ2Does the proposed contrastive objective effectively transfer knowledge from source to target domains?
- RQ3How does the model perform under adversarial attacks, and does it generalize better than standard cross-entropy models?
- RQ4To what extent do the learned representations mix across domains while preserving sentiment semantics?
- RQ5Can in-batch negative sampling alone achieve strong performance without additional adversarial or domain-adaptation components?
Key findings
- COBE achieves state-of-the-art performance on the cross-domain Amazon and FDU-MTL datasets, outperforming existing methods in both cross-domain and multi-domain sentiment classification.
- On the cross-domain Amazon dataset, COBE achieves 85.4% accuracy, significantly outperforming BERT-CE (78.9%) and BERT-DAAT (83.2%).
- On the FDU-MTL dataset, COBE achieves 86.7% accuracy in the multi-domain setting, surpassing BERT-CE (80.1%) and BERT-DAAT (84.3%).
- In adversarial testing, COBE maintains 78.00% accuracy on adversarial samples from the Kitchen domain, 6.5 percentage points higher than BERT-CE.
- COBE* achieves 81.00% accuracy on multi-domain adversarial samples, 7.5 percentage points higher than BERT-CE*, demonstrating superior robustness.
- Visualization results confirm that representations of the same sentiment across different domains are closely clustered, indicating effective knowledge transfer from source to target domains.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.