Introduction
The standard Transformer architecture has fundamentally changed Neural Machine Translation (NMT) by leveraging self-attention to model global dependencies. However, it often overlooks local linguistic relationships that are better captured through intermediate regional contexts. Transformer++ addresses this by introducing a hybrid multi-head attention mechanism and incorporating multi-task learning for Part-of-Speech (POS) tagging and Named Entity Recognition (NER). This approach allows the model to understand both the global structure and the syntactic "scaffolding" of language, leading to state-of-the-art performance on benchmark tasks.
Methods: Hybrid Attention and Multi-Task Learning
Transformer++ introduces two significant modifications to the vanilla Transformer architecture to enhance its representational power.
Hybrid Multi-Head Attention
Instead of relying solely on scaled dot-product self-attention, the model splits its $H$ attention heads. Half of the heads ($H/2$) perform traditional self-attention to maintain global dependency modeling. The other half ($H/2$) utilize a novel convolution-based attention module. This module employs dilated depth-wise separable convolutions to generate a local context representation, which is then combined with an adaptive query module to capture a global sentence summary.
Multi-Task Base Encoder
To provide the model with a deeper understanding of language structure, the authors insert a two-layer "Base Encoder" before the standard encoder stacks. These layers are trained using multi-task learning objectives:
- Encoder 1 is optimized for POS tagging.
- Encoder 2 is optimized for NER label prediction.
By pre-conditioning the encoder on these syntactic and semantic tasks, the model learns richer source text representations before proceeding to translation-specific layers.
Key Insights
The success of Transformer++ stems from several core ideas:
- Complementary Mechanisms: Convolution and self-attention are treated as partners. Convolution excels at capturing local, translation-invariant patterns, while self-attention handles global coordination.
- Linguistic Grounding: Explicitly training on POS and NER tasks forces the model to attend to syntactic functions, moving beyond simple string mapping to structural understanding.
- Computational Efficiency: By using depth-wise separable convolutions, the model maintains a computational complexity of $O(f \cdot n \cdot d)$, which is often more efficient than the $O(n^2 \cdot d)$ complexity of standard self-attention for long sequences.
Experimental Results
The model was evaluated on the WMT 2014 English-to-German (En-De) and English-to-French (En-Fr) benchmarks. Transformer++ achieved significant improvements over the original Transformer and other competitive models like Dynamic Convolution and Data Diversification.
As shown in the results, Transformer++ reached 32.1 BLEU on En-De and 44.6 BLEU on En-Fr. Notably, these gains were achieved with approximately 212M parameters, nearly identical to the original Transformer's footprint, demonstrating that the improvements are a result of architectural innovation rather than simple scaling.
Conclusion and Future Work
Transformer++ demonstrates that integrating local convolutional context and linguistic multi-tasking can substantially boost NMT performance without increasing parameter counts. Future research may explore optimizing the number of encoder/decoder stacks and analyzing the model's sensitivity to the quality of external linguistic labels.
Summary updated