Dynamic resolution and any-resolution vision token cost
Fields
flops/dynamic-resolution-and-any-resolution-vision-token-costNotes
DYNAMIC RESOLUTION TOKEN COUNT: The token count for a dynamic resolution model is determined by the image dimensions and the patch/merge configuration. Qwen2-VL: patch_size 14, spatial_merge 2, so tokens = (H/28)*(W/28). A 448x448 image = 16*16 = 256 tokens. A 3840x2160 image = 137*77 = 10,549 tokens. Pixtral: patch_size 16, no merge, so tokens = (H/16)*(W/16). A 1024x1024 image = 64*64 = 4096 tokens. A 4096x4096 image = 256*256 = 65,536 tokens. LLaVA-NeXT/AnyRes: uses a grid of predefined resolutions (384, 768, 1152, 1536, 1920, 2304) and splits the image into a global view + local crops. The token count depends on the number of tiles selected. The key insight is that dynamic resolution makes the token count a function of the input image, not a model constant, which makes serving cost unpredictable and attacker-controlled. The token counts are derived from the model configs; the formulas are standard.