Learning Robust Representations for Continual Relation Extraction via Adversarial Class Augmentation (2022)

Abstract: Continual relation extraction (CRE) aims to continually learn new relations from a class-incremental data stream. CRE model usually suffers from catastrophic forgetting problem, i.e., the performance of old relations seriously degrades when the model learns new relations. Most previous work attributes catastrophic forgetting to the corruption of the learned representations as new relations come, with an implicit assumption that the CRE models have adequately learned the old relations. In this paper, through empirical studies we argue that this assumption may not hold, and an important reason for catastrophic forgetting is that the learned representations do not have good robustness against the appearance of analogous relations in the subsequent learning process. To address this issue, we encourage the model to learn more precise and robust representations through a simple yet effective adversarial class augmentation mechanism (ACA), which is easy to implement and model-agnostic.Experimental results show that ACA can consistently improve the performance of state-of-the-art CRE models on two popular benchmarks.

## introduction relation extraction (re) aims to detect the relation of two given entities in a sentence. traditional re models are trained on a fixed dataset with a predefined relation set, which cannot handle the reallife situation where new relations are constantly emerging. to this end, continual relation extraction (cre) @xcite @xcite @xcite is introduced. as shown in figure 1 , cre is formulated as a class-incremental problem, which trains the model on a sequence of tasks. in each task, figure 1 : a demonstration for continual relation extraction with three tasks where each task involves two new relations. the learned representations from the easy training task can not handle the hard testing data, which contains analogous relations inherently hard to distinguish, e.g., "child" and "father". the model needs to learn some new relations and is evaluated on all seen relations. like other continual learning systems, cre models also suffer from catastrophic forgetting, i.e., the performance of previously learned relations seriously degrades when learning new relations. the mainstream research in cre @xcite @xcite mainly attributes catastrophic forgetting to the corruption of the learned knowledge as new tasks come. to this end, a variety of sophisticated rehearsal-based mechanisms are introduced to better retain or recover the knowledge, such as relation prototypes @xcite , curriculum-meta learning @xcite , contrastive replay and knowledge distillation @xcite . all these methods implicitly assume that the model has adequately learned old relations. however, in this paper, we find that this assumption may not hold. with a series of empirical studies, we observe that catastrophic forgetting mostly happens on some specific relations, and significant performance degradation tends to occur when their analogous relations appear. based on our observations, we find another reason for catastrophic forgetting, i.e., cre models do not learn sufficiently robust representations of relations in the first place due to the relatively easy training task. taking "child" in figure 1 as an example, because of the absence of hard negative classes in task 1, the cre model tends to rely on shortcuts, such as entity types, to identify "child". although the learned imprecise representations can handle the testing set of task 1 and task 2, they are not robust enough to distinguish "child" from its analogous relation ("father") in task 3. therefore, the performance of "child" will decrease significantly when "father" appears. in contrast, relations such as "architecture" still perform well in task 3 because their analogous relations have not yet appeared. recently, adversarial data augmentation emerges as a strong baseline to prevent models from learning shortcuts from the easy dataset @xcite @xcite . inspired by these work, we introduce a simple yet effective adversarial class augmentation (aca) mechanism to improve the robustness of the cre model. concretely, aca utilizes two class augmentation methods, namely hybrid-class augmentation and reversed-class augmentation, to build hard negative classes for new tasks. when a task arrives, aca jointly trains new relations with adversarial augmented classes to learn robust representations. note that our method is orthogonal to all previous work: aca focuses on learning knowledge of newly emerging relations better, while previous methods are proposed to retain or recover learned knowledge of old relations foot_0 . therefore, incorporating aca into previous cre models can further improve their performance. we summarize our contributions as: 1) we conduct a series of empirical studies on two strong cre methods and observe that catastrophic forgetting is strongly related with the existence of analogous relations. 2) we find an important reason for catastrophic forgetting in cre which is overlooked in all previous work: the cre models suffer from learning shortcuts to identify new relations, which are not robust enough against the appearance of their analogous relations. 3) we propose an adversarial class augmentation mechanism to help cre models learn more robust representations. exper-imental results on two benchmarks show that our method can consistently improve the performance of two state-of-the-art methods. continual learning continual learning (cl) aims to continually accumulate knowledge from a sequence of tasks @xcite . a major challenge of cl is catastrophic forgetting, i.e., the performance of previously learned tasks seriously drops when learning new tasks. to this end, prior cl methods can be roughly divided into three groups: 1) rehearsal-based methods @xcite maintain a memory to save instances of previous tasks and replay them during training of new tasks. 2) regularization-based methods @xcite add constraints on the weights important to old tasks. 3) architecture-based methods @xcite dynamically change model architectures to learn new tasks and prevent forgetting old tasks. recently, rehearsalbased methods have been proven to be the most effective for nlp tasks, including relation extraction. we focus on the rehearsal-based methods for cre in this paper. shortcuts learning phenomenon shortcuts learning phenomenon denotes that dnn models tend to learn unreliable shortcuts in datasets, leading to poor generalization ability in real-world applications @xcite . recently, researchers have revealed the shortcut learning phenomenon for different kinds of language tasks, such as natural language inference @xcite , information extraction @xcite , reading comprehension @xcite and question answering @xcite . @xcite points out that shortcuts learning phenomenon happens because the "principle of least effort" (kingsley, 1972), i.e., people (also animal and machine) will naturally minimize the amount of effort to solve tasks. recently, data augmentation @xcite and adversarial training @xcite are used to alleviate shortcuts learning phenomenon with synthesized data. to the best of our knowledge, we are the first work to analyze the catastrophic forgetting in cre from the perspective of shortcuts learning, and propose an adversarial data augmentation method to alleviate it. ## task formulation in cre, the model is trained on a sequence of tasks (t 1 , t 2 , ..., t k ). each task t i can be represented as a triplet (r i , d i , q i ), where r i is the set of new relations, d i and q i are the training and testing set, respectively. every instance (x j , y j ) ∈ d i ∪ q i belongs to a specific relation y @xmath0. the goal of cre is to continually train the model on new tasks to learn new relations, while avoiding forgetting of previously learned ones. more formally, in the i-th task, the model learns new relations r i from d i , and should be able to identify all seen relations, i.e., the model will be evaluated on the all seen testing sets i @xmath1. to alleviate catastrophic forgetting in cre, previous work @xcite @xcite adopts a memory to store a few typical instances (e.g., 10) for each old relation. in the subsequent training process, instances in the memory will be replayed to alleviate the catastrophic forgetting. ## catastrophic forgetting in cre: in this section, we conduct a series of empirical studies on two state-of-the-art cre models, namely emar @xcite and rp-cre @xcite , and two benchmarks, namely fewrel and tacred, to analyze catastrophic forgetting in cre. please refer to section 6.1 for details of these two benchmarks and two cre models. ## methodology recently, adversarial data augmentation has shown promise for avoiding models from learning shortcuts in the easy dataset @xcite @xcite 2021 ). therefore, in this section, we propose a simple yet effective adversarial class augmentation mechanism (aca) containing two kinds of class augmentation to help the cre model learn more robust representations. ## experiments 6.1 experimental setups datasets following previous works @xcite @xcite , our experiments are conducted upon two widely used datasets, fewrel @xcite and tacred @xcite . please refer to appendix d for details of these two datasets. we construct 5 different task sequences for both fewrel and tacred. for each task sequence, we simulate 10 tasks by randomly dividing all relations of the dataset into 10 sets. for a fair comparison, our 5 task sequences are exactly the same as that of @xcite and @xcite . evaluation metrics following @xcite and @xcite , we use average accuracy on all seen tasks as our evaluation metric. for a stronger method, the average accuracy of each task should be consistently higher than that of baselines. baselines we consider the following baselines: ea-emr @xcite , which maintains a memory replay and embedding alignment mechanism to alleviate catastrophic forgetting; cml @xcite , which introduces curriculum learning and meta-learn to alleviate catastrophic forgetting in cre; emar @xcite , which proposes a memory activation and reconsolidation mechanism to retain the learned knowledge. note that the original emar was based on a bi-lstm encoder, and we re-implement emar with bert; rp-cre @xcite , which proposes a memory network to retain the learned representations with relation prototypes; crl @xcite , which adopts contrastive learning replay and knowledge ## analysis 7.1 ablation study to further explore the effectiveness of our proposed two class augmentation methods, we conduct an ablation study. ## conclusion in this paper, we conduct a series of empirical study to analyze catastrophic forgetting in cre, and observe that catastrophic forgetting mostly happens on some specific relations, and significant performance degradation tends to occur when their analogous relations appear in subsequent tasks. based on our observations, we find an important reason for catastrophic forgetting in cre that all previous works overlooked, i.e., the cre models suffer from learning shortcuts to identify new relations, which are not robust enough against the appearance of their analogous relations. to this end, we propose a simple yet effective adversarial class augmentation mechanism to help cre models learn more robust representations. extensive experiments on two benchmarks show that our method can further improve the performance of two state-of-the-art cre models.