Abstract
Relation classification (RC) plays a pivotal role in both natural language understanding and knowledge graph completion. It is generally formulated as a task to recognize the relationship between two entities of interest appearing in a free-text sentence. Conventional approaches on RC, regardless of feature engineering or deep learning based, can obtain promising performance on categorizing common types of relation leaving a large proportion of unrecognizable long-tail relations due to insufficient labeled instances for training. In this paper, we consider few-shot learning is of great practical significance to RC and thus improve a modern framework of metric learning for few-shot RC. Specifically, we adopt the large-margin ProtoNet with fine-grained features, expecting they can generalize well on long-tail relations. Extensive experiments were conducted by FewRel, a large-scale supervised few-shot RC dataset, to evaluate our framework: LM-ProtoNet (FGF). The results demonstrate that it can achieve substantial improvements over many baseline approaches.
1. Introduction
Relation Classification (RC) involves identifying the semantic connection between two entities within a sentence (e.g., "Paris" and "France" in the relation capital_of). While modern deep learning models perform exceptionally well on common relations with abundant training data, they struggle with "long-tail" relations—rare types that lack sufficient labeled examples.
This paper addresses few-shot relation classification, where a model must learn to recognize novel relation types after seeing only one or five examples. Traditional meta-learning approaches, such as Prototypical Networks (ProtoNet), often rely on global sentence embeddings that may overlook subtle linguistic cues. Furthermore, their training objectives do not always ensure sufficient separation between different relation types in the embedding space.
2. Methodology: LM-ProtoNet (FGF)
The authors introduce LM-ProtoNet (FGF), which enhances the standard CNN-based ProtoNet through two primary upgrades:
2.1 Fine-grained Features (FGF)
Instead of encoding the entire sentence as a single block, the model segments the sentence into five distinct parts based on entity positions: the front mention, head entity, middle mention, tail entity, and back mention. Each segment is processed by a dedicated CNN, and the resulting embeddings are concatenated. This architecture forces the model to focus on the local context and the "bridge" between entities, capturing more nuanced relational information.
2.2 Large Margin Triplet Loss
Standard ProtoNets typically use softmax cross-entropy. The authors augment this with an auxiliary triplet loss during training. This loss explicitly pushes the "prototype" (the mean embedding of a class) closer to its members and further away from members of other classes by a defined margin ($\gamma$). This creates more distinct, isolated clusters in the vector space, facilitating more accurate classification of query instances.
3. Experimental Evaluation
The model was evaluated on FewRel, a large-scale supervised few-shot RC dataset containing 100 relations, each with 700 instances. The dataset is split into 64 relations for training, 16 for validation, and 20 for testing. Notably, the test relations are entirely unseen during training, requiring the model to demonstrate genuine generalization.
3.1 Key Results
LM-ProtoNet (FGF) outperformed all baselines, including Meta Network, GNN, and SNAIL. On average, the model achieved a 6.84% accuracy boost over standard few-shot baselines across various tasks:
- 5-way 1-shot: 76.60% accuracy (~7.4% improvement over standard ProtoNet).
- 5-way 5-shot: 89.31% accuracy.
- 10-way 1-shot: 65.31% accuracy (~8.9% improvement over standard ProtoNet).
3.2 Visualization of Embedding Space
Qualitative visualization using t-SNE confirms the effectiveness of the large-margin objective. As shown in Figure 2, LM-ProtoNet produces much tighter and more isolated clusters compared to the original ProtoNet, which exhibits significant overlap between different relations.
4. Conclusion
The proposed LM-ProtoNet (FGF) demonstrates that combining fine-grained structural features with a large-margin metric learning objective significantly improves performance on few-shot relation classification. While the current work utilizes CNN encoders, future research could explore Transformer-based backbones and more adaptive segmentation strategies for complex sentence structures.
Summary updated