[Paper Review] Adding Interpretable Attention to Neural Translation Models Improves Word Alignment
The paper adds an alignment layer on top of a Transformer-based NMT model and introduces an attention optimization procedure to produce high-quality word alignments, achieving results comparable to Giza++ on several datasets without supervised alignment data.
Multi-layer models with multiple attention heads per layer provide superior translation quality compared to simpler and shallower models, but determining what source context is most relevant to each target word is more challenging as a result. Therefore, deriving high-accuracy word alignments from the activations of a state-of-the-art neural machine translation model is an open challenge. We propose a simple model extension to the Transformer architecture that makes use of its hidden representations and is restricted to attend solely on encoder information to predict the next word. It can be trained on bilingual data without word-alignment information. We further introduce a novel alignment inference procedure which applies stochastic gradient descent to directly optimize the attention activations towards a given target word. The resulting alignments dramatically outperform the naive approach to interpreting Transformer attention activations, and are comparable to Giza++ on two publicly available data sets.
Motivation & Objective
- Motivate the need for accurate word alignments derived from neural MT attention mechanisms.
- Propose an alignment layer that attends only to encoder representations to predict the next target word.
- Enable unsupervised training of alignments by fine-tuning an existing translation model without word-aligned data.
- Introduce an inference-time SGD-based optimization of attention activations to align a given target word.
- Evaluate alignment quality against FastAlign and Giza++ on public datasets.
Proposed method
- Extend Transformer with an alignment layer on top of the decoder that uses encoder-attention and no skip connections.
- Represent encoder information as keys/values for a multi-head attention in the alignment layer.
- Train alignment layer by fine-tuning a pre-trained translation model while keeping the base model fixed.
- During inference, optimize attention activations via SGD to maximize the likelihood of the target word.
- Experiment with different encoder representations (word embeddings, encoder outputs, or their combination) as keys/values for the alignment layer.
- Compare against baseline statistical aligners (FastAlign, Giza++) on German–English, English–French, and Romanian–English data.
Experimental results
Research questions
- RQ1Can an unsupervised alignment layer atop a Transformer produce competitive word alignments without word-aligned data?
- RQ2Does optimizing attention activations for a given target word improve alignment quality?
- RQ3How do different encoder representations as keys/values affect alignment accuracy?
- RQ4How does the proposed method compare to FastAlign and Giza++ across multiple language pairs and directions?
Key findings
- Alignment layer with SGD-attention optimization yields substantial AER improvements over naive attention averaging.
- Using encoder outputs as keys/values with word embeddings or their combination provides best results, roughly comparable to FastAlign on some setups.
- Symmetrizing alignments from both translation directions further improves results, achieving performance close to Giza++ on two datasets.
- On German–English, the Add+SGD setup achieves an AER of 26.6% (DeEn) and 30.4% (EnDe) in one-direction/combined forms, approaching Giza++ performance.
- Across En-Fr and Ro-En, the method consistently improves AER with the alignment layer and SGD optimization, sometimes closely matching or outperforming FastAlign in certain directions.
- The approach is unsupervised, trainable by fine-tuning an existing translation model, and easy to implement.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.