Drawing Circles: From Giotto to ChatGPT

Not a lot of time for blog posts toward the end of the semester. Besides classes, one of the things that kept me busy was giving several public talks about the current state of AI. (That’s what happens when you teach a Machine Learning class during a media tidal wave about AI!)

In preparation for the talks I gave, I read everything I could; both technical articles, and articles from reporters, philosophers, psychologists, technologists, etc on the implications and current state of AI. Much of that I found to be nonsense, but one thing I came across that I found particularly interesting was a paper and YouTube talk by Sebastien Bubeck of Microsoft, detailing some experiments with OpenAI’s GPT-4 before its public release, designed to test “intelligence” in some broad sense. One of the things they asked it to do was generate TiKZ code to draw a unicorn, which it was reasonably successful at.

I’d been following the developments of the new generation of AI based image generators. I haven’t blogged about those, mostly because I don’t consider the use of such algorithms as “Math Art” in the sense that I tend to use that phrase. However, Bubeck’s use of GPT-4 to create images by asking the software to write code which generates an image got me excited. Suddenly I could imagine ChatGPT generating gcode, for example, that can be sent to a 3D printer to create interesting 3-dimensional objects.

Before jumping into 3D, I decided to do some 2D tests first. And that’s when I was reminded of the story of the Renaissance painter Giotto, who is said to have proved his artistic prowess to the pope by simply drawing, freehand, a perfect circle.

So, I asked ChatGPT to generate svg code (e.g. code that can be executed by any standard web browser) to create a perfect circle. It did so with flying colors; in svg there is a “circle” command that it used:

<svg width="500" height="500" xmlns="http://www.w3.org/2000/svg">
  <circle cx="240" cy="240" r="240" fill="none" stroke="black" stroke-width="2"/>
</svg>

Which creates this:

I felt like that was cheating a bit, so I followed up by asking it to do the same task without using the circle command. Again, it succeeded easily by using the “arc” command twice. Still not what I’d call a simulation of a free-hand drawn circle.

Finally, I asked it to draw a circle by explicitly specifying the locations of 100 points, and connecting them using the “polygon” command. Here’s what the code it gave me creates:

Smaller, and much less circular. Hardly worthy of Giotto. On the other hand, I found this to be MUCH more impressive! To generate this it had to have some spatial sense of where each point was in relation to the other points it specified, and how to generate new points that reflected the idea of “circleness” in conjunction with those. I have a pretty good technical handle on how transformer models work, but I have no idea how such a model might develop any kind of spatial awareness.

One of the most striking things I find about this image is its almost-but-not-quite symmetry. ChatGPT clearly had some sense that a circle should have mirror symmetry across a vertical axis, and was able to specify points accordingly. However, it didn’t do this by simply remembering the points on the right half and performing some mathematical operation (like negating the x-coordinate) to get the points on the left half. If that’s what it did, then its symmetry would be absolutely perfect, which it’s not. Instead, it clearly exhibited some kind of spatial “intelligence”.

Is ChatGPT really intelligent? That’s the question that’s been the topic of about 1000 articles I’ve read recently. And my conclusion? It’s a stupid question. Or rather, it’s the wrong question. Let’s think a little about why people ask whether ChatGPT is “intelligent”:

  • They’re worried these systems might take over the world, a la The Matrix or Terminator . If that’s your concern, then why does it matter if they’re labelled as “intelligent”? Certainly systems without such a label might take over the world, too. While we’re referencing movies, it’s worth pointing out that the AI depicted in War Games looks pretty primitive compared to ChatGPT, and yet people worried about that kind of system, too.
  • They’re questioning whether AI can do tasks that were previously thought to be squarely in the realm of things only humans can do. If that’s your question, then just discuss that directly, without worrying about the label “intelligent”. (The answer is “yes”, by the way.)
  • They’re questioning their place in the universe if computers can really be “intelligent”. If that’s your worry, then you may need a priest, rabbi, therapist, or philosopher. Stop debating about labels for computer programs.

I’ll end this unusually long post with one final word: it can’t be understated that the systems we’re seeing now are just the beginning. Soon I expect that Large Language Models (like GPT-4) will be capable of drawing a perfect circle by plotting points, just as I expect AI systems will enter almost every facet of our lives. It’s both a scary time and an exciting time, and we’re going to have to have a lot of discussions to understand the world around us as it changes. Let’s please ask the right questions to help us make sense of it all!

2 thoughts on “Drawing Circles: From Giotto to ChatGPT

  • The fact that ChatGPT doesn’t know how to draw a circle seems petty pathetic to me! That means its knowledge base does not include very much mathematics at all. In this case, it does not know the parameterization of a circle as (r sin t, r cos t). Why hasn’t it been “taught” this (and a few million other basic facts about plane geometry)?

    • ChatGPT knows a lot of geometry facts, including a parameterization of a circle. However, it’s not a calculator, so it doesn’t use formulas to compute things. Does knowing the parameterization of a circle help you draw one?

Leave a Reply