CAPE: Encoding Relative Positions with Continuous Augmented Positional Embeddings
Preprint
Abstract
Without positional information, attention-based Transformer neural networks are permutation-invariant. Absolute or relative positional embeddings are the most popular ways to feed Transformer models with positional information. Absolute positional embeddings are simple to implement, but suffer from generalization issues when evaluating on sequences longer than seen at training time. Relative positions are more robust to input length change, but are more complex to implement and yield inferior model throughput due to extra computational and memory costs. In this paper, we propose an augmentation-based approach (CAPE) for absolute positional embeddings, which keeps the advantages of both absolute (simplicity and speed) and relative positional embeddings (better generalization). In addition, our empirical evaluation on state-of-the-art models in machine translation, image and speech recognition demonstrates that CAPE leads to better generalization performance as well as increased stability with respect to training hyper-parameters.Keywords
All Related Versions
This publication has 12 references indexed in Scilit:
- RoFormer: Enhanced transformer with Rotary Position EmbeddingNeurocomputing, 2023
- Position Information in Transformers: An OverviewComputational Linguistics, 2022
- CvT: Introducing Convolutions to Vision Transformers2021
- LeViT: a Vision Transformer in ConvNet’s Clothing for Faster Inference2021
- Video Transformer Network2021
- Recipes for Building an Open-Domain Chatbot2021
- Randaugment: Practical automated data augmentation with a reduced search space2020
- TED-LIUM 3: Twice as Much Data and Corpus Repartition for Experiments on Speaker Adaptation2018
- Librispeech: An ASR corpus based on public domain audio books2015
- Large vocabulary continuous speech recognition using HTK2002