A Tensorized Transformer for Language Modeling

Xindian Ma, Peng Zhang, Shuai Zhang, Nan Duan, Yuexian Hou +2 more
6/24/2019
cs.CLcs.LG
transformer-attention

Official code: szhangtju/The-compression-of-Transformer (65 stars, Python, last commit 2020-12-16).

Abstract

Latest development of neural models has connected the encoder and decoder through a self-attention mechanism. In particular, Transformer, which is solely based on self-attention, has led to breakthroughs in Natural Language Processing (NLP) tasks.

Show full abstract

However, the multi-head attention mechanism, as a key component of Transformer, limits the effective deployment of the model to a resource-limited setting. In this paper, based on the ideas of tensor decomposition and parameters sharing, we propose a novel self-attention model (namely Multi-linear attention) with Block-Term Tensor Decomposition (BTD). We test and verify the proposed attention method on three language modeling tasks (i.e., PTB, WikiText-103 and One-billion) and a neural machine translation task (i.e., WMT-2016 English-German). Multi-linear attention can not only largely compress the model parameters but also obtain performance improvements, compared with a number of language modeling approaches, such as Transformer, Transformer-XL, and Transformer with tensor train decomposition.

View on arXivView PDF

Code Implementations(1)

6514Python, ShellDec 22, 20185 years ago

Similar Papers

Cite this paper

@article{ma2019tensorized,
  title  = {A Tensorized Transformer for Language Modeling},
  author = {Xindian Ma and Peng Zhang and Shuai Zhang and Nan Duan and Yuexian Hou and Dawei Song and Ming Zhou},
  year   = {2019},
  eprint = {1906.09777},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1906.09777}
}

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

Discussion