Fine-grained Contrastive Learning for Relation Extraction (2022)

Abstract: Recent relation extraction (RE) works have shown encouraging improvements by conducting contrastive learning on silver labels generated by distant supervision before fine-tuning on gold labels. Existing methods typically assume all these silver labels are accurate and treat them equally; however, distant supervision is inevitably noisy–some silver labels are more reliable than others. In this paper, we propose fine-grained contrastive learning (FineCL) for RE, which leverages fine-grained information about which silver labels are and are not noisy to improve the quality of learned relationship representations for RE. We first assess the quality of silver labels via a simple and automatic approach we call “learning order denoising,” where we train a language model to learn these relations and record the order of learned training instances. We show that learning order largely corresponds to label accuracy–early-learned silver labels have, on average, more accurate labels than later-learned silver labels. Then, during pre-training, we increase the weights of accurate labels within a novel contrastive learning objective. Experiments on several RE benchmarks show that FineCL makes consistent and significant performance gains over state-of-the-art methods.

## introduction relation extraction (re), a subtask of information extraction, is a foundational task in natural language processing (nlp). the re task is to determine a linking relationship between two distinct entities from text, producing fact triples in the form @xcite . for example, reading the wikipedia page on noam chomsky, we learn that noam was "born to jewish immigrants in philadelphia," which corresponds to the fact triple @xcite . fact triples play a key role in downstream nlp tasks such as question-current state-of-the-art re models leverage a twophase training: a self-supervised pre-training followed by a supervised fine-tuning. popular pretrained language models (plm) such as bert @xcite and roberta @xcite feature a generic pre-training objective, namely masked language modeling (mlm), that allows them to generalize to various downstream tasks. however, recent re works have shown impressive performance gains by using a pre-training objective designed specifically for relation extraction @xcite @xcite . recently, @xcite and @xcite used a contrastive learning loss function to learn relationship representations during pre-training. however, re-specific pre-training requires large amounts of automatically labeled data obtained trough distant supervision for re @xcite which is inherently noisy-not all labels from distantly supervised data are correct. @xcite manually examined distantly supervised relation data and found that a significant ratio, 53%, of the assigned labels were incorrect. furthermore, distantly supervised labels can go beyond "correct" or "incorrect"-they can have multiple levels of correctness. consider the following sentences: pairing this text with the wikidata knowledge graph @xcite , distant supervision labels each sentence as a positive instance of @xcite ; however, only sentence (1) adequately expresses the relationship "born in." sentence (2) is incorrectly labeled, and sentence (3) is, arguably, semi-accurate since one may infer that someone was born in the same place they were raised. conventional contrastive learning for re does not account for differences in label accuracy-it treats all instances equally. this can be problematic when learning robust and high-quality relationship representations. this paper proposes a noise-aware contrastive pre-training, fine-grained contrastive learning (finecl) for re, that leverages additional finegrained information about which instances are and are not noisy to produce high-quality relationship representations. figure 1 illustrates the end-to-end data flow for the proposed finecl method. we first assess the noise level of all distantly supervised training instances and then incorporate such fine-grained information into the contrastive pretraining. less noisy, or clean, training instances are weighted more relative to noisy training instances. we then fine-tune the model on gold-labeled data. as we demonstrate in this work, this approach produces high-quality relationship representations from noisy data and then optimizes performance using limited amounts of human-annotated data. there are several choices of methods to assess noise levels. we select a simple yet effective method we call "learning order denoising" that does not require access to human annotated labels. we train an off-the-shelf language model to predict relationships from distantly supervised data and we record the order of relation instances learned during training. we show that the order in which instances are learned corresponds to the label accuracy of an instance: accurately labeled relation instances are learned first, followed by noisy, inaccurately labeled relation instances. we leverage learning-order denoising to improve the relationship representations learned during pretraining by linearly projecting the weights of each relation instance corresponding to the order in which the instance was learned. we apply higher weights to relation instances learned earlier in training relative to those learned later in training. we use these weights to inform a contrastive learning loss function that learns to group instances of similar relationships. we compare our method to leading re pre-training methods and observe an increase in performance on various downstream re tasks, illustrating that finecl produces more informative relationship representations. the contributions of this work are the following: ## related work early re methods featured pattern-based algorithms (califf and mooney, 1997) followed by advanced statistical-based re methods @xcite @xcite . advances in deep learning led to neuralbased re methods @xcite ; peng base lang. model pre-train objective r d e d bert bert mlm × × roberta roberta mlm × × mtb bert dps ✓ × cp bert cl + mlm ✓ × erica bert bert cl + mlm ✓ ✓ erica roberta roberta cl + mlm ✓ ✓ wcl bert wcl + mlm ✓ × finecl roberta finecl + mlm ✓ ✓ building on bert @xcite , @xcite proposed mtb, a model featuring a pre-training objective explicitly designed for the task of relation extraction. mtb uses dot product similarly to align pairs of randomly masked entities during pre-training. its success inspired the development of subsequent re-specific pre-training methods @xcite . @xcite demonstrated the effectiveness of contrastive learning used to develop relationship representations during pre-training. their model, named "cp," featured a pre-training objective that combined a relation discrimination task with bert's masked language modeling (mlm) task. their work inspired erica @xcite , which expanded the contrastive learning pre-training objective to include entity and relation discrimination, as well as mlm. @xcite is a recent extension of @xcite that proposes a weighted contrastive learning (wcl) method for re. the authors first fine-tune bert to predict relationships using gold training data and then use the fine-tuned model to predict relationships from distantly labeled data. next, they use the softmax probability of each prediction as a confidence value which they then apply to a weighted contrastive learning function used for pre-training. lastly, they fine-tune the wcl model on gold training data. our work is an extension of erica. we introduce a more nuanced re contrastive learning objective that leverages additional, fine-grained data about which instances are high-quality training signals. ## methods finecl for re consists of three discrete stages: learning order denoising, contrastive pre-training, and supervised adaptation. ## ablation studies we conduct a suite of ablation experiments to understand how learning order denoising affects the quality of relationship representations learned during pre-training. we note that the finecl method is identical to erica when we remove fine-grained data and treat all instances equally. as such, er-ica can be considered an ablation experiment of finecl without fine-grained data. ## conclusion in this work, we expand on contrastive learning for relation extraction by introducing fine-grained contrastive learning for re-a method that uses additional, fine-grained information about distantly supervised training data to improve relationship representations learned during pre-training. these improved representations lead to increases in performance across a variety of downstream re tasks. this report shows that learning order denoising effectively and automatically orders distantly supervised training data from clean to noisy instances. in future work, we hope to explore the usefulness of this method when applied to manually annotated data where learning order may instead reflect the level of difficulty of training instances. this could be an easy and automatic way to introduce curricula learning within the fine-tuning training phase. we also intend to explore the pairing of other denoising methods with finecl. figure 4 : ratios of instances of learned classes per epoch when recording learning order from distantly supervised docred training data. note, this is before randomized upsampling of underrepresented classes (e.g. lyrics by and producer).