Charformer: Fast Character Transformers via Gradient-based Subword Tokenization
Preprint
Abstract
State-of-the-art models in natural language processing rely on separate rigid subword tokenization algorithms, which limit their generalization ability and adaptation to new settings. In this paper, we propose a new model inductive bias that learns a subword tokenization end-to-end as part of the model. To this end, we introduce a soft gradient-based subword tokenization module (GBST) that automatically learns latent subword representations from characters in a data-driven fashion. Concretely, GBST enumerates candidate subword blocks and learns to score them in a position-wise fashion using a block scoring network. We additionally introduce Charformer, a deep Transformer model that integrates GBST and operates on the byte level. Via extensive experiments on English GLUE, multilingual, and noisy text datasets, we show that Charformer outperforms a series of competitive byte-level baselines while generally performing on par and sometimes outperforming subword-based models. Additionally, Charformer is fast, improving the speed of both vanilla byte-level and subword-level Transformers by 28%-100% while maintaining competitive quality. We believe this work paves the way for highly performant token-free models that are trained completely end-to-end.Keywords
All Related Versions
This publication has 25 references indexed in Scilit:
- ByT5: Towards a Token-Free Future with Pre-trained Byte-to-Byte ModelsTransactions of the Association for Computational Linguistics, 2022
- Canine: Pre-training an Efficient Tokenization-Free Encoder for Language RepresentationTransactions of the Association for Computational Linguistics, 2022
- Unsupervised Cross-lingual Representation Learning at Scale2020
- BPE-Dropout: Simple and Effective Subword Regularization2020
- Dynamic Programming Encoding for Subword Segmentation in Neural Machine Translation2020
- Nuanced Metrics for Measuring Unintended Bias with Real Data for Text Classification2019
- Fully Character-Level Neural Machine Translation without Explicit SegmentationTransactions of the Association for Computational Linguistics, 2017
- Ex Machina2017
- Are Vowels and Consonants Processed Differently? Event-related Potential Evidence with a Delayed Letter ParadigmJournal of Cognitive Neuroscience, 2008
- The Relative Contribution of Consonants and Vowels to Word Identification during ReadingJournal of Memory and Language, 2001