SHAPE: Shifted Absolute Position Embedding for Transformers

Shun Kiyono, Sosuke Kobayashi, Jun Suzuki, Kentaro Inui
9/13/2021
cs.CL
transformer-attention

Official code: butsugiri/shape (3 stars, Python, MIT, last commit 2021-10-26).

Abstract

Position representation is crucial for building position-aware representations in Transformers. Existing position representations suffer from a lack of generalization to test data with unseen lengths or high computational cost.

Show full abstract

We investigate shifted absolute position embedding (SHAPE) to address both issues. The basic idea of SHAPE is to achieve shift invariance, which is a key property of recent successful position representations, by randomly shifting absolute positions during training. We demonstrate that SHAPE is empirically comparable to its counterpart while being simpler and faster.

View on arXivView PDF

Code Implementations(1)

butsugiri/shapeOfficial100%
MIT

Repository for Shifted Absolute Position Embedding (SHAPE)

30Python, PerlSep 2, 20215 years agoMIT

Similar Papers

Cite this paper

@article{kiyono2021shape,
  title  = {SHAPE: Shifted Absolute Position Embedding for Transformers},
  author = {Shun Kiyono and Sosuke Kobayashi and Jun Suzuki and Kentaro Inui},
  year   = {2021},
  eprint = {2109.05644},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.05644}
}

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/2109.05644.svg)](https://codeofpaper.com/paper/2109.05644)

Discussion