How Do You 'Tokenize' a Photograph? Inside Multimodal AI
Text splits into words. Images split into patches or learned visual codes. Audio splits into neural codec frames — same goal, different mechanisms.
On this page
Text tokenization gets a head start most people don’t notice: language already arrives in roughly discrete chunks — words, morphemes, punctuation — so a tokenizer’s job is mostly identifying boundaries that already exist. An image has no such boundaries. A 224×224 photograph is 50,176 continuous pixel values with no inherent “word” anywhere in it. Turning that into something a transformer can process the same way it processes text requires inventing structure that isn’t naturally there — and the three dominant ways of doing that trade off fidelity, compression, and semantic meaning very differently.
Images: three genuinely different ways to invent structure
The trade-off across all three comes down to one recurring tension: patch size and vocabulary size directly set both computational cost and information loss. Smaller patches or larger codebooks preserve more detail; larger patches or smaller codebooks compress harder — and because transformer attention cost scales quadratically with token count, “just use smaller patches for more detail” isn’t free.
Patch embeddings compute their vectors on the fly, with no separate training step for the “vocabulary” itself — the projection matrix is just part of the model. Vector quantization requires pre-training the codebook itself as a separate step, effectively building a visual dictionary before the main model ever sees a token. That’s a real added cost patch embeddings don’t carry, in exchange for genuinely discrete tokens.
Audio: no natural grid, so codecs build one
Audio has neither text’s natural symbolic units nor images’ natural 2D grid — it’s a continuous 1D signal, sampled tens of thousands of times per second. Tokenizing it means compressing that firehose into a much lower-rate discrete sequence without losing what actually matters.
- Neural codec tokens (EnCodec, SoundStream)
Audio is split into overlapping short windows (10-25ms), an encoder compresses each into a feature vector, and vector quantization maps it to the nearest of roughly 1,024-4,096 learned codes — often across multiple quantization layers for hierarchical detail. Output rate: ~50-75 tokens per second, versus a raw sample rate in the tens of thousands. Preserves pitch, timbre, and speaker identity — the acoustic properties, not just the words.
- ASR-based tokens (phonemes, characters, words)
Run audio through speech recognition (Whisper, Wav2Vec2) and keep only the linguistic content — phonemes, characters, or subwords. Extremely compact and directly compatible with text-based language models, but throws away everything that isn’t literal linguistic content: prosody, emotion, speaker identity, any non-speech sound.
- Multi-scale hierarchical tokens
Combine a coarse token stream (global structure, low temporal resolution, ~12.5Hz) with a fine token stream (acoustic detail, higher resolution, ~50Hz) — the audio equivalent of a low-res-plus-detail image pyramid. Balances efficiency and quality better than either extreme alone, at the cost of a more complex model architecture.
The choice here is stark and worth stating plainly: codec tokens preserve how something sounded; ASR tokens preserve only what was said. A voice assistant transcribing commands wants ASR tokens — compact, semantic, done. A music generation model needs codec tokens — nothing about “the words” if there aren’t any, and the acoustic texture is the entire point.
Video: mostly a solved problem by borrowing from images
Video tokenization today mostly avoids inventing a fourth wholly new mechanism — the dominant approach treats video as a sampled sequence of image frames (each tokenized via the image methods above), often interleaved with audio tokens and any accompanying text. It’s less an independent tokenization breakthrough and more a direct application of “we already solved images; sample enough frames and reuse that.”
Where this is heading: tokenization as an optional step, not a given
Two active research directions are worth knowing, because they reframe tokenization itself as a design choice rather than a mandatory first step:
Do
Watch tokenization-free research (models operating directly on raw bytes or Unicode code points) if universal, vocabulary-free handling of arbitrary languages and symbols matters more to your use case than training efficiency.
Don't
Expect tokenization-free approaches to be a drop-in replacement today — they’re substantially more computationally expensive to train than a model working over a pre-compressed, pre-tokenized representation, which is exactly the cost tokenization exists to avoid in the first place.
Adaptive tokenization is the other direction: instead of a fixed vocabulary, dynamically decide the token split per input — collapsing common phrases into single tokens while breaking down rare or complex terms into smaller units, chasing a better efficiency-versus-semantic-clarity balance than a fixed vocabulary can offer.
Takeaway
Every modality’s tokenization scheme is solving the same underlying problem — convert something continuous into a discrete sequence a transformer can process — but the mechanism for doing that has to match the actual shape of the data. Text gets subword merging because language is already semi-discrete. Images get patch grids or learned visual codebooks because pixels aren’t. Audio gets neural codecs or speech recognition because a waveform is neither symbolic nor a fixed grid — it’s a stream that has to be compressed into something token-shaped before a language model can touch it at all. None of these are arbitrary engineering choices; each one is the tokenization strategy that fits the specific kind of continuity it’s trying to discretize.
Frequently asked questions
How does an image get turned into tokens if there are no natural word-like boundaries?
The dominant approach (patch embeddings, used by Vision Transformers) simply imposes boundaries: the image is sliced into a fixed grid of non-overlapping squares — commonly 16x16 pixels — and each square is flattened and projected into a vector, treated exactly like a word token. A 224x224 image split into 16x16 patches yields 196 tokens, regardless of what's actually depicted in each square.
What's the difference between patch embeddings and vector quantization for images?
Patch embeddings preserve every pixel's information by projecting each patch into a continuous vector — nothing is thrown away, but the representation isn't truly discrete. Vector quantization goes further: it compresses the image, then matches each compressed region to the closest entry in a learned 'visual vocabulary' of a few thousand patterns, producing genuinely discrete tokens (like text tokens) at the cost of some reconstruction fidelity.
Why can't audio just use the same patch-based approach as images?
Audio is fundamentally a 1D temporal signal sampled at very high rates (commonly 16,000-44,100 samples per second), not a fixed 2D grid — there's no natural equivalent to an image patch. Audio tokenization instead relies on neural codecs that compress overlapping time windows through vector quantization, producing tokens at a much lower rate (roughly 50-75 per second) than the raw sample rate, while preserving acoustic qualities a naive downsampling would destroy.
Why would you choose ASR-based audio tokens over neural codec tokens?
ASR-based tokens (converting speech to phonemes or text) discard everything except linguistic content — no pitch, no speaker identity, no emotional tone — which makes them extremely compact and directly compatible with text-based language models. Neural codec tokens preserve those acoustic properties at the cost of more tokens per second of audio. The choice depends on whether the downstream task needs to know what was said, or needs to reproduce how it sounded.
Is there a future where AI models skip tokenization entirely?
That's an active research direction — tokenization-free models that operate directly on raw bytes or Unicode code points, avoiding the need for any predefined vocabulary and letting a model natively handle any language or symbol without subword heuristics. The trade-off is real: training such models is substantially more computationally intensive than training on a pre-tokenized, compressed representation.



/* Comments */
Comments are offline right now — we reconnect automatically, nothing is lost.