Keeping an image-heavy multimodal feature feeling fast despite a slow vision pipeline
A product lets users snap a photo and ask a question about it, but the round trip feels sluggish because of image upload, encoding, and a large vision-token prefill. Describe how you would keep the experience acceptable without simply maxing out the image pipeline.
Cut real latency by matching resolution and image-token budget to the task, then mask the rest with streaming, an explicit processing state, a fast first-pass result, and cached image tokens.
Imagine ordering a coffee. The barista can't make it instantly, but the wait feels fine because you see them grinding, pouring, and steaming — there's progress the whole time. Now imagine they vanish into a back room and reappear five minutes later with the cup. Same wait, but it felt awful because nothing was happening in front of you. A photo question feature is the same. Some of the wait is unavoidable: uploading the picture and having the model read it takes time. So you do two things. First, don't send a giant 4K photo when a small one would answer a question about a receipt — that's like grinding way more beans than the cup needs. Second, show the user every step and stream the answer word by word, so the wait feels like a barista working, not a frozen screen.
Detailed answer & concept explanation~6 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.
Open by decomposing the round trip into upload, encode, and prefill, and identify the vision-token prefill as the dominant, cuttable cost that scales with resolution and tiling. Make the case for a task-matched resolution budget over always sending max resolution. Then pivot to perceived latency: streaming the answer, an explicit per-stage progress indicator, and a fast first-pass result that refines on demand. Close with the multi-turn efficiency win of caching encoded image tokens, and the throughline — spend tokens where accuracy needs them, make the rest feel responsive.
Real products, models, and research that use this idea.
- GPT-5.5 and Gemini 3.1 Pro bill image inputs by tiles, so a high-resolution photo costs many times the tokens of a thumbnail — the same lever that drives prefill latency
- Claude Opus 4.7 and other VLMs stream the text answer token by token, which is what makes a multi-second prefill feel responsive
- Receipt and document scanning apps downscale before sending because a small image reads the totals fine and slashes the prefill
- Multi-turn image chat (ask several questions about one uploaded photo) benefits from caching the encoded image so only the new prompt is processed
- Computer-use agents reading a screen cap resolution to keep per-step prefill low, since they take many steps over the same kind of image
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you decide the resolution budget per request automatically instead of one global setting?
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.
Always sending the highest-resolution image to be safe, which blows up the vision-token prefill and latency for tasks that a small, cheap image would have answered just fine.
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.