AI cake fails are unlike any cake fails I've seen before. What do you get when your cake is being generated by something that's seen lots of pictures labeled "cake" but has never had a cake or experienced physics?

CLIP+VQGAN are two algorithms that, when teamed up, take turns generating images and judging whether they match a prompt, based on what images appear with what text in online training data.

Here's "Unicorn cake with rainbow sprinkles" as generated by CLIP+VQGAN (tutorial for this version here).

A room is filled with piles of funfetti cake from which jumbles of white limbs and horns erupt.
Unicorn cake with rainbow sprinkles

The image looks simultaneously like cake, unicorn, and sprinkles, which is technically what I asked for. I didn't specify whether I wanted the inside or the outside of the cake, so I kind of got both.

Randall Munroe, who put me up to generating cakes, suggested I try specifying a wedding cake since people tend not to post pictures of the insides of those. It helped - I got a similar level of chaos but at least less inside-out cake. What also helped was to give it a sketch of a single cake layer as a starting image, and to give it a negative penalty for anything resembling "slice".

Here's "unicorn cake with golden horn and rainbow sprinkles" with a negative penalty for "slice".

A cake sits on a wooden floor next to a glass full of unfrosted cake. Rainbow frosting gardens and gleaming golden horns are scatterd across the cake. There is a unicorn face emerging from the side of the cake and beginning to eat from the glass.
Unicorn cake with golden horn and rainbow sprinkles: 1 | slice: -1

It still managed to show cake interior but now it's in a glass of some sort and the cake has sprouted a unicorn head that is ...drinking out of the glass?

I wanted to generate cakes that are at least physically possible, if highly improbable. So I talked with bearsharktopusdev who helped me optimize their Zoetrope version of CLIP+VQGAN for cake generation (and they have a Patreon where you can help them develop new bells and whistles). With the ability to control noise and optimization method, the ability to turn the learning rate way down (so the AI only takes small, careful steps away from the default plain cake), and experimentation that indicated that the best prompts for getting a showcase cake would include the words "food photography" and "by Janelle's bakery" (or anyone's bakery, really), I got this cake:

A scaly white cake. Vivid rainbow colors peek from the bottom as if from behind a curtain; in other areas tutti futti colored bits of cake erupt from the frosting, bristling with golden horns.
Food photography unicorn cake with golden horn and rainbow sprinkles by Janelle's bakery

It's a technically impressive cake, I'll give it that. The rainbow interior reveal is dramatic and I didn't even know you COULD get fondant to look like the underside of an albino alligator's belly.

I decided to give the AI another classic cake challenge: a galaxy glaze cake. They're tricky to get right, but ideally a galaxy glaze cake would have a glossy dark mirror finish patterned with stars and nebulae. Here's what I got:

The cake is covered in a sagging marshmallowy coating that might once have had sleek robotic curves. It’s vaguely peach-colored as if lightly toasted or faintly stained. Nebula colored crystals cover part of the top of the cake.
Food photography galaxy glaze cake by Janelle's bakery

I also tried requesting a classic hedgehog cake:

Thick brown frosting speckled with eyeballs and blunt spikes. From a doorway at the center a realistic hedgehog-textured animal appears to stand facing sideways.
Food photography hedgehog cake by Janelle's bakery

The AI, despite having seen many classic cakes online, doesn't seem to reach for this knowledge when asked for cakes. There are many cute mushroom cake designs online. Then there's the AI-generated version.

A cake constructed mostly of ribbon mushrooms from with other brown mushrooms, and a few tufts of green grass, emerge.
Food photography hedgehog cake by Janelle's bakery

"Golden retriever" cake uses an impressive melting fondant effect and I appreciate the bits of gold leaf it added for decoration.

Golden fondant droops over a hairy cake with paws. At one corner of the cake, there are a few sprigs of gold leaf.
Food photography golden retriever cake by Janelle's bakery

I tried a "neural network" cake but it was pretty horrifying.

A pile of brains and viscera is topped by a road map and a glistening camera eye. Wirelike tendrils trail from either side of the cake.
Food photography neural network cake by Janelle's bakery

It can also do movie-themed cakes. Here's a Frozen-themed cake.

Blue bricks and cellophane, festooned with a few tiny people in fairy-queen ball gowns. A pile of brussels sprouts sits on top of the tree, and one rectangular viewfinder window seems to look out of the cake.
food photography frozen-themed cake by janelle's bakery

I'm not sure what's up with the eyeball, or the brussels sprouts. One of the problems with doing a themed cake is, unlike a human baker who might pick one aspect of the theme and shape the cake like that, the AI tries to do ALL of them at once. Its "Star Wars themed" cake was so much of a mess that it looked less like a cake than a themed pile of junk.

A few robots, some stained concrete buildings, a small black cell phone, and two jedi figures in beige robes are all kind of thrown together in a collage.
food photography star wars themed cake by janelle's bakery

My attempts to focus its efforts on "Kylo Ren themed cake" proved ineffectual, as the resulting cake was still very busy. As bearsharktopusdev put it, it's not so much a cake about Kylo Ren as it is a cake made of Kylo Ren.

All in black and red, with a red lightsaber glowing at one side and kylo ren’s eye peeking out from a pile of what appears to be dragonskin and viscera.
food photography kylo ren themed cake by janelle's bakery

The AI seems not to be able to leave well enough alone. Here's "Cyperpunk neon" cake which I stopped fairly early on in generation. It's weird, but it's at least a coherent cake.

A shiny white cake with wide-set salamander-like eyes. The bottom of the cake crackles with a neon glow.
food photography cyberpunk neon cake by janelle's bakery, iteration 400

Here's the "Cyberpunk neon" cake later.

All the textures of the cake are complicated. There are neon lights, caution tape, some neon pink camera eyes, a green scaly area, a pile of peach-colored roses or maybe cellophane, a small pile of lint.
food photography cyberpunk neon cake by janelle's bakery, iteration 2000

It's possible to reduce the chaos by tweaking the noise settings, though I'm not sure the resulting cake is any more bakeable:

It’s the size and shape of cake but now has a shiny red hallways swooping through one side. Three turquoise bulbs glow out of the dark side of the cake, and the top is filled with magenta and fluorescent yellow snacks, maybe.
food photography cyberpunk neon cake by janelle's bakery, iteration 2000

In image generation as in text generation, AI excels at details and at overall vibes. Understanding of reality, such as physics of actual cake, is not AI's strong point.

After all, none of its cakes are real. They don't have to be obey physics or be edible - it wasn't rewarded for that during training. If it can convince itself that this is cake, that's good enough.

A chocolate mousse with thick lumpy white frosting, and three highly distorted cherries dripping from chocolate leaves. The cake has two thin black tendrils for some reason.
food photography black forest cake by janelle's bakery :1 | cherries: 0.2

Bonus content: more of my favorite cake fails, including Thomas the Tank Engine, giraffe cake, and "trout".

Subscribe now