Introduction
Standard Transformer models excel at capturing correlations between tokens through self-attention but often lack an inherent understanding of linguistic syntax—the structural rules defining how words relate. At the 2019 Conference on Recent Advances in Natural Language Processing (RANLP), researchers proposed Dependency-Based Self-Attention (DBSA). This mechanism explicitly incorporates syntactic relationships into the Transformer architecture, achieving a 1.0 BLEU point improvement in Japanese-to-English translation tasks.
The Structural Challenge in NMT
While self-attention is powerful, it treats sentences primarily as sequences. Two major hurdles prevent standard models from leveraging syntax effectively:
- The Decoder Constraint: Unlike encoders, decoders generate tokens autoregressively. They cannot access "future" tokens, making traditional dependency parsing—which typically requires a complete sentence—difficult to apply on the target side.
- The Subword Gap: Modern NMT relies on subword units (e.g., BPE) to manage rare words, whereas most dependency parsers operate on full words. Mapping word-level syntax to subword-level processing is a non-trivial alignment problem.
Dependency-Based Self-Attention (DBSA)
The DBSA approach modifies the standard multi-head attention mechanism by introducing dedicated parsing heads. In a specific layer (experimentally determined as the 4th layer), one attention head is tasked with learning dependency relations using a bi-affine operation to calculate the probability of syntactic "head-child" relationships.
The model is trained using a multi-task objective, minimizing both translation error and dependency parsing error. To address the decoder's "future information" problem, the target-side DBSA is masked, ensuring predictions only rely on previously generated tokens. Furthermore, a heuristic mapping was developed for subwords: the rightmost subword of a split word inherits the original syntactic head, while preceding subwords point to their immediate right neighbor.
Experimental Results
The model was evaluated on the WAT’18 ASPEC Japanese-to-English corpus (1.5 million training pairs). Ground truth labels were provided by the EDA parser for Japanese and Stanford Dependencies for English.
The results demonstrate that structural awareness is beneficial on both sides of the translation process. Adding DBSA to both the encoder and decoder yielded the highest performance, a +1.0 BLEU gain over the baseline Transformer.
Key Insights and Limitations
The study highlights that syntax serves as a vital guide for internal representations, helping the model attend to relevant words (like subjects and their verbs) more effectively. Notably, the researchers found that subword-level processing remains essential; even with DBSA, word-level models performed significantly worse due to out-of-vocabulary issues.
However, limitations remain. The performance gains were observed on Japanese-to-English, a pair with significantly different word orders (SOV vs. SVO); the impact might vary for more linguistically similar pairs. Additionally, the method's accuracy is inherently capped by the quality of the external parsers used for training labels. Future work will explore the universality of these gains across diverse language families.
Summary updated