Byte Pair Encoding is Suboptimal for Language Model Pretraining

29640

Authors

nan

Abstract

AbstractThe success of pretrained transformer language models (LMs) in natural language processing has led to a wide range of pretraining setups. In particular, these models employ a variety of subword tokenization methods, most notably byte-pair encoding (BPE) (Sennrich et al., 2016; Gage, 1994), the WordPiece method (Schuster and Nakajima, 2012), and unigram language modeling (Kudo, 2018), to segment text. However, to the best of our knowledge, the literature does not contain a direct evaluation of the impact of tokenization on language model pretraining. We analyze differences between BPE and unigram LM tokenization, finding that the latter method recovers subword units that align more closely with morphology and avoids problems stemming from BPE’s greedy construction procedure. We then compare the fine-tuned task performance of identical transformer masked language models pretrained with these tokenizations. Across downstream tasks and two languages (English and Japanese), we find that the unigram LM tokenization method matches or outperforms BPE. We hope that developers of future pretrained LMs will consider adopting the unigram LM method over the more prevalent BPE.

Keywords

nan

Full Content

Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4617–4624 November 16 - 20, 2020. c⃝2020 Association for Computational Linguistics 4617 Byte Pair Encoding is Suboptimal for Language Model Pretraining Kaj Bostrom and Greg Durrett Department of Computer Science The University of Texas at Austin {kaj,gdurrett}@cs.utexas.edu Abstract The success of pretrained transformer lan- guage models (LMs) in natural language processing has led to a wide range of pretraining setups. In particular, these models employ a variety of subword tokenization methods, most notably byte-pair encoding (BPE) (Sennrich et al., 2016; Gage, 1994), the WordPiece method (Schuster and Nakajima, 2012), and unigram language modeling (Kudo, 2018), to segment text. However, to the best of our knowledge, the literature does not contain a direct evaluation of the impact of tokenization on language model pretraining. We analyze differences between BPE and un- igram LM tokenization, finding that the latter method recovers subword units that align more closely with morphology and avoids problems stemming from BPE’s greedy construction procedure. We then compare the fine-tuned task performance of identical transformer masked language models pretrained with these tokenizations. Across downstream tasks and two languages (English and Japanese), we find that the unigram LM tokenization method matches or outperforms BPE. We hope that developers of future pretrained LMs will consider adopting the unigram LM method over the more prevalent BPE. 1 Introduction Large transformers (Vaswani et al., 2017) pre- trained with variants of a language modeling ob- jective, such as BERT (Devlin et al., 2019), have proven their effectiveness at flexibly transferring to a variety of domains and tasks. One design deci- sion that makes them particularly adaptable is their graceful handling of the open vocabulary problem through subword tokenization. Subword tokeniza- tion, popularized in the neural machine translation literature (Sennrich et al., 2016; Vaswani et al., 2017; Wu et al., 2016), produces tokens at multiple levels of granularity, from individual characters to full words. As a result, rare words are broken down into a collection of subword units, bottoming out in characters in the worst case. Critically, a pretrained language model’s sub- word vocabulary cannot be altered: any down- stream application of these models must tokenize input or generate output using the original subword vocabulary, making the choice of tokenization a particularly significant decision. A variety of subword tokenization methods have seen use in pretrained language models. BERT uses the WordPiece method (Schuster and Naka- jima, 2012), a language-modeling based variant of BPE; T5 (Raffel et al., 2019) uses character-level BPE; GPT2 (Radford et al., 2019) and ROBERTA (Liu et al., 2019) use BPE over raw bytes instead of unicode characters; XLNET (Yang et al., 2019) and ALBERT (Lan et al., 2019) use the Sentence- Piece library (Kudo and Richardson, 2018) which implements both BPE and unigram language model tokenization, but in both cases fail to clarify which of these methods they chose. The effects of tok- enization are not examined in a reported experi- ment in any of the above works except Liu et al. …

Content truncated to 500 words

Labeled Text

AbstractThe success of pretrained transformer language models (LMs) in natural language processing has led to a wide range of pretraining setups. In particular, these models employ a variety of subword tokenization methods, most notably byte-pair encoding (BPE) (Sennrich et al., 2016; Gage, 1994), the WordPiece method (Schuster and Nakajima, 2012), and unigram language modeling (Kudo, 2018), to segment text. However, to the best of our knowledge, the literature does not contain a direct evaluation of the impact of tokenization on language model pretraining. We analyze differences between BPE and unigram LM tokenization, finding that the latter method recovers subword units that align more closely with morphology and avoids problems stemming from BPE’s greedy construction procedure. We then compare the fine-tuned task performance of identical transformer masked language models pretrained with these tokenizations. Across downstream tasks and two languages (English and Japanese), we find that the unigram LM tokenization method matches or outperforms BPE. We hope that developers of future pretrained LMs will consider adopting the unigram LM method over the more prevalent BPE.

Publication Details

Paper ID:
29640
Year:
2020
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan