Should you marginalize over possible tokenizations?
Preprint
Abstract
Autoregressive language models (LMs) map token sequences to probabilities. The usual practice for computing the probability of any character string (e.g. English sentences) is to first transform it into a sequence of tokens that is scored by the model. However, there are exponentially many token sequences that represent any given string. To truly compute the probability of a string one should marginalize over all tokenizations, which is typically intractable. Here, we analyze whether the practice of ignoring the marginalization is justified. To this end, we devise an importance-sampling-based algorithm that allows us to compute estimates of the marginal probabilities and compare them to the default procedure in a range of state-of-the-art models and datasets. Our results show that the gap in log-likelihood is no larger than 0.5% in most cases, but that it becomes more pronounced for data with long complex words.Keywords
All Related Versions
This publication has 8 references indexed in Scilit:
- You should evaluate your language model on marginal likelihood over tokenisations2021
- Transformers: State-of-the-Art Natural Language Processing2020
- BPE-Dropout: Simple and Effective Subword Regularization2020
- Dynamic Programming Encoding for Subword Segmentation in Neural Machine Translation2020
- Training Hybrid Language Models by Marginalizing over Segmentations2019
- Neural Lattice Language ModelsTransactions of the Association for Computational Linguistics, 2018
- Subword Regularization: Improving Neural Network Translation Models with Multiple Subword Candidates2018
- Neural Network Methods for Natural Language ProcessingSynthesis Lectures on Human Language Technologies, 2017