Alignment-Enhanced Transformer for Constraining NMT with Pre-Specified Translations

Kai Song, Kun Wang, Heng Yu, Yue Zhang, Zhongqiang Huang, Weihua Luo, Xiangyu Duan, Min Zhang

Introduction

Neural Machine Translation (NMT) systems, while highly effective, often operate as "black boxes" that are difficult for users to control. In many industrial and professional contexts, it is essential to enforce specific translations for technical terminology, brand names, or legal glossaries. Existing approaches to this problem generally fall into two categories: placeholder tags, which can cause the model to lose semantic context, and lexical constraints, which often struggle with "fidelity"—correctly identifying which source word should trigger a specific constraint. The root of this issue lies in the standard Transformer architecture, where multi-head attention is often too "noisy" to provide the reliable word alignments necessary for precise constraint placement.

Proposed Architecture: The Alignment-Enhanced Transformer

To address these limitations, the authors propose a dedicated Alignment-Enhanced Transformer. The core innovation is the addition of a supervised attention head specifically designed for word alignment within the target-to-source sub-layer of the Transformer decoder.

The Alignment-Enhanced Transformer architecture featuring a dedicated attention head and dual loss functions.

Unlike standard attention heads that learn implicitly through translation loss, this dedicated head is explicitly trained using external alignment signals from tools like FastAlign or GIZA++. The training process utilizes a multi-task objective function that combines standard translation loss with a specific alignment loss ($L_{align}$), ensuring the head learns a clean mapping between source and target tokens without interfering with the linguistic features captured by other heads.

Dictionary-Guided Decoding

During the inference phase, the model leverages the output of this dedicated alignment head to implement Dictionary-Guided Decoding. If the alignment head indicates that the current decoding step is strongly associated with a source word that has a pre-specified translation in the user's dictionary, the model intervenes in the generation process.

The dictionary-guided decoding mechanism, showing how probability distributions are adjusted to force specific tokens.

As illustrated above, the model "resets" its output probability distribution at the relevant decoding step, setting the log-probabilities of non-constrained tokens to negative infinity. This forces the decoder to select the pre-specified term, ensuring the constraint is met with high fidelity and zero additional computational overhead during inference.

Experimental Results

The researchers evaluated the model across 13 development and test sets covering five language pairs (English to Romanian, German, Russian, and French, plus Chinese to English). The results demonstrated significant improvements over existing state-of-the-art methods:

  • Translation Quality: The proposed method achieved an average improvement of 4.48 BLEU points when using simulated pre-specified translations, outperforming the previous state-of-the-art lexical constraint approach.
  • Alignment Accuracy: The Alignment Error Rate (AER) saw a drastic reduction. For instance, on the En-Ro dataset, the AER dropped from 60.7% in a vanilla Transformer to 36.2%.
  • Constraint Success: The rate at which the model correctly utilized provided dictionary terms jumped significantly, reaching 70-85% across various language pairs.

Conclusion and Future Work

By decoupling alignment from general attention and providing explicit supervision, the Alignment-Enhanced Transformer offers a robust solution for controllable NMT. While the current method is dependent on the quality of external aligners used during training, it provides a high-fidelity, efficient way to integrate domain-specific knowledge into neural translation. Future research may explore more dynamic constraint integration and reducing the dependency on static external alignment tools.

Summary updated

BibTeX
@inproceedings{song2020alignment,
  author = {Kai Song and Kun Wang and Heng Yu and Yue Zhang and Zhongqiang Huang and Weihua Luo and Xiangyu Duan and Min Zhang},
  title = {{Alignment-Enhanced Transformer for Constraining NMT with Pre-Specified Translations}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i05.6418},
}
Figure