Zhihao Fan, Yeyun Gong, Dayiheng Liu, Zhongyu Wei, Siyuan Wang, Jian Jiao, Nan Duan, Ruofei Zhang, Xuanjing Huang
Transformer is an attention-based neural network, which consists of two sublayers, namely, Self-Attention Network (SAN) and Feed-Forward Network (FFN). Existing research explores to enhance the two sublayers separately to improve the capability of Transformer for text representation. In this paper, we present a novel understanding of SAN and FFN as Mask Attention Networks (MANs) and show that they are two special cases of MANs with static mask matrices. However, their static mask matrices limit the capability for localness modeling in text representation learning. We therefore introduce a new layer named dynamic mask attention network (DMAN) with a learnable mask matrix which is able to model localness adaptively. To incorporate advantages of DMAN, SAN, and FFN, we propose a sequential layered structure to combine the three types of layers. Extensive experiments on various tasks, including neural machine translation and text summarization demonstrate that our model outperforms the original Transformer.
| Task | Dataset | Metric | Value | Model |
|---|---|---|---|---|
| Machine Translation | IWSLT2014 German-English | BLEU score | 36.3 | Mask Attention Network (small) |
| Machine Translation | WMT2014 English-German | BLEU score | 30.4 | Mask Attention Network (big) |
| Machine Translation | WMT2014 English-German | BLEU score | 29.1 | Mask Attention Network (base) |
| Text Summarization | GigaWord | ROUGE-1 | 38.28 | Mask Attention Network |
| Text Summarization | GigaWord | ROUGE-2 | 19.46 | Mask Attention Network |
| Text Summarization | GigaWord | ROUGE-L | 35.46 | Mask Attention Network |
| Text Summarization | CNN / Daily Mail | ROUGE-1 | 40.98 | Mask Attention Network |
| Text Summarization | CNN / Daily Mail | ROUGE-2 | 18.29 | Mask Attention Network |
| Text Summarization | CNN / Daily Mail | ROUGE-L | 37.88 | Mask Attention Network |
| Abstractive Text Summarization | CNN / Daily Mail | ROUGE-1 | 40.98 | Mask Attention Network |
| Abstractive Text Summarization | CNN / Daily Mail | ROUGE-2 | 18.29 | Mask Attention Network |
| Abstractive Text Summarization | CNN / Daily Mail | ROUGE-L | 37.88 | Mask Attention Network |