Adding Interpretable Attention to Neural Translation Models Improves Word Alignment

Thomas Zenkel, Joern Wuebker, John DeNeroarXiv 2019

Neural Machine Translation (NMT) has achieved remarkable success, yet it remains a "black box" regarding how specific source words influence target word generation. While traditional statistical models like Giza++ provided explicit word alignments, the multi-head attention mechanism in Transformers is often too distributed or "smeared" across layers to be directly useful for tasks like lexicon injection or annotation projection.

Researchers from Lilt and UC Berkeley propose a solution that introduces a dedicated alignment layer and an inference-time optimization procedure to "sharpen" these attention weights into high-quality word alignments.

The Challenge of Neural Word Alignment

In practical translation workflows, word alignment is vital for several downstream tasks:

  • Lexicon Injection: Ensuring domain-specific terms are translated accurately.
  • Annotation Projection: Maintaining formatting (bold, links) from source to target.
  • Localization: Correctly placing UI tags and placeholders.

Standard Transformers distribute attention across many heads and layers to capture syntax, semantics, and agreement. Simply averaging these weights typically results in blurry, inaccurate alignments that fail to pinpoint specific word correspondences.

Architectural Innovation: The Alignment Layer

The authors introduce a specialized Alignment Layer positioned at the top of the decoder. The critical design choice here is the omission of skip (residual) connections. By removing these connections, the model is forced to rely exclusively on information from the encoder to predict the next token. This constraint effectively "traps" the alignment signal within this specific layer, making it far more interpretable than standard attention.

Figure 1: The proposed architecture featuring a dedicated Alignment Layer and the Attention Optimization loop.

Inference-Time Attention Optimization

Beyond architectural changes, the authors employ a novel inference trick called Attention Optimization. Since the target word is already known during the alignment process, they treat the attention weights ($A$) as parameters to be optimized. Using stochastic gradient descent (SGD), they iteratively update $A$ to maximize the probability of the actual target word. This "backpropagation into the attention" focuses the weights on the most relevant source tokens, significantly reducing noise.

The model is trained in an unsupervised manner by fine-tuning an existing NMT model, ensuring the approach is both effective and computationally efficient without requiring gold-standard alignment data.

Experimental Results

The researchers evaluated their method against industry standards like Giza++ and FastAlign across several language pairs, including German-English (De-En) and French-English (Fr-En).

The quantitative improvements were substantial. As shown in the results table below, the "Add+SGD" method dramatically outperformed naive attention averaging and matched or exceeded traditional statistical baselines.

Figure 6: Alignment Error Rate (AER) comparison across different methods and language pairs. Lower is better.

Key Findings

  • German-English Performance: The "Add+SGD" method reduced the Alignment Error Rate (AER) from a baseline of 50.9% to 21.2%, matching the performance of Giza++ (21.4%) and surpassing FastAlign (27.0%).
  • Initialization is Critical: Starting the SGD optimization from the forward pass's "raw" attention weights (the "Add" method) proved far superior to random initialization. This indicates that the base model possesses latent alignment knowledge that the optimization step merely clarifies.
  • Symmetrization: Similar to traditional statistical models, the neural approach benefits from bidirectional alignment—running the process in both directions and merging the results to improve precision.

Conclusion

This work demonstrates that interpretability in neural models can be achieved through intentional architectural constraints and targeted optimization. By "forcing" the network to be transparent, the authors have bridged the gap between the high performance of NMT and the interpretability of classical statistical alignment. While Giza++ still maintains a slight edge in certain contexts, this neural approach offers a path toward more controllable and verifiable machine translation systems.

Summary updated

BibTeX
@misc{zenkel2019adding,
  author = {Thomas Zenkel and Joern Wuebker and John DeNero},
  title = {{Adding Interpretable Attention to Neural Translation Models Improves Word Alignment}},
  year = {2019},
  eprint = {1901.11359},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1901.11359},
}
Figure