AIExplainer
Large Language Models Intermediate 2 min read

What is subword token?

A subunit of a word used in natural language processing to represent words that are not in a vocabulary

In natural language processing, words are often broken down into smaller units called subword tokens. These tokens can be characters, character sequences, or word pieces, and are used to represent words that are not in a predefined vocabulary. This allows models to handle out-of-vocabulary words and improve their ability to understand and generate text.

Think of subword tokens like the individual sounds in a word. Just as the word 'cat' can be broken down into the sounds 'c', 'a', and 't', a subword token breaks down a word into its individual components, allowing models to understand and generate text more effectively.

For example, the word 'unbreakable' can be broken down into subword tokens such as 'un', 'break', and 'able'. This allows a model to understand the meaning of the word even if it has not seen it before.

Subword tokens are used in many natural language processing tasks, such as language modeling, text classification, and machine translation. They are particularly useful when dealing with languages that have many morphological variations, such as Arabic or Russian.

One common misconception is that subword tokens are the same as wordpieces, but while they are related, they are not exactly the same thing. Wordpieces are a specific type of subword token that is used in some natural language processing models.

The concept of subword tokens has been around for several decades, but it has gained more attention in recent years with the development of deep learning models for natural language processing.

wordpiece character sequence morpheme

Three products for different needs — explore what’s relevant to you.