Abstract
While the Transformer architecture has revolutionized Neural Machine Translation (NMT), it relies on the assumption that its self-attention mechanism will implicitly learn the underlying structure of language. However, research indicates that Transformers often struggle to capture deep syntactic relationships, particularly in low-resource settings or with exceptionally long sentences. This paper discusses PASCAL (Parent-Scaled Self-Attention), a simple yet powerful modification to the Transformer that explicitly incorporates source-side syntax. By weighting self-attention scores based on the distance to a word's dependency parent, the model achieves significant gains in translation quality without adding any extra parameters.
Introduction
The standard Transformer's self-attention mechanism allows every token to attend to every other token in a sequence. While flexible, this approach lacks an inductive bias toward the hierarchical nature of language. Previous attempts to inject "syntax-awareness" into NMT often involved complex multi-encoder setups or interleaving structural tags, which increase computational overhead and training difficulty. PASCAL addresses these challenges by providing a "syntactic nudge" that is both computationally efficient and compatible with modern sub-word tokenization methods like Byte Pair Encoding (BPE).
Methodology: Parent-Scaled Self-Attention (PASCAL)
The core innovation of PASCAL is the modification of the standard self-attention formula to prioritize syntactically related tokens. The process involves four key steps:
- Dependency Mapping: An external parser identifies the "parent" of every word in the source sentence. Since NMT models operate on sub-word units, each sub-word is mapped to the middle position of its corresponding parent word.
- Gaussian Weighting: Attention scores are scaled by a Gaussian distribution centered at the parent's position. This encourages the model to pay more attention to a token's syntactic parent and its immediate neighbors.
- Parameter-Free Integration: Unlike methods that require training new attention heads, PASCAL is a fixed mathematical modification. It introduces zero additional parameters to the model, ensuring negligible training overhead.
- Parent Ignoring: To mitigate the impact of noisy or incorrect parses from external tools, a regularization technique called "parent ignoring" is used. During training, the model occasionally bypasses the syntactic guidance, preventing over-reliance on potentially flawed dependency trees.
Experimental Setup
The authors evaluated PASCAL across several translation scenarios to test its robustness:
- Low-Resource/Small-Scale: News Commentary v11 (NC11) for English↔German and WMT18 for English→Turkish.
- Large-Scale: WMT16 and WMT17 for English→German.
- Distant Language Pairs: WAT English→Japanese, evaluated using both BLEU and RIBES metrics.
Key Results and Analysis
PASCAL consistently outperformed the standard Transformer and other state-of-the-art syntax-aware methods. The most significant improvements were observed in the following areas:
The Long Sentence Boost
One of the most dramatic findings was the model's performance on long sentences. In sequences exceeding 50 tokens, PASCAL achieved gains of over +2 BLEU points in low-resource settings and up to +3.5 BLEU points on the English-Japanese task. This suggests that explicit syntactic guidance helps the model maintain structural coherence when the distance between related words increases.
Architectural Insights
- The "First Layer" Hypothesis: PASCAL is most effective when applied to the first layer of the encoder. At this stage, word representations are still relatively "isolated" embeddings; forcing them to attend to syntactic parents early on enriches these representations with structural context before they propagate through the network.
- Multiplicative Scaling: The research demonstrates that multiplying attention scores by the syntactic weight is superior to additive biasing. Multiplication introduces "sparsity," effectively filtering out irrelevant tokens and sharpening the gradient updates for syntactically related pairs.
Discussion and Future Work
While PASCAL provides a robust solution for source-side syntax, several avenues for future research remain. Currently, the model is tied to the quality of an external dependency parser. Although "parent ignoring" helps, the approach is fundamentally limited by the underlying linguistic theory of the parser used. Furthermore, this study focused exclusively on the encoder; incorporating target-side syntax in the decoder presents a more complex but promising next step for improving NMT.
In conclusion, PASCAL offers a highly efficient, parameter-free method to enhance Transformer-based translation by leveraging the inherent structural properties of language, proving particularly beneficial for long-form and low-resource translation tasks.
Summary updated