Keeping an image-heavy multimodal feature feeling fast despite a slow vision pipeline
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.