Grammar decides what goes with what
Syntax is how words combine into structures: which adjective belongs to which noun, what a phrase attaches to, what a verb's subject is. Humans resolve this without thinking. Image models are mixed: research has shown that many vision-language encoders behave partly like 'bags of words', sensitive to which words appear but weak on how they are ordered and connected.
Newer models built on large language models read syntax much better, which is why sentences now often beat keyword lists. But ambiguity remains: a phrase that can be parsed two ways may be drawn either way, or both at once. Writing for a model is partly writing unambiguous grammar.
Word order
Many models give more weight to the start of a prompt; put the subject and essential look first.
'Old wooden red door' and 'red door, old and wooden' can bind differently; keep modifiers right before their noun.
Comma-separated tags lose relations; short sentences keep who does what to whom.
Each clause carries one relation: what, where, how lit.
Ambiguity
'A man watching a woman with binoculars': who has the binoculars? Rewrite so only one reading exists.
'Old men and women': are the women old too? Repeat the modifier or split the phrase.
Research found models sometimes draw both senses of a word: 'a bat' as an animal and a baseball bat.
'Glass bowl', 'bowl of glass', 'glass of water': the head noun decides the object.
Who does what
'A cat chasing a dog' and 'a dog chasing a cat' are often confused; make the roles visually explicit.
'A child carried by her father' is harder than 'a father carrying his child on his shoulders'.
'The woman who is holding the lamp that lights the room' is long; break it into two sentences.
'She', 'it' and 'they' rarely resolve; repeat the noun.
Writing style that helps
Two or three short sentences beat one long chain of clauses.
Verbs fix relations: leaning on, hanging from, pouring into.
Use the same word for the same thing; synonyms may become two objects.
If a person could misread it, a model will.
The words to describe it
Precise words for the qualities above. Combine a few of them instead of naming the style or artist alone.
- word order
- modifier attachment
- attachment ambiguity
- coordination ambiguity
- homonym
- head noun
- subject and object roles
- short declarative sentences
- consistent terminology
- bag-of-words behaviour
Instead of 'woman, red dress, dog, park, running, sunset': 'A woman in a red dress runs across a park at sunset. A small black dog runs beside her, ears flying.'
How to put it into words
- Put the subject and its key trait first.
- Keep each modifier directly before its noun.
- Rewrite any phrase that can be read two ways.
Where we usually get it wrong
Treating a prompt as a bag of keywords and expecting the model to work out the relations. 'Woman, red dress, dog, park, running' leaves open who runs, who wears red and where the dog is. One sentence answers all of it.
Write an ambiguous prompt on purpose: 'a girl painting a portrait of her mother in a garden with a hat'. Generate it and note which reading the model chose. Then rewrite it in two unambiguous short sentences and compare.
Sources and further reading
- Yuksekgonul et al., 'When and Why Vision-Language Models Behave like Bags-of-Words, and What to Do About It?' (ICLR 2023).
- Rassin et al., 'DALLE-2 is Seeing Double: Flaws in Word-to-Concept Mapping in Text2Image Models' (2022).