Are Neighbors Enough? Multi-Head Neural n-gram can be Alternative to Self-attention

07/27/2022
by   Mengsay Loem, et al.
16

Impressive performance of Transformer has been attributed to self-attention, where dependencies between entire input in a sequence are considered at every position. In this work, we reform the neural n-gram model, which focuses on only several surrounding representations of each position, with the multi-head mechanism as in Vaswani et al.(2017). Through experiments on sequence-to-sequence tasks, we show that replacing self-attention in Transformer with multi-head neural n-gram can achieve comparable or better performance than Transformer. From various analyses on our proposed method, we find that multi-head neural n-gram is complementary to self-attention, and their combinations can further improve performance of vanilla Transformer.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/14/2020

Faster Transformer Decoding: N-gram Masked Self-Attention

Motivated by the fact that most of the information relevant to the predi...
research
11/20/2020

ConvTransformer: A Convolutional Transformer Network for Video Frame Synthesis

Deep Convolutional Neural Networks (CNNs) are powerful models that have ...
research
08/30/2021

Shatter: An Efficient Transformer Encoder with Single-Headed Self-Attention and Relative Sequence Partitioning

The highly popular Transformer architecture, based on self-attention, is...
research
11/03/2021

PhyloTransformer: A Discriminative Model for Mutation Prediction Based on a Multi-head Self-attention Mechanism

Severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) has caused ...
research
01/27/2023

On the Connection Between MPNN and Graph Transformer

Graph Transformer (GT) recently has emerged as a new paradigm of graph l...
research
11/11/2019

A hybrid text normalization system using multi-head self-attention for mandarin

In this paper, we propose a hybrid text normalization system using multi...

Please sign up or login with your details

Forgot password? Click here to reset