[Paper Review] Dual Contrastive Learning: Text Classification via Label-Aware Data Augmentation
DualCL introduces a supervised dual contrastive loss that jointly learns input features and per-sample classifier parameters using label-aware data augmentation, improving text classification especially in low-resource settings.
Contrastive learning has achieved remarkable success in representation learning via self-supervision in unsupervised settings. However, effectively adapting contrastive learning to supervised learning tasks remains as a challenge in practice. In this work, we introduce a dual contrastive learning (DualCL) framework that simultaneously learns the features of input samples and the parameters of classifiers in the same space. Specifically, DualCL regards the parameters of the classifiers as augmented samples associating to different labels and then exploits the contrastive learning between the input samples and the augmented samples. Empirical studies on five benchmark text classification datasets and their low-resource version demonstrate the improvement in classification accuracy and confirm the capability of learning discriminative representations of DualCL.
Motivation & Objective
- Motivate and formalize the challenge of applying contrastive learning to supervised text classification.
- Propose a dual contrastive learning framework that optimizes both input representations and per-sample classifier parameters.
- Introduce label-aware data augmentation to create multiple views for each sample.
- Provide theoretical justification linking dual contrastive loss to mutual information maximization between inputs and labels.
- Empirically validate DualCL on multiple benchmark datasets, including low-resource scenarios.
Proposed method
- Define z as the input feature representation and θ as the per-sample classifier parameters.
- Introduce label-aware data augmentation by treating each label as a token and computing label-specific representations θi^k for input xi.
- Formulate two contrastive losses: Lz aligning θj^* with zi for same-label partners; Lθ aligning z with positive θ representations for same-label partners (and negatives for different labels).
- Combine losses into LDual = Lz + Lθ and jointly train with cross-entropy: Loverall = LCE + λ LDual.
- Use a pretrained encoder f (BERT/RoBERTa) with label tokens prepended to inputs; employ temperature τ and AdamW optimization; tune λ and τ.
- Provide the cross-entropy objective to align θi^*^T zi with the true label via a softmax over all class-specific z representations.
Experimental results
Research questions
- RQ1Can a dual contrastive loss that jointly reasons about input features and per-sample classifiers outperform standard supervised contrastive or cross-entropy baselines in text classification?
- RQ2Does label-aware data augmentation via label tokens improve representation learning and classifier quality, especially in low-resource settings?
- RQ3How does DualCL perform across diverse text classification datasets with varying class counts and input lengths?
Key findings
- DualCL consistently outperforms baselines across five benchmark text classification datasets using both BERT and RoBERTa encoders.
- With 10% training data, DualCL improves average accuracy over CE+CL by 0.46% (BERT) and 0.39% (RoBERTa).
- DualCL yields larger gains in low-resource scenarios, with up to 8.5% improvement on SST-2 and 5.4% on SUBJ when training data is very limited.
- Label-aware data augmentation (view generation via label tokens) benefits both input and classifier representations, as shown in tSNE visualizations and attention analyses.
- The dual contrastive term (LDual) consistently improves representations and classifier compatibility, even when used without LDual in some settings.
- Full results show DualCL achieving state-of-the-art-like performance on the examined datasets when combined with RoBERTa.
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.