In plain English
Tokenization is like putting a sentence through a specialized paper shredder that cuts text into standardized chunks or syllables. Algorithms like Byte-Pair Encoding ensure that common words stay whole while rare words break down into manageable pieces.
Real-world example
Converting user prompt strings into integer arrays before passing them to an LLM inference engine.
Technical definition
Tokenization is the preprocessing algorithm that segments raw character strings into discrete token sequences using statistical vocabulary dictionaries. Modern tokenizers, such as Byte-Pair Encoding (BPE) or WordPiece, balance vocabulary size with compression efficiency to handle out-of-vocabulary words. This step directly dictates the numerical mapping required for neural network embedding layers.