Improving Neural Machine Translation with Parent-Scaled Self-Attention

Emanuele Bugliarello, Naoaki Okazaki

Abstract

The Transformer architecture has significantly advanced Neural Machine Translation (NMT) by leveraging self-attention to capture global dependencies. However, it lacks an explicit inductive bias for the hierarchical structure of language. We present Parent-Scaled Self-Attention (PASCAL), a simple, parameter-free method to integrate dependency syntax into the Transformer encoder. PASCAL scales attention scores using a Gaussian distribution centered on a token's grammatical parent. Our evaluation across diverse translation tasks shows that PASCAL consistently improves translation quality, especially for long sentences and low-resource scenarios, while maintaining the original model's efficiency.

Introduction

While the Transformer's self-attention mechanism is powerful, it treats sentences primarily as sequences of tokens. In contrast, human language is structured hierarchically, where words relate to one another through dependency relationships (e.g., subjects and verbs) that may be separated by many tokens. Previous attempts to incorporate syntax into NMT often introduced significant complexity, such as additional encoders or recurrent components, which hinder the Transformer's parallelization and efficiency. PASCAL addresses this by providing a "syntactic nudge" within the existing self-attention framework without adding any new parameters.

Methodology: Parent-Scaled Self-Attention (PASCAL)

PASCAL modifies the standard self-attention mechanism to prioritize grammatically related tokens. The process involves four key steps:

  1. Dependency Parsing: An external parser (e.g., Stanford CoreNLP) identifies the dependency parent for each word in the source sentence.
  2. Gaussian Scaling: Instead of uniform attention, scores are scaled by a Gaussian weight centered at the position of the token's parent. This allows the model to focus on the parent and its immediate local context.
  3. Layer Integration: The authors found that applying this scaling to the first layer of the encoder is most effective. This "contextualizes" raw embeddings with structural information early in the processing pipeline.
  4. Parent Ignoring: To mitigate the impact of potential parsing errors, a regularization technique called "parent ignoring" is used, where syntactic information is randomly omitted during training.
The PASCAL architecture integrates a distance-based scaling factor into the self-attention mechanism.

Crucially, PASCAL is parameter-free. It leverages the existing Transformer structure and modifies the attention calculation directly, ensuring no increase in model size or significant training overhead.

Experimental Setup

The effectiveness of PASCAL was evaluated on several benchmarks:

  • Standard Benchmarks: WMT16 and WMT17 English-German (En-De).
  • Low-Resource Scenarios: News Commentary v11 (NC11) En-De/De-En and WMT18 English-Turkish (En-Tr).
  • Distant Language Pairs: WAT English-Japanese (En-Ja), characterized by significant differences in word order.

Key Results and Analysis

PASCAL demonstrated consistent improvements over the baseline Transformer and other syntax-aware methods across all tasks.

Performance on Long Sentences

One of the most significant findings is PASCAL's ability to handle long sentences. In the WAT English-Japanese task, PASCAL achieved a BLEU score improvement of over 3.5 points for the longest sentence brackets. This suggests that the syntactic inductive bias helps the model maintain structural coherence over long distances where standard self-attention might become noisy.

Delta BLEU improvements across different source sentence lengths for various datasets.

Low-Resource and Morphological Gains

In the English-Turkish task, a morphologically rich and low-resource language pair, PASCAL provided a +0.9 BLEU boost. Furthermore, improvements in the RIBES metric (+1.75 for En-Ja) indicate that the model captures target-language word order more effectively.

Architectural Insights

The researchers noted that multiplying attention scores by syntactic weights outperformed additive biases. Multiplication forces the gradients to focus more intensely on dependent pairs during backpropagation, leading to superior feature learning. Additionally, the Gaussian "width" allows the model to attend to a parent's neighbors, which is beneficial for capturing idiomatic or multi-word expressions.

Conclusion

PASCAL offers a highly efficient way to incorporate linguistic structure into NMT. By providing a parameter-free syntactic bias in the initial encoder layer, it significantly enhances translation quality, particularly for challenging long-form text and low-resource languages. Future work may explore extending this approach to the decoder side or distributing syntactic information across multiple layers.

Summary updated

BibTeX
@inproceedings{bugliarello2020improving,
  author = {Emanuele Bugliarello and Naoaki Okazaki},
  title = {{Improving Neural Machine Translation with Parent-Scaled Self-Attention}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.147},
}
Figure