Images are 2D and video is 3D, but an LLM's positional encoding is 1D. What breaks if you just flatten the patches, and how do modern VLMs handle it?
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
Flattening works, and early VLMs did exactly that: raster-scan the patch grid into a sequence and let the LLM's normal 1D RoPE handle it. But you are asking the model to rediscover 2D structure from raster order, and three things go wrong.
Full worked answer
Flattening works, and early VLMs did exactly that: raster-scan the patch grid into a sequence and let the LLM's normal 1D RoPE handle it. But you are asking the model to rediscover 2D structure from raster order, and three things go wrong.
First, vertical adjacency is invisible. Two patches directly above and below each other are W positions apart in the flattened index, so RoPE's distance decay treats them as far away, while horizontally adjacent patches are neighbours. The geometry is anisotropic for no good reason.
Second, position indices explode. A high-resolution page can be thousands of patches, and every one consumes 1D positions that then push your text out toward the model's trained length.
Third, and worst for native-resolution models: the same spatial offset maps to a different position delta at a different resolution, because W changed. Nothing transfers across image sizes, which is precisely what dynamic resolution needs.
The modern answer is a multimodal rotary embedding. Qwen2-VL's M-RoPE splits the rotary dimensions into three groups encoding temporal, height, and width. An image patch gets a constant t plus its own (row, column). A text token gets the same index in all three components, which collapses exactly back to standard 1D RoPE, so text behaviour is untouched and you can graft this onto a pretrained LLM. Video increments t per frame. Qwen2.5-VL ties the temporal component to absolute time rather than frame index, so the model can reason in seconds regardless of the sampling fps you chose. Qwen3-VL refined both ideas: interleaved M-RoPE spreads t, h and w across the low- and high-frequency rotary bands instead of giving each axis its own contiguous block, and video timing moved to explicit text timestamp tokens placed between frame groups.
Benefits: spatial adjacency is native, (h, w) mean the same thing at any resolution, and position ids grow with the max over components rather than the product, which materially helps many-image contexts.
Cheaper alternatives worth knowing: 2D position embeddings inside the ViT, interpolated for new resolutions, which is what fixed-resolution ViTs did and it degrades off-distribution. Or Fuyu-style explicit newline tokens at row boundaries, letting the LLM infer the grid from the token stream. Crude, and surprisingly effective.
What a good answer covers
- Flattening works, and early VLMs did exactly that
- But you are asking the model to rediscover 2D structure from raster order, and three things go wrong
- First, vertical adjacency is invisible
- Two patches directly above and below each other are W positions apart in the flattened index, so RoPE's…
- The geometry is anisotropic for no good reason
Interviewer follow-ups to expect
Why does giving text tokens identical t, h, w indices matter for grafting M-RoPE onto an already-trained LLM?
How would you extend this scheme to a document with 50 pages where page identity matters?
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