Abstract
Many efforts have been devoted to extracting constituency trees from pre-trained language models, often proceeding in two stages: feature definition and parsing. However, this kind of methods may suffer from the branching bias issue, which will inflate the performances on languages with the same branch it biases to. In this work, we propose quantitatively measuring the branching bias by comparing the performance gap on a language and its reversed language, which is agnostic to both language models and extracting methods. Furthermore, we analyze the impacts of three factors on the branching bias, namely parsing algorithms, feature definitions, and language models. Experiments show that several existing works exhibit branching biases, and some implementations of these three factors can introduce the branching bias.
Introduction
Researchers from Tencent AI Lab have uncovered a hidden "branching bias" in how grammar is extracted from Large Language Models (LLMs). In the quest to understand what LLMs "know," researchers often try to extract constituency trees—hierarchical structures of sentences—from them. This process typically involves defining features (such as attention weights) and applying a parsing algorithm to build the tree.
However, languages exhibit different branching tendencies. English is primarily right-branching (the head of a phrase usually comes first), while languages like Japanese are left-branching. If an extraction method is inherently biased toward right-branching structures, its performance on English data will be artificially inflated, failing to reflect true grammatical understanding. This paper introduces a standardized, model-agnostic way to measure this bias and identifies the specific components of the extraction pipeline responsible for it.
Methodology: The Branching Gap
The authors introduce a metric called the Branching Gap to quantitatively measure bias. The core of this approach is the "Reversal Trick":
- Sentence Reversal: For any language $L$, a synthetic language $L'$ is created by reversing the word order. If the original language is right-branching, its reversed version becomes perfectly left-branching.
- Gap Calculation: Parsing performance (F1-score) is measured on both the original language ($L$) and the reversed language ($L'$). The "Branching Gap" is the difference between these two scores. A gap near zero indicates an unbiased method.
To isolate the source of bias, the researchers systematically varied three factors: parsing algorithms, feature definitions, and the language models themselves.
Analysis of Bias Factors
The study evaluated several components commonly used in syntax extraction:
- Parsing Algorithms: Algorithms were tested using random feature scores to determine if the algorithm's structure inherently preferred a specific tree shape.
- Feature Definitions: Random model weights were used to see if specific ways of processing attention or hidden states (e.g., prefix-attention vs. full-attention) introduced bias.
- Language Models: Using unbiased parsers and features, the researchers tested whether pre-trained models like BERT, GPT-2, and LSTMs possessed inherent branching biases.
The study primarily used English data (Wikipedia and Penn TreeBank), validated against German (SPMRL Treebank) and Chinese (Penn Chinese TreeBank) to ensure cross-linguistic consistency.
Key Results
The experiments revealed significant biases in popular extraction methods:
- The MART Trap: The popular MART parsing algorithm showed a massive branching gap (e.g., +10.70 on English). Even when provided with random data, it produced right-branching trees, suggesting its high performance on English is largely due to structural preference rather than linguistic understanding.
- Algorithm Comparison: In contrast to MART, the DIST and ATTNSPAN algorithms were found to be nearly unbiased, with gaps close to zero across multiple languages.
- Feature Bias: "Prefix-attention" features (where a word only attends to preceding words, common in GPT-style models) created a significant gap (+7.27). "Full-attention" features, which consider the entire sentence, remained unbiased (-0.05).
- Model Bias: BERT exhibited the lowest inherent bias (-0.30), likely due to its bidirectional context. GPT-2 showed a slight left-bias (-2.24), while LSTMs showed a right-bias (+2.50), suggesting that different architectures process directional hierarchy differently.
Conclusion
This work demonstrates that many popular syntax extraction methods suffer from branching bias, which can lead to misleading performance metrics. By using the proposed Branching Gap metric, researchers can better evaluate whether a model has truly learned grammar or is simply benefiting from structural alignment. Future work will explore how these biases scale with model size and manifest in multilingual contexts.
Summary updated