Refining Sample Embeddings with Relation Prototypes to Enhance Continual Relation Extraction

Li Cui, Deqing Yang, Jiaxin Yu, Chengwei Hu, Jiayang Cheng, Jingjie Yi, Yanghua XiaoACL 2021

Abstract

Continual Relation Extraction (CRE) models face the challenge of catastrophic forgetting, where learning new relations degrades performance on previously acquired ones. This paper introduces RP-CRE, a framework that leverages relation prototypes—representative averages of relation embeddings—and an attention-based memory network to refine sample embeddings. By anchoring current embeddings to stable prototypes of past relations, RP-CRE maintains a consistent representation space, significantly outperforming existing state-of-the-art models on benchmark datasets.

Introduction

In real-world scenarios, information is dynamic, requiring machine learning models to learn new relations sequentially. In Continual Relation Extraction (CRE), a model encounters a stream of new tasks over time. The primary obstacle is catastrophic forgetting: as the model updates its weights for new data, the embedding space for old relations becomes disrupted. While "memory replay" (re-training on a subset of old samples) is a common mitigation strategy, it often lacks efficiency and depends heavily on memory buffer size. The authors of RP-CRE argue that simple replay is insufficient; models need an active mechanism to recalibrate their internal representations using the core essence of previously learned relations.

The RP-CRE Framework

The proposed RP-CRE (Relation Prototype - Continual Relation Extraction) pipeline consists of three main stages:

  1. Sample Selection & Prototype Generation: For each new relation, the model employs K-means clustering to select a diverse set of representative samples for storage. It then computes a Relation Prototype, defined as the average embedding of these samples, serving as a stable reference for the relation.
  2. Initial Training: Upon receiving a new task, the model—utilizing a BERT encoder—undergoes standard training to incorporate the new relational patterns.
  3. Prototypical Refining: To counter embedding drift, the model employs an attention-based memory network. This network compares current embeddings against stored prototypes and uses an attention mechanism to "pull" them back toward the stable prototypes of all seen relations.
The attention-based memory network used in RP-CRE for prototypical refining.

This refining process ensures that the model's understanding of the relational neighborhood remains stable even after weight updates.

Experimental Evaluation

The framework was evaluated on two major benchmarks:

  • FewRel: A version containing 80 relations.
  • TACRED: A large-scale dataset with 42 relations, modified to simulate class imbalance by removing the "no_relation" category and limiting sample counts.

To ensure a rigorous test, the researchers used a completely random sampling strategy for task order, avoiding the easier setup of grouping semantically similar relations together.

Results and Analysis

RP-CRE demonstrates superior performance and stability compared to state-of-the-art models like EMAR and CML.

Performance comparison of RP-CRE against baseline models on FewRel and TACRED benchmarks across 10 tasks.

Key findings include:

  • Superior Accuracy: On FewRel, RP-CRE achieved 81.5% accuracy after 10 tasks, significantly higher than EMAR+BERT (73.8%).
  • Long-term Stability: The model showed exceptional "backward transfer," retaining high accuracy on the first task even after completing the tenth.
  • Memory Efficiency: Unlike baseline models whose performance drops sharply with smaller memory buffers, RP-CRE remains stable, indicating a weaker dependence on the quantity of stored samples.

Visualization of the embedding space using t-SNE confirmed that RP-CRE prevents clusters from blurring together, effectively "restoring" distinct boundaries between relations.

Conclusion

RP-CRE introduces a powerful paradigm for continual learning by shifting the focus from simple memory replay to active embedding refinement. By using relation prototypes as anchors, the model maintains a stable and discriminative representation space. While the computational overhead of the multi-stage refining process is a consideration, the gains in accuracy and stability suggest that prototypical refining is a promising direction for broader continual learning applications in NLP.

Summary updated

BibTeX
@inproceedings{cui2021refining,
  author = {Li Cui and Deqing Yang and Jiaxin Yu and Chengwei Hu and Jiayang Cheng and Jingjie Yi and Yanghua Xiao},
  title = {{Refining Sample Embeddings with Relation Prototypes to Enhance Continual Relation Extraction}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.20},
}
Figure