# Making DALL-E Count

Can DALL-E count? Does DALL-E's counting ability depend on *what* it is counting? Let's find out!

I only generate the images once and paste them in along with the prompt in quotations.

**Numbers**
===========

"Zero"
------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/189c2a3e3d822d0e311f47f19d899ef6e0001a5acd7c677d.png)

"One"
-----

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/7e966cc62a24ff37beb7274331eb9d0f4fca6f1388d00328.png)

"Two"
-----

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/c857f671aaaca2cea59d1b8ec3d60ce7cd94b64fdde7c4c8.png)

"Three"
-------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/3e2dcdf8b271c00ba01aa62515090b9dab3819d18b613309.png)

We have three leaves, but I'm guessing DALL-E is noticing that "three" rhymes with "tree."

"Four"
------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/2bf28e6167088002dcde3607b3047230bbd7fe63510ad173.png)

I guess DALL-E just thinks three is a better number than four.

"Five"
------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/33dc08dab588881eea51147110ebe7c0a31f4334516889ac.png)

"Six"
-----

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/d391df37cdf3dc23aea9d7572da3105ed26dd2a27cc970f1.png)

If an ace is treated as 1, and we add the five dots on the dice, then maybe that counts?

"Seven"
-------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/1c8ddc2ccaa79c1dc4d29dde937ee9b756d1529b8390511d.png)

"Eight"
-------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/ff26ffedf681fee226aae9f664d9356f47810f817150b724.png)

DALL-E is *very* into 8.

"Nine"
------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/91bd220c93f9d21b0b500b9d37363ec8e724ac8e1a6a21b7.png)

"Ten"
-----

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/adc568aa3b3d1a71580cbd3a28668aad164133947d18c9cc.png)

"One hundred"
-------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f74461cbf5e52c3f51d69200edd9be6b17e627c85b1add9c.png)

Digits
======

"0"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/4bb9f13cc51fcdbff21f84f8ca5ea18815f4cf90867439eb.png)

"1"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/faba19bf16f26b3bc7db00f7674bdd522bbf03b7d7b5e782.png)

"2"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f072caf4eeae446ad7ff8f617ec91ac29fa520e7a2f1f507.png)

"3"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/0658997360aaf74dd3f5dfb885ce0dd38044f6e7f7cebd05.png)

"4"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/95aa9f110a4b65f2255edf9f7a978f6371787b15d36cb556.png)

"5"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/334112481841414b1a8028e4834c7a67ef81e5028dbb9ae5.png)

"6"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/84233f53bd14c5eaf6cfa5f55d075ecf50674bf689d6fc40.png)

"7"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/e8a618a0ce82a731786889c8d3095910db799dabb59bb1ad.png)

"8"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/b61007795067a144b7b3be20cda2ddb145cd4f89922533cd.png)

"9"
---

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/227132e751494acc3e6c007fcbd1f34cda9392912addcd82.png)

"10"
----

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/e28d3a0aadc8ad0411a8db42e1d00e501af1182107c584bc.png)

"100"
-----

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/12102bb02c15eb8b8d28a31db28d174eb35db991c1df0330.png)

Cats
====

"Zero cats"
-----------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/ecf968075f50e1c2abdeee3d015500b537005f2c780461c8.png)

"One cat"
---------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/80aee1bb833f0242780cb99742eb762f1e5ccd21ae198ee7.png)

"Two cats"
----------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/253f63aa0cdfc2a67e4e8e641c343fe6ddf28e69f641845b.png)

"Three cats"
------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f3ecb29f7727bc5169375c134c027990b98d46d7d1a3005c.png)

"Four cats"
-----------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/d4b22bf9f03f10df723f1a97da03b3631dce074fc564a945.png)

"Five cats"
-----------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/cee86f906196aa5e45373b149a597cc213ed09cc88a71876.png)

"Six cats"
----------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/406485a92e6949838a98e845044f1b7842d5527cbba9dd2e.png)

"Seven cats"
------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/5a313c2fd5c449cf7b98b5aee99ec02731ce4239e01ad9db.png)

"Eight cats"
------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/604c90e2105b0f50b46371c813d3d82a65300a11af174091.png)

"Nine cats"
-----------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/be171c71021a309b2f3fad2f40c0e90a7eb195af0fe01a1d.png)

"Ten cats"
----------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f1d5d010235ff7dc3f943d0275dac0b01e262a1ff1e37aa4.png)

"One hundred cats"
------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f50d3d6a51648fbfb00ba975d9f298fde01631b278964f8f.png)

Reroll-eight experiment
=======================

I notice that DALL-E seems to be pretty reliable at generating 1-3 of something, and that it seems to prefer spelled-out numbers to digits. It was very successful at generating the number eight, which I suspected was due to the influence of images of magic 8-balls. It only managed to get eight cats once, maybe by accident. With my last 7 free credits, I decided to see if DALL-E had at least *some* sense of what it means to count to eight, as opposed to representing parts of images associated with the *word* "eight."

I therefore decided to generate 7 panels of images of various objects, count the number of those objects contained in each image, plot the result, and see if it was at least centered around the number 8. The nouns were chosen with a [random noun generator](https://randomwordgenerator.com/noun.php), and I selected the first 7 that seemed "easy to draw." The resulting prompts were "eight paintings," "eight hospitals," "eight poets," "eight historians," "eight speakers," "eight women," and "eight baskets."

The way I classified the number of objects in a given drawing is in the caption.

"Eight paintings"
-----------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/1a94386cbab37611e02ec6170ed3a2a66937588ec32220ee.png)

15, 9, 9, 9

"Eight hospitals"
-----------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/ce74c0dac72c45d75f73c99098c20a7b30c16a04ef704b69.png)

8, 9, 8, 5

"Eight poets"
-------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/846592030f8ea5a2fe4047d4517e53d3284fec706ae227ee.png)

4, 20, 5, 8

"Eight historians"
------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/0275780061a415fbcb904e34de4b4cae2d8d399eb3cb309d.png)

8, 9, 13, 10

"Eight speakers"
----------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f598c635f25671c98dc4b9bc7ff449afeda636c4e83fb536.png)

6, 5, 3, 3

"Eight women"
-------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/7940f55604903aa9b581a0287ffafe550986d4b895dfbb21.png)

12, 8, 20, 9

"Eight baskets"
---------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/a890740a4dec7a14ffa6ef1ae97783ee8d451ef0235ca3e2.png)

5, 8, 9, 7

Results for reroll-8 experiment
-------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/889508211e8a16321a16e04003dc08ae8df518b9a856ff9a.png)

Discussion on reroll-8 experiment
=================================

The reroll-eight experiment did generate 8 objects about 20% of the time.

However, I think it's interesting that only one occurrence of 7 of an object occurred, while 9 objects were even more common than 8 objects.

This suggests to me that DALL-E has an heavy bias toward the number 9, perhaps because a 3x3 grid is a common pattern. DALL-E seems to flip over into "grid mode" or "arrangement mode" once it has decided that it needs to display more than about 5 of an object, and needs some structure for their visual composition.

Sometimes, DALL-E gets lucky and happens to choose a structure that allows it to put in 8 objects: a lineup, a semi-structured display, two rows of four, four pairs of two, a cloud, objects in a ring.

Psychologically, this makes me think about [cultures in which counting is limited and imprecise](https://numberwarrior.wordpress.com/2010/07/30/is-one-two-many-a-myth/) ("one, two, three... many"). DALL-E hasn't been trained to rigidly distinguish between numbers in general. It has only been trained to distinguish between numbers that are "compositionally relevant," like the difference between 1 and 2.

Compositional reroll-8 experiment
=================================

I wanted to test this theory by seeing if DALL-E could reliably generate 8 of something if the count was specified *compositionally* rather than *numerically*. So I bought more credits.

My best idea was "An octopus holding eight \[noun\], one in each leg."

I didn't want to generate a second point of confusion for DALL-E by asking it to generate things that can't conceivably be held in one's hands, like hospitals. So I decided to replace the nouns with things that fit in the hands: paintings, baskets, cigarettes, newspapers, salads, coffees, and things.

"An octopus holding eight paintings, one in each leg."
------------------------------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/8262bbdf9a6449669a4bca85fe1ac42e15ad6c77c8d9fb04.png)

8, 6, 8, 8

"An octopus holding eight baskets, one in each leg."
----------------------------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/2e8446b6d5ab6501fc98a9746c4699686593a34f1fc4f080.png)

5, 2, 5, 6

"An octopus holding eight cigarettes, one in each leg."
-------------------------------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/197bddf79791b57e1c0f7ec84d9715db77fd3a1cc77f0875.png)

5, 4, 8, 5

"An octopus holding eight newspapers, one in each leg."
-------------------------------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/df5f6e4a33342aaea11600ee088cd1a5448490b7a0f6fb48.png)

2, 4, 3, 4

"An octopus holding eight salads, one in each leg."
---------------------------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/d23303fc73afd7dfcdcef55afe5e08320bff1b5f4c19b6b9.png)

10, 4, 3, 6

"An octopus holding eight coffees, one in each leg."
----------------------------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/94b331a7da88c69e91789cc11ff764ba351205f2dd7b9ee3.png)

7, 5, 6, 4

"An octopus holding eight things, one in each leg."
---------------------------------------------------

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/17d60bdde5489ffa6f5d151e290a017d85a95277877cd1c3.png)

9, 6, 6, 8

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/db70b79c6cff4d4b46448b3e743c67fefcfdc4864cacbe72.png)

Discussion of compositional reroll-8 experiment
===============================================

Here, we don't see any "pull toward 9." I'm guessing that octopus arms don't correspond to the "grid representation." We see a spike at 8, and then about even numbers of 4, 5, and 6 items. This could mean that DALL-E is "torn" between count and composition, or perhaps that there is a bimodal distribution of octopodal compositions in the training data - some with 4-6 items in hand, others with 8.

I tried doing a "reroll-12" experiment, replacing the numbers on a clock with 12 paintings or 12 baskets. DALL-E generates clocks textured like baskets or spattered with paint, or with baskets next to the clock, but nothing like what I was imagining.

This experiment persuades me that DALL-E can't count. DALL-E *can* compose.  It understands a relationship between number-containing prompts and shapes that we recognize as digits, or between number-containing prompts and arrangements of objects that correspond to those numbers. For example, prompts that contain "nine" or "9" often have grids, frequently 3x3 grids. Prompts that contain "eight" or "8" also often contain grids, and since grids are often in a 3x3 shape, images containing 9 objects are also associated with prompts containing the word "eight."

This pushes me somewhat toward a concept of human psychology in which our brains are composed of a large assemblage of specialized training modules for a variety of tasks. These training modules are interconnected. For example, those of us who received an education in arithmetic have it available for use in a wide variety of tasks. Learning "when to apply arithmetic" is probably also a specialized module.

This suggests to me that advanced AI will come from designing systems that can learn new, discrete tasks (addition, handling wine glasses, using tone of voice to predict what words a person will say). It will then need to be able to figure out when and how to combine then in particular contexts in order to achieve results in the world. My guess is that children do this by open-ended copying - trying to figure out some aspect of adult behavior that's within their capabilities, and them copying it with greater fidelity, using adult feedback to guide their behavior, until they succeed and the adult signals that they're "good enough."

Pedagogically, this makes me suspect that even adults need to have a much greater component of blind copying when they're trying to learn a new skill. I often have great difficulty learning new math and engineering skills until I've had the chance to watch somebody else work through a significant number of problems using the techniques we've just learned about. Even reading the descriptions in our textbooks carefully doesn't make it "click." That only tells me what equations to use, and what the arguments for them are. To make use of them, I have to see them being used, and sort of "think along with" the person solving them, until I'm able to predict what they'll do, or retrace what they just did and why they did it.

Eventually, the generalized patterns underpinning their behaviors come together, and I'm able to solve novel problems.

This makes me think, then, that math and engineering students would benefit greatly from receiving large volumes of problems with step-by-step solutions. They'd "solve" these problems along with the author. Perhaps first, they'd read the author's solution. Then they'd try to reconstruct it for themselves. Once they can solve the problem on their own, without reference to the author's original work, they'd move on to the next problem. Eventually, they'd try solving problems on their own.