Minimize Exposure Bias of S eq2 S eq Models in Joint Entity and Relation Extraction (2020)

Abstract: Joint entity and relation extraction aims to extract relation triplets from plain text directly. Prior work leverages Sequence-to-Sequence (Seq2Seq) models for triplet sequence generation. However, Seq2Seq enforces an unnecessary order on the unordered triplets and involves a large decoding length associated with error accumulation. These methods introduce exposure bias, which may cause the models overfit to the frequent label combination, thus limiting the generalization ability. We propose a novel Sequence-to-Unordered-Multi-Tree (Seq2UMTree) model to minimize the effects of exposure bias by limiting the decoding length to three within a triplet and removing the order among triplets. We evaluate our model on two datasets, DuIE and NYT, and systematically study how exposure bias alters the performance of Seq2Seq models. Experiments show that the state-of-the-art Seq2Seq model overfits to both datasets while Seq2UMTree shows significantly better generalization. Our code is available at https://github.com/WindChimeRan/OpenJERE .

## introduction relation extraction aims to extract entity-relation triplets (h, r, t) from plain text. for example, in the triplet (obama, graduate from, columbia university), obama and columbia university are the head and tail entities appearing in the text, and graduate from is the relation between these two entities. for supervised relation extraction, early studies focus on pipeline methods, which use an entity extractor to extract entities, and then classify the relations of entity pairs. these methods ignore the intrinsic interactions between these two subtasks and propagate classification errors through the tasks. jointly entity and relation extraction (jere) considers the subtask interaction @xcite @xcite @xcite @xcite @xcite @xcite @xcite @xcite , but they mainly exploit featurebased system or multi-task neural network, which can not capture inter-triplet dependency. noveltagging @xcite integrates these two subtasks into one sequence labeling process, which assigns a single entity-relation tag to each token; when a token belongs to multiple relations, the prediction results will be incomplete. instead of sequence labeling, sequence-to-sequence (seq2seq) models @xcite are able to extract an entity multiple times, thus multiple relations can be assigned to one entity, which solves the problem naturally @xcite @xcite . specifically, all existing seq2seq models pre-define a sequential order for the target triplets, e.g. triplet alphabetical order, and then decode the triplet sequence according to the order autoregressively, which means the current triplet prediction relies on the previous output. for exmaple, in figure 1 , the triplet list is flattened to [obama]-[graduate from]-[columbia university]-[obama]-[graduate from]-[harvard law school]... however, the autoregressive decoding of the seq2seq models introduces exposure bias problem which may severely reduce the performance. exposure bias refers to the discrepancy between training and testing phases of the decoding process @xcite . in the training phase, the current triplet prediction relies on the gold-standard labels of the previous triplets, while in the testing phase, the current triplet prediction relies on the model prediction of the previous triplets, which can be different from the gold-standard labels. as a result, in the test phase, a skewed prediction will further deviate the predictions of the follow-up triplets; if the decoding length is large, the discrepancy from the gold-standard labels would be further accumulated. such accumulated discrepancy may decrease the performance especially in predicting longer sequences, i.e., multi-triplet prediction. furthermore, because seq2seq model sequentially predicts the triplets, it enforces an unnecessary order on the unordered labels, while other triplet orders are also correct. thus, the assigned order makes the model prone to memorize and overfit to the frequent label combinations in the training set and poorly generalize to the unseen orders. the overfitting is also the side effect of exposure bias @xcite , which may result in missing triplets in seq2seq prediction. for example, in figure 1 , during the training phase, the seq2seq model learns triplet 1 -triplet 2 -triplet 3 in such an order while the order triplet 2 -triplet 1 -triplet 3 is also correct. in the testing phase, the seq2seq model predicts triplet 2 first based on the assigned order, but because triplet 2 -triplet 3 is a frequent order for the model, it ignores triplet 1 and ends with triplet 3 directly (i.e.,triplet 2 -triplet 3 ). when an order is enforced on the model, the model proceeds with more learning constrains. to mitigate the exposure bias problem while keeping the simplicity of seq2seq, we recast the one-dimension triplet sequence to two-dimension unordered-multi-tree (umtree) and propose a novel model seq2umtree. the seq2umtree model is based on an encoder-decoder framework, which is composed of a conventional encoder and a umtree decoder. the umtree decoder models entities and relations jointly and structurally, using a copy mechanism with unordered multi-label classification as the output layer. this multi-label classification model ensures the nodes in the same layer are unordered and discards the predefined triplet order so that the prediction deviation will not aggregate and affect other triplets. different from the standard seq2tree @xcite , the decoding length is limited to three (one triplet), which is the shortest feasible length for jere task. in this way, the exposure bias is minimized under the triplet-level f1 metrics. in conclusion, our contributions are listed as follows: ## methodology the seq2umtree model consists of a conventional seq2seq encoder and a umtree decoder. the umtree decoder is different from the standard decoder in a way that it generates unordered multilabel outputs and uses the umtree decoding strategy. the overview of the model is shown in figure 2. we illustrate the model details in the following subsections. ## related work previous work uses pipeline to extract triplets from text @xcite . they first recognize all entities in the input sentence then classify relations for each entity pair exhaustively. @xcite point out that the classification errors may propagate across subtasks. instead of treating these two subtasks separately, for joint entities and relations extraction (jere), table methods calculate the similarity score of all token pairs and relations by exhaustive enumeration and the extracted triplets are found by the position of the output in the table @xcite . however, as a triplet may contain entities with different lengths, the table methods either suffer from exponential computational burden @xcite or roll back to pipeline methods @xcite @xcite . furthermore, such table enumeration dilutes the positive labels quadratically, thus aggravating the classimbalanced problem. to model the task in a more concise way, @xcite propose a nov-eltagging scheme, which represents relation and entity in one tag, so that the joint extraction can be solved by the well-studied sequence labeling approach. however, this tagging scheme cannot assign multiple tags to one token thus fail on overlapping triplets. the follow-on methods revise the tagging scheme to enable multi-pass sequence labeling @xcite but they introduce a similar sparsity issue as does the table method. another promising method, seq2seq, is first proposed by @xcite . seq2seq does not only decode the triplet list straightforwardly but also circumvents the overlapping triplets problem. although this paper introduces a problem that multi-token entities cannot be predicted, this problem has been solved by multiple follow-up papers @xcite . however, there still remains a weakness in seq2seq models, i.e., the exposure bias, which has been overlooked. exposure bias originates from the discrepancy between training and testing: seq2seq models use data distribution for training and model distribution for testing @xcite . existing work mainly focuses on how to mitigate the informa-tion loss of arg max sampling @xcite @xcite . @xcite notice that different orders affect the performance of the seq2seq models in multi-class classification (mcc), and conduct thoroughly experiments on frequency order and topology order. in jere, @xcite study additional rule-based triplet prediction orders, including alphabetical, shuffle and fix-unsort, and then propose a reinforcement learning framework to generate triplets in adaptive orders dynamically. @xcite first point out the unnecessary order causes exposure bias altering the performance in mcc, and they find that seq2seq models are prone to overfit to the frequent label combination and show poor generalization on unseen target sequence. our method solves the exposure bias problem. as the exposure bias problem stems from the ordered left-to-right triplet decoding, we block the decoding of them from each other by removing the order of the triplet generation, thus the possible prediction error cannot propagate from triplet to triplet. furthermore, because each triplet is generated by an independent decoding process, the decoding length has been extremely shortened, thus minimizes the effects of exposure bias. our method differs from previous solution on exposure bias that we remove the order by structure decoding rather than random sampling @xcite . casrel @xcite ) is a recently proposed two-step tagging method, which first finds all the head entities in the sentence then labels a relation-tail table for each head entity, which can also be seen as a umtree decoder with a decoding length two. however, they overlook the data bias problem in nyt, which causing model unreliability and possible model bias. note that our task is different from oneie @xcite , which models event extraction, entity span detection, entity type recognition and relation extraction in a seq2graph way. in contrast to oneie, jere aims to extract only relation-entity triplets, which can be modeled by our umtree structure naturally. the simplicity of the tree enables the model to conduct global extraction. ## conclusions in this paper, we thoroughly analyze the effects of exposure bias of seq2seq models on joint entity and relation extraction. exposure bias causes overfitting that hurts the reliability of the perfor-mance scores. to solve the problem of exposure bias, we point out the order of the target triplets is redundant and formulate the target triplet sequence to unordered-multi-tree. the unordered-multi-tree structure minimizes the effect of exposure bias by limiting the decoding length to three within a triplet, and removing the order among triplets. we conduct in-depth experiments and reveal the relationship between exposure bias and data bias. the results show great generalization of our model.