Introduction
Modern Machine Reading Comprehension (MRC) models, such as BERT, have achieved remarkable success by leveraging Self-Attention Networks (SAN). However, these models typically employ a "global" attention mechanism where every word in a sentence attends to every other word equally. While powerful, this approach often leads to "inaccurate concentration," where the model becomes distracted by irrelevant "noise" or dispensable words, particularly in long and complex passages.
Humans, by contrast, utilize linguistic structures to focus on key elements. To bridge this gap, the authors propose SG-Net (Syntax-Guided Network), which integrates linguistic structure directly into the Transformer's attention mechanism to filter out noise and prioritize syntactically relevant information.
The SG-Net Architecture
The core innovation of SG-Net is the Syntactic Dependency of Interest (SDOI) design, which constrains a word's attention to its syntactic ancestors in a dependency tree.
Syntactic Dependency of Interest (SDOI)
The process involves four primary steps:
- Syntactic Parsing: A pre-trained dependency parser generates a tree for every sentence, establishing grammatical relationships (e.g., identifying "head" words).
- SDOI Masking: For each word, the model identifies its ancestors in the dependency tree and creates a mask ($M$).
- SDOI-SAN: This masked attention layer ensures a word only "attends" to itself and its syntactic ancestors, capturing a linguistically motivated representation.
- Dual Context Aggregation: Rather than replacing standard attention, SG-Net uses a dual-stream architecture. It fuses the vanilla BERT output (global context) with the SDOI-SAN output (syntactic context) using a weighted sum.
Experimental Evaluation
SG-Net was evaluated on two major benchmarks:
- SQuAD 2.0: On this span-based extraction task, SG-Net achieved an 87.9 F1 score, significantly outperforming the BERT-Large baseline (84.8 F1) and ranking 2nd on the leaderboard at the time of submission.
- RACE: On this challenging multi-choice dataset requiring complex reasoning, the model reached 74.2% accuracy, a substantial improvement over the BERT baseline (72.6%).
Key Insights
Syntax as a Noise Filter
The SDOI mechanism acts as a pruning tool. By forcing the model to attend to "head" words, it avoids getting lost in the "detail-riddled" fluff of long sentences. Visualization of attention maps confirms that SG-Net successfully ignores stop words and focuses on keywords that directly answer the question.
Robustness to Sentence Length
Standard BERT performance often drops as question length increases. In contrast, SG-Net remains robust. In some instances, its accuracy even increases with question length, suggesting that syntactic guidance is most beneficial when the cognitive load and potential for noise are highest.
Complementary Contexts
Ablation studies revealed that neither vanilla attention nor syntax-guided attention is sufficient on its own. The "Dual Context" approach provides the optimal balance: the broad reach of standard Transformers combined with the precision of linguistic structure.
Conclusion
SG-Net demonstrates that incorporating explicit linguistic knowledge into self-attention mechanisms significantly enhances MRC performance, especially for complex and lengthy inputs. While the model currently depends on the quality of external parsers, future work may explore adapting this framework to other tree-structured annotations or hierarchical linguistic representations.
Summary updated