Towards Better Document-level Relation Extraction via Iterative Inference (2022)

Abstract: Document-level relation extraction (RE) aims to extract the relations between entities from the input document that usually containing many difficultly-predicted entity pairs whose relations can only be predicted through relational inference. Existing methods usually directly predict the relations of all entity pairs of input document in a one-pass manner, ignoring the fact that predictions of some entity pairs heavily depend on the predicted results of other pairs. To deal with this issue, in this paper, we propose a novel document-level RE model with iterative inference. Our model is mainly composed of two modules: 1) a base module expected to provide preliminary relation predictions on entity pairs; 2) an inference module introduced to refine these preliminary predictions by iteratively dealing with difficultly-predicted entity pairs depending on other pairs in an easy-to-hard manner. Unlike previous methods which only consider feature information of entity pairs, our inference module is equipped with two Extended Cross Attention units, allowing it to exploit both feature information and previous predictions of entity pairs during relational inference. Furthermore, we adopt a two-stage strategy to train our model. At the first stage, we only train our base module. During the second stage, we train the whole model, where contrastive learning is introduced to enhance the training of inference module. Experimental results on three commonly-used datasets show that our model consistently outperforms other competitive baselines.

## introduction relation extraction (re) aims to identify the relation between two entities from raw texts. due to its wide applications in many subsequent natural language processing (nlp) tasks, such as largescale knowledge graph construction @xcite and question answering @xcite , re has attracted increasing attention and become a fundamental nlp task. most of the existing works focus on sentence-level re, where both considered entities come from a single sentence @xcite . however, large amounts of relations, such as relational facts from wikipedia articles, are expressed by multiple sentences in real-world applications @xcite . as calculated by @xcite , in the commonly-used docred dataset, the identifications of more than 40.7% relational facts involve multiple sentences. therefore, a natural extension is document-level re, which is required to exploit the input document to infer all relations between entities. however, compared with sentence-level re, document-level re is a more challenging task. this is because each document often contains a large number of entity pairs whose relations need to be predicted. more importantly, the relation prediction difficulties of these pairs are usually significantly different. the relations of some entity pairs can be directly predicted while there also exist many entity pairs whose relations can only be inferred by referring to other pairs. as calculated by @xcite , about 61.6% entity pairs fall into the latter category in the docred dataset. figure 1 shows an example from the docred dataset, which contains totally five entity pairs with relations. among these entity pairs, the relations of some pairs can be easily identified even without knowing relations of other pairs, such as (altomonte, martino altomonte) and (altomonte, austrian) (see figure 1b ). by contrast, it is difficult to correctly identify the relation of (martino altomonte, austrian) because the document does not contain sufficient evidence information for it. furthermore, if the relations of (altomonte, martino altomonte) and (altomonte, austrian) are predicted first, it will become easier to predict the relations of (martino altomonte, austrian) with the help of these previously-predicted results (see figure 1c ). to deal with the above issues, many researchers introduce graph neural networks (gnns) @xcite to exploit the dependencies among entities or mentions for document-level re @xcite @xcite . however, these methods only focus on the dependencies at the entity-or mention-level while neglecting the dependencies among entity pairs, which has an important impact on the relation identification of difficultly-predicted entity pairs depending on other pairs. further, @xcite model document-slevel re as a semantic segmentation problem. in this way, the dependencies among entity pairs can be captured via cnn, which, however, ignores the fact that relation prediction difficulties of entity pairs are different. instead, @xcite treat intraand inter-sentence entity pairs as easily-predicted and difficultly-predicted ones, and use different encoders to learn their representations, respectively. although this method is simple, it cannot accurately distinguish prediction difficulties of entity pairs. in this paper, we propose a document-level re model with iterative inference. overall, as shown in figure 2 , our model mainly consists of two modules: 1) an base module used to firstly predict the relations of entity pairs roughly; 2) a inference mod-ule exploiting the prediction results of the previous iteration to refine the predictions in an iterative manner. particularly, we equip the inference module with an attention mechanism, which enables the module to accurately exploit the dependencies among overlapping entity pairs. by doing so, we expect that based on the prediction results of the previous iteration, inference module can deal with difficultly-predicted entity pairs depending on other pairs in an easy-to-hard manner. furthermore, we adopt a two-stage strategy to train our model. first, we only train our base module. second, we train the entire model, where the base module is set with a relatively small learning rate to keep its parameters and performance stable. particularly, at the second stage, we introduce contrastive learning to encourage inference module to exploit the previously-predicted results better. to investigate the effectiveness of our model, we conduct several groups of experiments on commonly-used datasets. experimental results and in-depth analyses strongly demonstrate the superiority of our model. ## our proposed model in this section, we elaborate on our model. as shown in figure 2 , our model is composed of two modules: base module (section 2.1) and inference module (section 2.2). finally, we give a detailed description of the model training (section 2.3). ## related work early studies on re mainly focus on sentence-level re, which predicts the relation between two entities within a single sentence. in this aspect, many approaches @xcite @xcite @xcite @xcite have been proven to be effective in this task. however, because many relational facts in real applications are expressed by multiple sentences @xcite , researchers gradually shift their attention to document-level re. to this end, researchers have proposed two kinds of methods: transformer-based and gnnbased methods. due to the fact that gnns can model the dependencies among entities or mentions and have strong inference ability, many researchers explore gnns for better document-level re @xcite @xcite @xcite @xcite . usually, they first construct a document graph, which uses mentions or entities as nodes and leverages heuristic rules and semantic dependencies to build edges. then, they perform inference with gnns on the graph. for example, @xcite treat the document graph as a latent variable which can be dynamically induced via structure attention. during this process, the induced graph structure can be exploited for better inference in document-level re. @xcite propose a graph aggregation-and-inference network involving a heterogeneous mention-level graph and an entity-level graph. these two graphs are utilized to model dependencies among mentions and entities, respectively. meanwhile, due to the advantage of transformer @xcite on implicitly modeling long-distance dependencies, some studies @xcite @xcite directly apply pre-trained language models to document-level re. @xcite propose the atlop model that features two techniques: adaptive thresholding @xcite and localized context pooling. however, these two types of methods mainly focus on mention-and entity-level information, ignoring the dependencies among entity pairs in same context, which have an important impact on document-level re. in contrast, @xcite and @xcite exploit the dependencies among entity pairs to facilitate document-level re, however, ignore the fact that relation prediction difficulties of entity pairs are different. furthermore, @xcite divide entity pairs into intra-and intersentence ones, which are considered to have different prediction difficulties. however, such a division is too simple to accurately distinguish easily-and difficultly-predicted entity pairs. unlike these methods only utilizing feature-level information of entity pairs in one pass, we leverage both feature-and relation-level information of entity pairs through iterative inference, allowing our model to capture the dependencies among entity pairs more comprehensively. besides, our work is inspired by the maskpredict decoding strategy for non-autoregressive nmt @xcite . in this work, we adapt this strategy into document-level re. to the best of our knowledge, our work is the first attempt to exploit iterative decoding for this task. finally, our work is also related to the studies on gnn-based iterative encoding @xcite @xcite . unlike these studies, we train inference module to directly correct the noisy predictions of base module in a one-pass manner rather than iterative manner, while iterative inference is used only during testing. ## conclusion and future work in this work, we have proposed a novel documentlevel re model with iterative inference, which mainly contains two modules: base module and inference module. we first use base module to make preliminary predictions on the relations of entity pairs. then, via iterative inference, inference module gradually refines the predictions of base module, which is expected to effectively deal with difficultly-predicted entity pairs depending on other pairs. experiments on three public documentlevel re datasets show that our model significantly outperforms existing competitive baselines. in future, we attempt to apply our model to other intersentence or document-level nlp tasks, such as cross-sentence collective event detection.