The meaning of the whole
The principle of compositionality, associated with the philosopher Gottlob Frege, says that the meaning of a sentence comes from the meanings of its parts and the way they are combined. 'The dog bites the man' and 'the man bites the dog' use the same words and mean opposite things. Humans handle this effortlessly.
Text-to-image models often don't. They are good at knowing which things belong in a picture and weaker at how those things relate: which colour belongs to which object, how many there are, what is left of what. Benchmarks such as Winoground and T2I-CompBench were built to measure exactly this, and while newer models with stronger language encoders do better, composition remains one of the clearest gaps between reading words and understanding a sentence.
Where composition fails
'A red cube and a blue sphere' gives a blue cube, two red objects, or purple everywhere.
'Seven candles' gives five or nine; exact numbers above three or four are unreliable.
Left and right, behind and in front, on and under are often swapped or ignored.
With several subjects, one may simply disappear; the model attends to some words more than others.
Why it happens
Some text encoders behave as if word order barely matters, keeping which words appear but losing how they connect.
People rarely caption images with exact counts or positions, so models saw little training signal for them.
A colour word can attend to several image regions at once and spread across objects.
An unusual pairing, a green banana-shaped lamp, has few examples, so the model drifts back to typical ones.
How to write around it
'A red ceramic cube beside a blue glass sphere', never scattered adjectives.
Describe the layout in short clauses: 'On the left, a red cube. On the right, a blue sphere.'
Prefer 'three' to 'seven', or describe a shape: 'a row of candles along the shelf'.
Move a missing object earlier, give it more description, or generate it separately.
When words aren't enough
Sketches, bounding boxes, depth maps or pose guides fix composition directly.
Some tools let you prompt each area of the image separately.
Fix one object's colour or position in place instead of regenerating everything.
Models built on large language models handle relations better; test the same prompt across tools.
The words to describe it
Precise words for the qualities above. Combine a few of them instead of naming the style or artist alone.
- principle of compositionality
- attribute binding
- attribute leakage
- spatial relation
- counting error
- object neglect
- bag-of-words encoder
- word order sensitivity
- regional prompting
- layout control
Instead of 'red blue cube sphere on table': 'On a white table: on the left, a small red ceramic cube; on the right, a larger blue glass sphere. Nothing else on the table.'
How to put it into words
- Attach every attribute directly to its noun.
- State positions in short, separate clauses.
- Keep counts small or describe an arrangement instead.
Where we usually get it wrong
Assuming the model 'didn't listen' when it swaps colours or loses an object. It read every word; what it failed at was the grammar connecting them. Rewriting the sentence structure helps more than repeating the word.
Write 'a yellow umbrella to the left of a green bicycle, three pigeons on the ground'. Generate it four times and note every binding, position and counting error. Then rewrite it with attached attributes and short clauses, and compare.
Sources and further reading
- Thrush et al., 'Winoground: Probing Vision and Language Models for Visio-Linguistic Compositionality' (CVPR 2022).
- Huang et al., 'T2I-CompBench: A Comprehensive Benchmark for Open-world Compositional Text-to-image Generation' (NeurIPS 2023).
- Chefer et al., 'Attend-and-Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models' (SIGGRAPH 2023).