Improving Few-Shot Relation Classification by Prototypical Representation Learning with Definition Text

Zhenzhen Li, Yuyang Zhang, Jian-Yun Nie, Dongsheng Li

Introduction

Relation Classification (RC) is a fundamental task in Information Extraction, aimed at identifying the semantic relationship between two entities within a given sentence. While deep learning models have achieved remarkable success in supervised RC, they typically require vast amounts of labeled data. In contrast, few-shot RC presents a significant challenge: models must generalize from only a handful of examples.

A core issue in few-shot learning is that limited samples may be "atypical," capturing specific contexts that do not represent the broader relation. This paper proposes that models should "read the manual" by leveraging relation definitions. Just as humans use high-level semantic descriptions to categorize new information, this framework incorporates textual definitions as a semantic prior to guide the classification process.

Proposed Framework

The authors introduce a dual-encoder architecture designed to bridge the gap between dictionary-style definitions and real-world sentence instances.

The proposed framework featuring dual encoders and joint training with Multi-Instance Learning (MIL).

1. Dual Encoders

  • Instance Encoder: A BERT-based model that processes input sentences to extract entity-aware representations.
  • Prototype Encoder: A more efficient TinyBERT model that encodes the relation's name and textual description into a "prototype" vector.

2. Joint Pre-training with MIL

To ensure both encoders operate in the same semantic space, the system undergoes joint pre-training using Multi-Instance Learning (MIL) on the massive T-REx dataset (~8 million instances). During this phase, the relation definition acts as a query, helping the model attend to the most relevant sentences in a noisy data bag to refine the prototype representation.

3. Bayesian Meta-Learning

For few-shot tasks, the model employs a Bayesian approach. The definition-based prototype serves as a "prior" distribution. When presented with new labeled instances, the model updates this prior to a "posterior" distribution, effectively blending the abstract semantic knowledge of the definition with the specific patterns found in the new data.

Experimental Evaluation

The model, dubbed Rel+Proto, was evaluated across several challenging benchmarks:

  • FewRel 1.0 (General Domain): Achieved a state-of-the-art (SOTA) accuracy of 96.69% on the 5-way 1-shot task, outperforming previous methods like CP (95.10%).
  • FewRel 2.0 (Domain Adaptation): When moving from Wikipedia to biomedical data, the model showed superior robustness, reaching 83.11% accuracy (5-way 1-shot) compared to the previous best of 79.70%.
  • Zero-Shot Learning: On the NYT-25 dataset, the model maintained 34.72% accuracy on entirely unseen relations, significantly outperforming ZS-BERT baselines which struggled to exceed random performance levels.

Key Insights

t-SNE visualization showing the alignment of relation prototypes (derived from definitions) with instance clusters.
  • Definitions as Semantic Anchors: Relation names and descriptions capture intrinsic semantics more reliably than noisy, sparse examples. As shown in the t-SNE visualization, the prototypes derived from definitions (indicated by red arrows) align closely with the centers of their respective instance clusters.
  • The Necessity of Joint Training: The authors found that simply using a pre-trained BERT to encode definitions (without joint training) performs poorly. The model must be explicitly trained to map the language of definitions into the same vector space as sentence instances.
  • Efficiency of TinyBERT: Interestingly, using the smaller TinyBERT for the prototype encoder was not only more computationally efficient but also led to better convergence and lower loss compared to a full-sized BERT-base model.

Conclusion

By integrating textual definitions into prototypical representation learning, this research demonstrates a powerful method for improving few-shot and zero-shot relation classification. The approach effectively uses semantic priors to overcome the limitations of sparse data, setting new benchmarks for domain adaptation and generalization to unseen relations. Future work may extend this "definition-to-prototype" mapping to other NLP tasks such as intent detection or entity typing.

Summary updated

BibTeX
@inproceedings{li2022improving,
  author = {Zhenzhen Li and Yuyang Zhang and Jian-Yun Nie and Dongsheng Li},
  title = {{Improving Few-Shot Relation Classification by Prototypical Representation Learning with Definition Text}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-naacl.34},
}
Figure