Introduction
Relation Extraction (RE) is a fundamental task in natural language processing, focused on identifying semantic connections between entities in text (e.g., "born in" or "works for"). In real-world applications, information is rarely static; models must learn new relations from a continuous stream of data. However, standard neural networks suffer from catastrophic forgetting, where the acquisition of new knowledge (Task B) overwrites the weights necessary to perform previous tasks (Task A).
The authors of this paper identify a specific cause for this failure in Continual Relation Extraction (CRE): indistinguishability. As a model learns sequentially, the mathematical representations (embeddings) of different relations begin to overlap in the feature space. Without a mechanism to keep these distributions separate, the model loses the ability to distinguish between old and new relation types. To solve this, the authors propose CRECL (Continual Relation Extraction with Contrastive Learning).
Methodology
CRECL is a framework designed to ensure that relation types remain distinct in the model's memory by leveraging a "twin-tower" architecture and prototypical anchors. The framework consists of three main pillars:
- Shared Encoding Layer: A BERT-based encoder provides a foundational representation for both classification and contrastive tasks.
- Memory Module & Prototypes: Rather than storing all raw data, the model uses K-means clustering to select "typical instances" for every relation encountered. It then calculates a prototype—a mathematical average of these instances—to serve as a stable anchor for that relation in the embedding space.
- Prototypical Contrastive Network: This is the core innovation of the paper. The network compares current instances against the prototypes of all candidate relations stored in memory.
Training and Loss Functions
The model employs a two-stage training process. First, it learns to distinguish current task instances from all known prototypes. Second, it re-examines stored typical instances to ensure their representations haven't "drifted" toward new relations. This is guided by a Hybrid Loss function:
- InfoNCE Loss: Pulls similar instances together and pushes different ones apart.
- Contrastive Margin Loss: A custom loss that specifically penalizes the model if the gap between the correct relation and the "closest wrong" relation is too small.
Experimental Results
The model was evaluated on two major benchmarks: FewRel (80 relations) and TACRED (41 relations). TACRED is particularly challenging due to its high imbalance and semantic noise.
CRECL established a new state-of-the-art (SOTA) for continual relation extraction:
- Superior Accuracy on Complex Data: On the final task of the TACRED dataset, CRECL achieved 78.5% accuracy, a significant 8.43% improvement over the previous best model (RP-CRE).
- Long-term Stability: While all models experience some decline as tasks are added, CRECL’s performance drop was notably shallow. On FewRel, it maintained 82.7% accuracy after 10 tasks, outperforming the baseline by 1.47%.
- Ablation Studies: Removing the contrastive network (CRECL-CL) led to a massive spike in forgetting, proving that the contrastive objective is the primary driver of the model's long-term memory.
Key Insights and Discussion
The success of CRECL suggests several important takeaways for the field of continual learning:
- Prototypes as Anchors: Contrasting instances against stable prototypes, rather than random instances, creates a much more reliable "map" of the relation space, preventing embedding drift.
- The Power of Negatives: While many CRE models focus on remembering what a relation is, CRECL succeeds by explicitly teaching the model what a relation is not. This focus on negative information is crucial for maintaining clear boundaries between tasks.
- Effectiveness in Noise: The significant performance gap on TACRED suggests that contrastive learning is particularly effective when relations are semantically similar or the data is messy.
Limitations and Future Work
Despite its success, the authors noted that some overlap still exists between certain relations in t-SNE visualizations, likely due to "insufficient sampling" during the contrastive phase. Additionally, while CRECL is more robust than its predecessors, its performance still dips when the memory module is restricted to very few instances (e.g., 5 per relation). Future research may focus on refining how typical instances are selected or incorporating more sophisticated attention mechanisms into the contrastive tower.
Summary updated