Introduction
In traditional Natural Language Understanding (NLU) classification, class labels are typically treated as arbitrary numerical indices (one-hot vectors). This approach ignores the rich semantic information inherent in label names like "Sentiment" or "Linguistic Acceptability." Researchers from JD AI have introduced LaCon (Label Anchored Contrastive Learning), a novel framework that treats class labels as semantic anchors. By aligning text representations with these label embeddings, LaCon significantly improves model performance, particularly in data-scarce and imbalanced scenarios.
Addressing the NLP Contrastive Learning Gap
Contrastive Learning (CL) has seen immense success in computer vision by teaching models to recognize similarities between different "views" of the same image. However, applying CL to NLP faces two primary hurdles:
- Augmentation Difficulty: Unlike images, which can be flipped or cropped, modifying text often alters its meaning or grammatical structure, making it difficult to generate reliable positive pairs.
- Label Underutilization: Standard supervised models fail to leverage the semantic relationships between labels and the input text.
LaCon bypasses the need for complex data augmentation by using label embeddings as the ground-truth "positive" view for every instance, creating a more stable and semantically grounded training signal.
The LaCon Framework
LaCon introduces three distinct contrastive objectives designed to be integrated into standard pre-trained models like BERT:
- Instance-Centered Contrastive Loss (ICL): Each text instance acts as an anchor, pulled toward its correct label embedding and pushed away from others. It utilizes a multi-head mechanism to capture diverse semantic facets.
- Label-Centered Contrastive Loss (LCL): The label itself serves as the anchor, pulling all instances of its class closer while repelling instances from other classes. This provides a more consistent global signal than instance-to-instance comparisons.
- Label Embedding Regularizer (LER): This loss ensures that label embeddings are distributed uniformly across the feature space, preventing "representation degeneration" where embeddings cluster too tightly.
Additionally, the authors proposed LaCon-fusion, a mechanism where learned label embeddings "attend" to specific words in the input text, highlighting the most relevant tokens for classification.
Experimental Performance
The model was rigorously tested across major benchmarks, including GLUE (English) and CLUE (Chinese). LaCon-fusion consistently outperformed standard BERT fine-tuning, showing improvements of up to 4.1% on standard benchmarks.
Few-Shot and Imbalanced Scenarios
The framework's most striking gains appear in low-resource settings. In few-shot benchmarks with as few as 20 samples per class, LaCon demonstrated improvements of up to 9.4% over baseline methods. By sharing label embeddings across the dataset, the model effectively transfers knowledge from frequent classes to infrequent ones, mitigating the impact of data imbalance.
Visual analysis via t-SNE confirms these results, showing that LaCon produces well-separated, tight clusters centered around label anchors, whereas standard cross-entropy training often results in overlapping and messy representations.
Conclusion
LaCon represents a significant shift in how labels are utilized in NLU. By transforming labels from passive indices into active semantic anchors, the framework achieves superior representation learning without the need for problematic text augmentation. Future work aims to extend this label-anchored approach to sequence labeling, generative tasks, and cross-modal domains such as computer vision and speech.
Summary updated