Multimodal Models·Question 3 of 67Basic

How do images become tokens, and why does image resolution drive inference cost?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

The vision encoder emits one embedding per patch, and each of those occupies a sequence position in the LLM exactly like a text token - so token count scales with (resolution ÷ patch size)². More pixels means more patches means more tokens, and you pay for tokens in dollars, latency, and context budget.

Full worked answer with diagram

The vision encoder emits one embedding per patch, and each of those occupies a sequence position in the LLM exactly like a text token - so token count scales with (resolution ÷ patch size)². More pixels means more patches means more tokens, and you pay for tokens in dollars, latency, and context budget.

Concrete provider math (the schemes change with model generations, so check the current docs before you quote a bill): OpenAI's GPT-4o-class high-detail mode resizes the image and cuts it into 512×512 tiles at ~170 tokens per tile plus 85 base tokens (newer models count small patches, same area-scaling principle); Anthropic counts ceil(width / 28) × ceil(height / 28) visual tokens, and Claude 4.7 and later (the whole current lineup) accept up to 2,576 px on the long edge and 4,784 tokens, against 1,568 px and 1,568 tokens on older models such as Sonnet 4.6 and Haiku 4.5, so the same 1920×1080 screenshot now costs about 2,700 tokens rather than about 1,560; Gemini 2.x charged ~258 tokens per small image or per 768×768 tile, while Gemini 3 replaced the tiling arithmetic with a media_resolution setting that fixes a per-image budget, roughly 280 to 2,240 tokens from low to ultra-high. Order of magnitude to keep in your head: a readable document page downsampled to a modest resolution is ~1-2k tokens, but a dense page sent at a high-resolution tier can cost several thousand, so a 100-page PDF sent as images is 150k to several hundred thousand tokens per request depending on the resolution you choose - a real cost that may not even fit the context window. State the resolution whenever you quote a per-page figure.

This is why tiling / dynamic resolution schemes exist (LLaVA-NeXT's AnyRes, Qwen-VL's dynamic resolution): the model gets a downscaled global view plus native-resolution crops, spending tokens proportional to image size instead of a fixed budget. It's also why resolution is the first knob in any quality-vs-cost tradeoff: OCR accuracy on small text collapses below a legibility threshold, but pixels beyond the encoder's effective resolution buy nothing. A good answer connects this to prefill compute too - image tokens dominate prefill for vision-heavy workloads, which is where prompt caching of repeated images earns its keep.

Worth sketching. It puts the cost driver where it belongs, on tile count rather than on some vague notion of image complexity.

flowchart TD
    A["Source page image"] --> B["Downscaled global view<br/>1 tile"]
    A --> C["Native-resolution crops<br/>k tiles"]
    B --> D["Visual tokens<br/>~170 per tile plus base"]
    C --> D
    D --> E["Prefill compute and context<br/>grow linearly with k"]

What a good answer covers

  • The vision encoder emits one embedding per patch, and each of those occupies a sequence position in the…
  • More pixels means more patches means more tokens, and you pay for tokens in dollars, latency, and…
  • Concrete provider math (the schemes change with model generations, so check the current docs before you…
  • Order of magnitude to keep in your head
  • State the resolution whenever you quote a per-page figure

Key terms: tiling / dynamic resolution

Interviewer follow-ups to expect

  1. You're processing receipts and the model misreads totals - walk me through how you'd decide whether to raise resolution or change approach. Why does a resampler-based model (fixed 64 tokens per image) struggle with dense documents?

  2. How would you estimate the monthly bill for a screenshot-heavy agent?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep