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

Mengsay Loem, Sho Takase, Masahiro Kaneko, Naoaki Okazaki
7/27/2022
cs.CL

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{loem2022neighbors,
  title  = {Are Neighbors Enough? Multi-Head Neural n-gram can be Alternative to Self-attention},
  author = {Mengsay Loem and Sho Takase and Masahiro Kaneko and Naoaki Okazaki},
  year   = {2022},
  eprint = {2207.13354},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.13354v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2207.13354.svg)](https://codeofpaper.com/paper/2207.13354)

Discussion