How AI Reads: Tokenization

Yuvraj SinghYuvraj Singh
2 min read

Hey! 👋 Ever wonder how a machine like ChatGPT actually reads what you type? It doesn't see sentences or paragraphs like we do. Instead, it first breaks everything down into smaller pieces. This process is called Tokenization.

Think of it like this: You're given a long sentence in a language you don't know. What's the first thing you do? You probably look at it word by word, or even symbol by symbol, to start making sense of it.

That's what tokenization is. It's the first step in any Natural Language Processing (NLP) task. It takes a piece of text and chops it up into smaller units called tokens.

For example, take this sentence: "AI is super cool!"

A simple tokenizer would break it down into: ["AI", "is", "super", "cool", "!"]

Each item in this list is a token. It can be a word, a number, or even a punctuation mark.

Why is this important?

Because computers can't understand "AI is super cool!" as a whole. But they can understand the individual tokens. After breaking the sentence into tokens, the AI can then convert each token into numbers (using something called embeddings!) to analyze its meaning, grammar, and context.

So, tokenization is basically the act of creating a "word list" for the AI to work with. It’s the foundational step that makes it possible for machines to process and "understand" human language. Simple, right?

0
Subscribe to my newsletter

Read articles from Yuvraj Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yuvraj Singh
Yuvraj Singh