Syntax-Enhanced Pre-trained Model

Zenan Xu, Daya Guo, Duyu Tang, Qinliang Su, Linjun Shou, Ming Gong, Wanjun Zhong, Xiaojun Quan, Daxin Jiang, Nan Duan

Abstract

While standard pre-trained language models like BERT and RoBERTa have achieved remarkable success, they primarily treat text as a linear sequence, often overlooking the hierarchical syntactic structure of language. We present SEPREM (Syntax-Enhanced PRE-trained Model), a framework that integrates global syntactic information into Transformers during both pre-training and fine-tuning. By introducing a novel dependency distance prediction task and a syntax-aware attention mechanism, SEPREM captures long-range structural dependencies. Our model achieves state-of-the-art results across six benchmark datasets in entity typing, question answering, and relation classification.

Introduction

Dominant NLP models typically process text as a flat sequence of tokens. This approach ignores the inherent "tree-like" structure of language, where words relate to one another through complex dependency paths (e.g., subject-verb-object relationships). Previous attempts to incorporate syntax faced two primary challenges: a discrepancy between pre-training and fine-tuning stages, and a focus on local "head prediction" (identifying immediate parents) rather than global sentence structure.

SEPREM addresses these issues by utilizing a consistent syntax-aware architecture across all stages and shifting the focus toward global syntactic distances between all word pairs in a sentence.

Methodology

SEPREM introduces two core innovations to the standard Transformer architecture:

1. Syntax-aware Attention Layer

Standard self-attention treats all tokens with equal structural weight. SEPREM incorporates a Distance Matrix ($D$), representing the number of edges between any two words in a dependency tree. A learnable importance score ($\alpha$) allows the model to dynamically balance standard contextual information with this structural distance representation.

2. Dependency Distance Prediction (DP)

To force the model to learn global sentence structure, we introduce a new pre-training objective. Unlike traditional "head prediction" (HP) which only identifies immediate parents, the DP task requires the model to predict the path length (distance) between masked nodes in the syntactic tree.

Illustration of syntactic dependency distances between words in a sentence.

Experimental Setup

SEPREM is built upon the RoBERTa-large architecture. For pre-training, the authors utilized a massive corpus of 1 billion sentences from Common Crawl news, parsed automatically using the Stanza dependency parser. This "silver" data approach demonstrates that high-quality automated parsing is sufficient for large-scale structural pre-training.

Evaluation was conducted on six benchmarks:

  • Entity Typing: Open Entity and FIGER.
  • Question Answering: SearchQA, Quasar-T, and CosmosQA.
  • Relation Classification: TACRED.

Results and Discussion

SEPREM achieved state-of-the-art (SOTA) performance across all tested benchmarks. Notably, on the Open Entity dataset, the model showed a 3.6% improvement in micro-F1 over a RoBERTa-large baseline. In relation extraction (TACRED), SEPREM outperformed specialized models like K-Adapter, confirming that syntactic paths are vital for identifying entity relationships.

Performance comparison across different tasks showing the impact of Head Prediction (HP) and Distance Prediction (DP) objectives.

A key insight from our ablation studies (shown above) is that Global Syntax > Local Syntax. Predicting the distance between any two nodes (DP) provides a significantly stronger signal for downstream tasks than simply predicting immediate word parents (HP). Furthermore, maintaining architectural consistency between pre-training and fine-tuning prevents the distribution shifts common in other syntax-augmented models.

Conclusion and Limitations

SEPREM demonstrates that infusing global syntactic structure into pre-trained models significantly enhances their performance on complex linguistic tasks. However, the approach is computationally intensive, requiring significant GPU resources for pre-training. Additionally, while the model is robust, its performance is partially bounded by the accuracy of the underlying dependency parser. Future work may explore combining syntactic infusion with external knowledge graphs to bridge the gap in common-sense reasoning tasks.

Summary updated

BibTeX
@inproceedings{xu2021syntax,
  author = {Zenan Xu and Daya Guo and Duyu Tang and Qinliang Su and Linjun Shou and Ming Gong and Wanjun Zhong and Xiaojun Quan and Daxin Jiang and Nan Duan},
  title = {{Syntax-Enhanced Pre-trained Model}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.420},
}
Figure