Introduction
Standard encoder-decoder models with global attention mechanisms have become the cornerstone of sequence-to-sequence learning. However, these models face significant challenges when applied to tasks where the input and output sequences are long and follow a strictly chronological or sequential order. This paper, presented at IJCNLP 2017, introduces a refined Local Monotonic Attention mechanism designed to enhance both the speed and accuracy of such models.
The Challenge of Global Attention
Global attention mechanisms require the model to scan the entire input sequence at every decoding step to calculate attention weights. This leads to two primary issues:
- Computational Complexity: The $O(T \times S)$ complexity (where $T$ is target length and $S$ is source length) becomes a bottleneck for long-form audio or documents.
- Alignment Errors: In tasks like Automatic Speech Recognition (ASR), the output text moves monotonically with the input audio. Global attention can "get lost," attending to distant parts of the sequence and causing misalignments.
Proposed Method: Local Monotonic Attention
The authors propose a three-step process to calculate the context for the decoder, ensuring the model focuses on a small, moving window of the input.
1. Monotonic Position Prediction
Instead of scanning the whole sequence, the model predicts a central position $p_t$ in the input. This is calculated by adding a predicted step size $\Delta p_t$ to the previous position $p_{t-1}$. By using an exponential or sigmoid function, $\Delta p_t$ is forced to be positive, ensuring the model always moves forward through the input.
2. Locality-based Alignment
The model restricts its attention to a small window around the center, specifically $[p_t - 2\sigma, p_t + 2\sigma]$. This reduces the per-step complexity from $O(S)$ to $O(\sigma)$, where $\sigma$ is a small constant. This allows the model to scale efficiently with very long inputs.
3. Gaussian Scaling
To further refine focus, a Gaussian distribution centered at $p_t$ is used to scale the attention scores. This acts as a prior, encouraging the model to prioritize information near the center of the window.
Experimental Results
The proposed mechanism was evaluated across three distinct domains: Automatic Speech Recognition (ASR) using the TIMIT dataset, Grapheme-to-Phoneme (G2P) conversion using CMUDict, and Machine Translation (MT) using the BTEC dataset.
Key Findings
- ASR Performance: The model achieved a 20.9% Phoneme Error Rate (PER) on TIMIT, representing a 12.2% relative improvement over the global attention baseline (23.8%).
- G2P Accuracy: The model reached a 5.43% PER, outperforming standard global attention and previous fixed-step local attention methods.
- Translation Quality: For Indonesian-to-English translation, which features similar structural alignment, the model improved the BLEU score by 3.6 points over the baseline.
- Unconstrained Prediction: Using an exponential function for position prediction (unconstrained) outperformed constrained sigmoid-based methods and simplified hyperparameter tuning.
Discussion and Conclusion
The Local Monotonic Attention mechanism provides a form of implicit regularization by preventing the model from over-fitting on distant, irrelevant parts of the input. While highly effective for monotonic tasks, the authors note that global attention remains superior for language pairs requiring heavy reordering (e.g., English to Japanese).
In conclusion, this approach offers a significant step forward for end-to-end speech and language processing by combining the representational power of attention with the efficiency and structural priors of monotonic alignment. Future work may explore dynamic window sizes to further increase flexibility.
Summary updated