Improving Relation Extraction through Syntax-induced Pre-training with Dependency Masking

Yuanhe Tian, Yan Song, Fei XiaACL 2022

Abstract

Relation Extraction (RE) is a critical task in natural language processing that involves identifying semantic relationships between entities in text. While syntactic information is known to be beneficial for RE, existing methods often rely on external dependency parsers during inference, which introduces computational overhead and error propagation. This paper proposes Dependency Masking (DM), a novel pre-training task that allows language models to internalize syntactic structures. By training an encoder to predict masked syntactic connections and relationship types across multiple dependency orders, the model learns to capture structural context without requiring a parser at test time. Our approach achieves state-of-the-art performance on the ACE2005 and SemEval 2010 Task 8 benchmarks.

Introduction

Identifying relationships like "born in" or "employed by" requires a deep understanding of a sentence's structural context. Standard Transformer-based models, such as BERT, treat text as a linear sequence, which can limit their ability to model long-distance dependencies that are readily apparent in a syntax tree. Previous attempts to integrate syntax into RE models typically involve feeding dependency trees as extra features or using Graph Convolutional Networks (GCNs). However, these methods necessitate running a dependency parser during inference, making them computationally expensive and susceptible to parsing errors.

To address these challenges, we introduce a syntax-induced pre-training framework. The core idea is to "bake" syntactic knowledge into the model's parameters during an unsupervised pre-training phase, enabling the model to leverage structural patterns implicitly during downstream tasks.

Methodology

The proposed framework utilizes a "syntax-induced" encoder trained through Masked Dependency Prediction (MDP). The process consists of three main stages: dependency extraction, multi-order masking, and pre-training.

Dependency Extraction and Multi-Order Masking

We first process a large-scale raw corpus (English Wikipedia) using an off-the-shelf dependency parser. From the resulting trees, we extract not only direct parent-child relationships (1st order) but also higher-order dependencies, such as siblings (2nd order) and grandparents/uncles (3rd order).

Illustration of second and third-order dependency types

As shown in Figure 2, higher-order dependencies provide a richer structural context, allowing the model to bridge gaps between distant words that are syntactically related.

Masked Dependency Prediction

The pre-training task involves masking both the connection (the existence of a link) and the type (the syntactic role) between pairs of words. The encoder is then tasked with recovering these masked attributes from its hidden representations. This forces the model to learn the underlying structural rules of the language.

Overview of the syntax-induced pre-training process

Figure 1 illustrates the overall training flow, where the model processes input text and predicts dependencies based on the extracted tree structure.

Fine-tuning for Relation Extraction

After pre-training, the encoder is fine-tuned for the RE task. We employ a bi-affine attention mechanism to compute scores for potential relations between entity representations, allowing the model to effectively classify the relationship between two given entities.

Experiments and Results

We evaluated our model on two standard English RE benchmarks: ACE2005EN and SemEval 2010 Task 8.

Key Results

Our approach achieved state-of-the-art results on both datasets, outperforming vanilla BERT/XLNet and models that utilize explicit graph layers like GCNs or GATs.

  • ACE2005: Reached an F1 score of 74.60 using XLNet-Large with 2nd order DM.
  • SemEval 2010: Reached an F1 score of 89.90.
  • Ablation Study: When applied to a standard Transformer without prior BERT pre-training, the dependency masking task yielded a 30% absolute increase in F1 score, proving the task itself is a powerful way to teach a model language structure.

Insights

  • Optimal Complexity: Research found that 2nd order dependencies (e.g., siblings) often provide the best balance between context and noise. While 3rd order dependencies can capture even longer-range interactions, they sometimes introduce task-irrelevant noise.
  • Internalized Structure: Qualitative analysis using t-SNE visualizations indicates that the model naturally learns to cluster words with similar syntactic and semantic roles, such as grouping various job titles together, even without explicit labels for these categories.

Conclusion

This work demonstrates that syntax-induced pre-training via dependency masking is a powerful method for improving Relation Extraction. By internalizing structural knowledge, models can achieve superior performance and robustness without the need for expensive dependency parsing during inference. Future work includes exploring the effectiveness of this strategy on morphologically rich languages and investigating ways to mitigate the noise introduced by higher-order dependencies.

Summary updated

BibTeX
@inproceedings{tian2022improving,
  author = {Yuanhe Tian and Yan Song and Fei Xia},
  title = {{Improving Relation Extraction through Syntax-induced Pre-training with Dependency Masking}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-acl.147},
}
Figure