Segatron: Segment-Aware Transformer for Language Modeling and Understanding

He Bai, Peng Shi, Jimmy Lin, Yuqing Xie, Luchen Tan +3 more
4/30/2020
cs.CLcs.LG
transformer-attention

Official code: rsvp-ai/segatron_aaai (18 stars, Python, last commit 2022-10-25).

Abstract

Transformers are powerful for sequence modeling. Nearly all state-of-the-art language models and pre-trained language models are based on the Transformer architecture.

Show full abstract

However, it distinguishes sequential tokens only with the token position index. We hypothesize that better contextual representations can be generated from the Transformer with richer positional information. To verify this, we propose a segment-aware Transformer (Segatron), by replacing the original token position encoding with a combined position encoding of paragraph, sentence, and token. We first introduce the segment-aware mechanism to Transformer-XL, which is a popular Transformer-based language model with memory extension and relative position encoding. We find that our method can further improve the Transformer-XL base model and large model, achieving 17.1 perplexity on the WikiText-103 dataset. We further investigate the pre-training masked language modeling task with Segatron. Experimental results show that BERT pre-trained with Segatron (SegaBERT) can outperform BERT with vanilla Transformer on various NLP tasks, and outperforms RoBERTa on zero-shot sentence representation learning.

View on arXivView PDF

Code Implementations(1)

codes and pre-trained models of paper "Segatron: Segment-aware Transformer for Language Modeling and Understanding"

184Python, ShellDec 11, 20204 years ago

Similar Papers

Cite this paper

@article{bai2020segatron,
  title  = {Segatron: Segment-Aware Transformer for Language Modeling and Understanding},
  author = {He Bai and Peng Shi and Jimmy Lin and Yuqing Xie and Luchen Tan and Kun Xiong and Wen Gao and Ming Li},
  year   = {2020},
  eprint = {2004.14996},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.14996}
}

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

Discussion