Zenaique

Where should an image be placed relative to the text that asks about it, and why does this matter for multimodal models?

Flashcard·Medium·4.0 · 0·~30s·Asked atFlipkartTuringWhylabs
Attempt it
TL;DR

Put the image immediately before the text that asks about it; co-locating image and question removes reference ambiguity in multi-image prompts and aligns with the recency the model uses for both vision and text tokens.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine showing a friend a photo and asking 'what do you see?' If you show the photo, then ask, the connection is obvious. If you ask first and pull out the photo later, your friend has to remember the question while looking at the picture. Now imagine showing three different photos and asking three different questions in a jumbled order, your friend will get confused about which question goes with which photo. The trick is to pair each photo with its question right next to each other. Models work the same way.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Image placement is one of those small context-engineering decisions that has measurable quality consequences and that engineers often get wrong by defaulting to the visually clean pattern of stacking images at the top and questions at the bottom. The right rule is the opposite: each image goes immediately before the text that asks about it, and the pair stays adjacent. The rule is universal across 2026 multimodal providers and has two distinct rationales, positional attention bias and reference resolution, that compound when prompts have multiple images. This deep dive walks through the two rationales, the failure mode of clustered layouts, the cross-provider tokenization notes, and the extension to video and audio.

Positional attention bias for vision tokens

The lost-in-the-middle finding (Liu et al. 2023) showed that text content positioned in the middle of a long context is recalled less reliably than the same content at the ends. The U-shaped recall curve has been re-validated repeatedly in subsequent work, and 2024-2025 multimodal studies have confirmed that the effect extends to vision tokens.

An image placed at the start of a long mixed-modal prompt with the question at the end forces the model to attend back across a wall of text to ground its answer. Frontier models in 2026 are better at this than 2023 vision-language models, but the bias has not vanished. The dip is shallower; the principle is the same.

The practical consequence is that the recency of the image at the moment the question is read affects answer quality. Placing the image immediately before the question puts the vision tokens at maximum salience for the attention pattern that will produce the answer. Placing the image far away forces the model to do more work to maintain that grounding.

This is the first-order reason for the placement rule. It applies even to single-image prompts, although the effect is small when prompts are short and the question is unambiguous about which image it refers to.

Reference resolution in multi-image prompts
Provider-specific tokenization in 2026
Extension to video and audio
Practical engineering checklist
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Anthropic's Claude SDK pattern interleaves image and text content blocks for multi-image prompts in production
  • OpenAI's GPT-5.5 documentation recommends image then question pairing for multi-image visual QA
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow would you arrange a prompt that has 20 images and one summarizing question across all of them?
A

Co-locate each image with a brief per-image question or label that grounds it: 'image_1: what is shown? image_2: what is shown?' and so on. Then place the cross-image summarizing question after all the pairs. This forces the model to ground each image individually before reasoning across them. A pure stack of 20 images followed by 'summarize' typically conflates content from images that look similar.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Putting all images at the top of the prompt and then asking multiple questions about them in a later block, leaving the model to guess which question maps to which image.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • State the rule: image immediately before the question that references it

  • Explain the recency rationale (positional attention bias applies to vision tokens too)

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Pick the most effective intervention when an agent's context grows by 8KB every iteration
MCQ·Medium