On the Branching Bias of Syntax Extracted from Pre-trained Language Models

Huayang Li, Lemao Liu, Guoping Huang, Shuming Shi

Abstract

While pre-trained language models (PLMs) like BERT and GPT-2 appear to capture syntactic structures without explicit supervision, the methods used to extract this information may be fundamentally biased. We introduce the "Mirror Test"—a method that compares parsing performance on original sentences against their word-reversed counterparts—to quantify branching bias. Our analysis reveals that several popular unsupervised parsing algorithms and feature extraction methods are inherently biased toward right-branching structures, potentially confounding claims about the syntactic knowledge of PLMs.

Introduction

The ability of PLMs to represent grammar is often evaluated by extracting constituency trees. However, most human languages possess a directional branching preference. English, for instance, is primarily right-branching. If an extraction method is inherently biased toward right-branching trees, it may falsely suggest that a model has "learned" English syntax. This paper seeks to isolate the sources of this bias within the extraction pipeline: the parsing algorithm, the feature definition, and the language model.

Methodology: The Mirror Test

To measure bias, we propose the Branching Gap metric. This involves a "Mirror Trick": for any language $L$, we generate a synthetic language $L'$ by reversing the word order of every sentence. This reversal effectively flips the branching direction of the underlying syntax.

The Mirror Trick: A right-branching sentence (top) and its left-branching reversed counterpart (bottom).

By measuring the parsing performance (F1-score) on both $L$ and $L'$, we can calculate the gap. A truly unbiased method should perform equally well on both, yielding a gap near zero. A large positive gap indicates a right-branching bias, while a large negative gap indicates a left-branching bias.

Analysis of Bias Sources

Algorithm Bias

To isolate the bias inherent in parsing algorithms, the authors evaluated them using random scores as input. This ensures that any performance difference is due to the algorithm's structure rather than the model's features.

Parsing Algorithm Bias: Performance ($L$, $L'$) and Branching Gap across languages when using random features. The MART algorithm shows a significant right-branching bias in English and Chinese.

As shown in the results, the MART algorithm is heavily biased, achieving an F1 of 26.11 on English but only 15.41 on reversed English (+10.70 gap) even with random noise. In contrast, the DIST and ATTNSPAN algorithms are nearly unbiased across multiple languages.

Feature and Model Bias

The study further identifies that "Prefix-attention" (unidirectional) features introduce a +7.27 gap in English, whereas "Hidden Representation" features are neutral. Among models, BERT proved to be the most objective observer with a negligible gap of -0.30, likely due to its bidirectional nature. Unidirectional models like GPT-2 and LSTMs showed slight biases in opposite directions.

Conclusion

Our findings serve as a cautionary note for the NLP community: when evaluating the syntactic capabilities of PLMs, it is crucial to ensure that the extraction methodology is not introducing its own structural preferences. The Mirror Test provides a robust framework for validating the neutrality of these "linguistic thermometers."

Summary updated

BibTeX
@inproceedings{li2020branching,
  author = {Huayang Li and Lemao Liu and Guoping Huang and Shuming Shi},
  title = {{On the Branching Bias of Syntax Extracted from Pre-trained Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  url = {https://openreview.net/forum?id=vJ633K9KZAk},
}
Figure