State-of-the-art (SOTA) models for natural language processing (NLP) tasks typically use a combination of techniques to choose which subwords are made tokens in a tokenization scheme. Here are some common methods:
- WordPiece Tokenization: This method, used in models like BERT and RoBERTa, splits words into subwords or word pieces of a fixed length (typically 2-4). For example, the word "untokenized" would be split into "un-to-ken-ized". These subwords are then treated as individual tokens.
- Subword Tokenization: This method, used in models like Word2Vec and GloVe, represents each word as a sequence of subwords, where each subword is a contiguous sequence of characters within the word. For example, the word "untokenized" would be represented as a sequence of 4 subwords: "un", "to", "ken", and "ized".
- Character-level Tokenization: This method, used in models like LSTM and Transformer, represents each word as a sequence of characters. Each character is treated as an individual token, and the sequence of characters represents the word. For example, the word "untokenized" would be represented as a sequence of 10 characters: "u", "n", "t", "o", "k", "e", "n", "i", "z", "e".
- Hybrid Tokenization: Some models use a combination of the above methods. For example, a model might use wordpiece tokenization for the majority of words, but use subword tokenization for words that are not well-represented by wordpieces.
The choice of tokenization scheme depends on the specific task and the desired level of granularity. For example, subword tokenization can be useful for tasks that require a finer-grained representation of words, such as language modeling or text classification. On the other hand, character-level tokenization can be useful for tasks that require a more detailed representation of the sequence of characters, such as machine translation or text generation.
It's worth noting that the choice of tokenization scheme is not the only factor that determines the performance of a model. Other factors, such as the size and quality of the training data, the model architecture, and the choice