Continual Few-shot Relation Learning via Embedding Space Regularization and Data Augmentation (2022)

Abstract: Existing continual relation learning (CRL) methods rely on plenty of labeled training data for learning a new task, which can be hard to acquire in real scenario as getting large and representative labeled data is often expensive and time-consuming. It is therefore necessary for the model to learn novel relational patterns with very few labeled data while avoiding catastrophic forgetting of previous task knowledge. In this paper, we formulate this challenging yet practical problem as continual few-shot relation learning (CFRL). Based on the finding that learning for new emerging few-shot tasks often results in feature distributions that are incompatible with previous tasks’ learned distributions, we propose a novel method based on embedding space regularization and data augmentation. Our method generalizes to new few-shot tasks and avoids catastrophic forgetting of previous tasks by enforcing extra constraints on the relational embeddings and by adding extra relevant data in a self-supervised manner. With extensive experiments we demonstrate that our method can significantly outperform previous state-of-the-art methods in CFRL task settings.

## introduction relation extraction (re) aims to detect the relationship between two entities in a sentence, for example, predicting the relation birthdate in the sentence "kamala harris was born in oakland, california, on october 20, 1964." for the two entities kamala harris and october 20, 1964. it serves as a fundamental step for downstream tasks such as search and question answering @xcite . traditionally, re methods were built by considering a fixed static set of relations @xcite . however, similar to entity recognition, re is also an open-vocabulary problem @xcite ), 1 code and models are available at https://github.com/qcwthu/continual_fewshot_relation_learning where the relation set keeps growing as new relation types emerge with new data. a potential solution is to formalize re as continual relation learning or crl @xcite . in crl, the model learns relational knowledge through a sequence of tasks, where the relation set changes dynamically from the current task to the next. the model is expected to perform well on both the novel and previous tasks, which is challenging due to the existence of catastrophic forgetting phenomenon @xcite in continual learning. in this phenomenon, the model forgets previous relational knowledge after learning new relational patterns. existing methods to address catastrophic forgetting in crl can be divided into three categories: (i) regularization-based methods, (ii) architecturebased methods, and (iii) memory-based methods. recent work shows that memory-based methods which save several key examples from previous tasks to a memory and reuse them when learning new tasks are more effective in nlp @xcite . successful memory-based crl methods include eaemr @xcite , mllre @xcite , emar @xcite , and cml @xcite . despite their effectiveness, one major limitation of these methods is that they all assume plenty of training data for learning new relations (tasks), which is hard to satisfy in real scenario where continual learning is desirable, as acquiring large labeled datasets for every new relation is expensive and sometimes impractical for quick deployment (e.g., re from news articles during the onset of an emerging event like covid-19). in fact, one of the main objectives of continual learning is to quickly adapt to new environments or tasks by exploiting previously acquired knowledge, a hallmark of human intelligence @xcite . if the new tasks are few-shot, the existing methods suffer from over-fitting as shown later in our experiments ( §4). considering that humans can acquire new knowledge from a handful of examples, it is expected for the models to generalize well on the new tasks with few data. we regard this problem as continual few-shot relation learning or cfrl (fig. 1 ). indeed, in relation to cfrl, @xcite , @xcite and @xcite recently introduce methods for incremental few-shot learning in computer vision. based on the observation that the learning of emerging few-shot tasks may result in distorted feature distributions of new data which are incompatible with previous embedding space @xcite , this work introduces a novel model based on embedding space regularization and data augmentation (erda) for cfrl. in particular, we propose a multi-margin loss and a pairwise margin loss in addition to the cross-entropy loss to impose further relational constraints in the embedding space. we also introduce a novel contrastive loss to learn more effectively from the memory data. our proposed data augmentation method selects relevant samples from unlabeled text to provide more relational knowledge for the few-shot tasks. the empirical results show that our method can significantly outperform previous state-of-the-art methods. in summary, our main contributions are: ## related work conventional re methods include supervised @xcite @xcite , semi-supervised @xcite @xcite and distantly supervised methods @xcite @xcite . these methods rely on a predefined relation set and have limitations in real scenario where novel relations are emerging. there have been some efforts which focus on relation learning without predefined types, including open re @xcite @xcite and continual relation learning @xcite @xcite . continual learning (cl) aims to learn knowledge from a sequence of tasks. the main problem cl attempts to address is catastrophic forgetting @xcite , i.e., the model forgets previous knowledge after learning new tasks. prior methods to alleviate this problem can be mainly divided into three categories. first, regularizationbased methods impose constraints on the update of neural weights important to previous tasks to alleviate catastrophic forgetting @xcite @xcite . second, architecture-based methods dynamically change model architectures to acquire new information while remembering previous knowledge @xcite @xcite . finally, memory-based methods maintain a memory to save key samples of previous tasks to prevent forgetting @xcite @xcite . these methods mainly focus on learning a single type of tasks. more recently, researchers have considered lifelong language learning @xcite , where the model is expected to continually learn from different types of tasks. few-shot learning (fsl) aims to solve tasks containing only a few labeled samples, which faces the issue of over-fitting. to address this, existing methods have explored three different directions: (i) data-based methods use prior knowledge to augment data to the few-shot set @xcite @xcite ; ## methodology in this section, we first formally define the cfrl problem. then, we present our method for cfrl. ## experiment we define the benchmark and evaluation metric for cfrl before presenting our experimental results. ## conclusion we have introduced continual few-shot relation learning (cfrl), a challenging yet practical problem where the model needs to learn new relational knowledge with very few labeled data continually. the variance over 6 runs is reported in we show the analysis of 'w.o. m' in appendix a.4.