How does an image become a sequence of tokens an LLM can attend over?
Walk through what happens to an input image before a language model can reason over it. What are the stages, and why does the LLM end up treating the image as extra tokens rather than pixels?
An image is patchified, encoded by a ViT, then projected into the LLM's embedding space, so the language model attends over visual feature vectors as extra tokens and never touches raw pixels.
Imagine a translator who only understands a specific alphabet. You hand them a photo, but they cannot read pictures. So a helper chops the photo into small tiles, studies all the tiles together to figure out what is going on, and rewrites each tile as a word in the translator's exact alphabet. Now the translator gets a stack that mixes those picture-words with the real text-words, all in one alphabet, and reads straight through. The translator never sees the original photo. They only see the rewritten words. That is why the model thinks of the image as just more words in its sequence, rather than as colors and shapes it has to look at directly.
Detailed answer & concept explanation~7 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
State the three transformations, explain that the LLM's single interface is a sequence of embedding vectors, and close on why tokens, not pixels, buys free cross-modal attention at the cost of a fixed visual token budget.
Real products, models, and research that use this idea.
- LLaVA is the textbook open-source example: CLIP ViT encoder, small MLP projection, then the language model attends over the projected tokens.
- GPT-5.5 and Gemini 3.1 Pro are natively multimodal but still convert images into tokens the language stack attends over jointly with text.
- Qwen3-VL turns images into visual tokens via a ViT encoder and projection, adding dynamic resolution so detailed images yield more tokens.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does treating images as tokens make cross-modal reasoning almost free for the LLM?
QWhat does the fixed token budget for an image cost in practice?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Saying the LLM looks at the image directly. It only ever sees projected feature vectors in its own embedding space, sitting in the sequence like extra word tokens.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.