Introduction
While the Transformer architecture and its Self-Attention Networks (SANs) have revolutionized Neural Machine Translation (NMT), they often suffer from a "missing the forest for the trees" problem. Standard SANs are adept at modeling dependencies between individual words regardless of distance, but they frequently struggle to capture the continuous phrase patterns that were central to older Statistical Machine Translation (SMT) systems.
Research indicates that many attention heads in a standard Transformer are redundant. This paper, presented at EMNLP-IJCNLP 2019, proposes Multi-Granularity Self-Attention (MG-SA): a method to repurpose these underutilized heads to explicitly model phrases and syntactic structures, thereby capturing hierarchical patterns that word-only models overlook.
Methodology: Capturing Multi-Granularity Structures
The core of MG-SA involves specializing a subset of attention heads in the encoder to focus on phrase-level information. This is achieved through a multi-step process:
- Phrase Partitioning: The input sentence is segmented into fragments using either simple N-grams (adjacent word sequences) or Syntactic Phrases (constituents like Noun Phrases identified by an external parser).
- Phrase Composition: To represent a phrase as a single vector, the authors found that a small internal Self-Attention Network (SAN) is most effective at aggregating information from the constituent words.
- Phrase Interaction: To capture the hierarchical, tree-like structure of language, an Ordered Neurons LSTM (ON-LSTM) models the interactions between these composed phrases.
To further guide the learning process, the authors introduced Auxiliary Supervision via a "phrase tag loss," requiring the model to predict the syntactic label (e.g., "NP") of the fragments it attends to.
Experimental Results
The model was evaluated on the WMT14 English-to-German (En-De) and NIST Chinese-to-English (Zh-En) benchmarks. MG-SA achieved significant gains, with a +0.97 BLEU improvement on En-De and an average of +1.86 BLEU on Zh-En over the Transformer-Base baseline. These improvements persisted even when scaling to the larger "Transformer-Big" architecture.
The Impact of Granularity and Syntax
A key finding was that phrase modeling is most effective when applied to the bottom layer of the encoder, establishing structural "chunks" early to facilitate higher-level reasoning. Furthermore, while n-gram modeling provides benefits, utilizing actual syntactic boundaries from a parser yields the most substantial performance gains.
As shown in the figure above, the combination of syntactic phrases and interaction modeling consistently outperforms simpler n-gram approaches across various granularities. Despite the extra complexity, training speed only decreased marginally, from 1.28 to 1.19 steps per second in the most complex configuration.
Conclusion
Multi-Granularity Self-Attention demonstrates that the "wisdom of phrases" from the SMT era can be effectively integrated into modern NMT architectures. By specializing redundant attention heads, MG-SA improves translation quality and structural understanding with minimal computational overhead. Future work may extend these multi-granularity concepts to the decoder or explore their effectiveness in morphologically rich languages.
Summary updated