TL;DR
MultiRep is a novel approach to few-shot relation classification that extracts and aligns multiple internal model representations—such as [CLS], [MASK], and entity markers—within a single forward pass. By applying contrastive learning to these diverse "views" of a sentence, the model achieves state-of-the-art performance on the FewRel benchmark, proving particularly robust in low-resource settings where textual relation descriptions are unavailable.
What Problem Does This Paper Address?
Relation Classification (RC) involves identifying the specific relationship between two entities in a sentence (e.g., determining that "Jürgen Hasler" has a "sport" relationship with "alpine skier"). In real-world scenarios, we often face a few-shot challenge: we need to classify new, unseen relation types using only a handful of labeled examples.
While standard methods typically rely on "entity markers" (special tokens added around the entities of interest) to extract features, the authors argue that this ignores a wealth of discriminative information hidden in other parts of the model, such as the [CLS] token or the [MASK] token used in prompting. The challenge lies in effectively distilling and aligning these disparate internal representations to create a more powerful, unified embedding for classification.
Methods
The authors introduce MultiRep, a framework built on top of BERT-Base that leverages multiple sentence representations simultaneously.
1. Multi-View Representations
Instead of picking one representation, MultiRep extracts five different "views" from a single forward pass:
- [CLS] token: Captures global sequence information.
- [MASK] token: Extracted via a prompt template (e.g.,
[MASK]: [sentence]), leveraging the model's masked language modeling knowledge. - Entity Markers: Concatenated representations of the start tokens for the two entities.
- Average Pooling: The mean of all token representations in the sequence.
2. Contrastive Learning Objectives
To make these views work together, the authors employ two contrastive loss functions:
- Representation-Representation Contrastive Loss ($\mathcal{L}_{RCL}$): This forces different representations of the same sentence to be similar in vector space, while pushing away representations of different sentences. This encourages the model to extract complementary, discriminative features across all views.
- Instance-Relation Description Contrastive Loss ($\mathcal{L}_{RDCL}$): If textual descriptions of relations are available, this loss aligns the sentence embeddings with the embeddings of their corresponding relation descriptions.
Datasets
The model was evaluated on FewRel, a large-scale few-shot relation classification dataset. It contains 100 relation types, each with 700 instances. The dataset is split into 64 relations for training, 16 for validation, and 20 for testing, ensuring that the model must generalize to entirely new relation types during evaluation.
Key Insights and Ideas
- Untapped Potential: The paper demonstrates that standard RC models leave significant information "on the table" by only using entity markers. Combining global (
[CLS]), local (entity markers), and task-specific ([MASK]) views provides a much richer signal. - Alignment is Key: Simply concatenating representations isn't enough. The contrastive loss $\mathcal{L}_{RCL}$ is crucial because it filters out noise and ensures that the differentiating factors in the embeddings actually reflect the underlying semantics of the sentence.
- Resource Efficiency: Unlike methods that require multiple passes or complex data augmentation, MultiRep generates all its views in a single forward pass, making it highly efficient.
- Visualizing Success: t-SNE projections (Figures 3 and 4) reveal that MultiRep significantly improves the clustering of "hard" relation types (like "mother" vs. "spouse"), which are often confused by standard models.
Key Results
MultiRep achieved state-of-the-art results on the FewRel benchmark:
- Without Relation Descriptions: MultiRep outperformed all benchmarks, including SimpleFSRE and HCRP. In the 5-way 1-shot setting, it reached 87.13% accuracy (validation).
- With Relation Descriptions: Performance climbed even higher, reaching 92.73% in the 5-way 1-shot setting.
- Ablation Studies: Removing any single representation (like
[CLS]or[MASK]) or either contrastive loss term led to a measurable drop in performance, validating the "multi-view" approach. - Scalability: As shown in Figure 2, increasing the number of representations ($M$) consistently leads to higher accuracy and lower variance.
Limitations and Future Work
The authors acknowledge a few trade-offs:
- Memory Overhead: Concatenating multiple representations results in larger embedding vectors, which increases memory usage and computational requirements for the final classification layers.
- Training Complexity: Implementing contrastive learning adds an extra layer of complexity to the training pipeline.
- Generalization: While highly effective for few-shot RC, the authors note that performance might vary when applied to other types of NLP tasks. Future work could explore how this multi-view alignment transfers to broader information extraction challenges.
Summary updated