How ChatGPT Took Me From Baking Disaster to Masterchef

Written by raudaschl | Published 2023/05/24
Tech Story Tags: chatgpt | ai | ai-applications | cooking | generative-ai | creativity | experimentation | artificial-intelligence | web-monetization

TLDRIf ChatGPT can help us write better, then could it help me improve my recipes? I explore turning ChatGPT into a simulated kitchen for hot cross buns, both traditional and contemporary. via the TL;DR App

One a penny, two a penny, AI buns

As a product manager and part-time coder, I’ve seen first-hand the value of taking some text or code and using ChatGPT to help me infinitely improve it. If ChatGPT could refactor my code, it could surely help improve my cooking.

Hot Cross buns, specifically, are my culinary kryptonite. This subtly sweetened, yeast-leavened bread native to the British Isles is both delicious and an absolute pain to bake. Despite multiple attempts, my buns better resembled hockey pucks than digestible delicacies. With only stodgy bricks to show for my efforts, I had vowed never to make these tasty treats again… until recently, that is.

Then one day, my American colleague strolled into the office, their hands brimming with a basket of homemade hot cross buns. Each one was a fluffy delight — a sweet slap in the face to my British pride. The gauntlet was thrown — I would master this recipe! But this time would be different. This time I had the power of large language models on my side.

I mean, baking is not that different from coding right, right? A logically deductive combination of chemicals producing a desired result. Sure, I could find better recipes online, but I tried that before, and it doesn’t help.

To achieve this, I will combine some of the most successful prompting techniques I’ve learned using ChatGPT: Role Setting, Chain of Thought, and Self-Reflexion.

Role setting means giving the AI a focused purpose. Most of the time, asking the all-seeing ChatGPT sage is fine, but you can get the best results by focusing on its intent and drive. For example, I don’t want my AI to start randomly talking about the logistics of sourcing raisins.

To achieve this, I prompted:

You are BakerGPT. A Michelin award-winning baker who is here to help me create some of the most delicious baked items in human history, drawing inspiration and techniques from any source to achieve this goal. You will assist me in developing recipes and ask me clarifying questions if you think it will help you improve your answers or suggestions. If you understand, respond: UNDERSTOOD

Excellent, so I’ve successfully explained to BakerGPT that I wanted to make amazing hot cross buns.

Next, I want to improve its results by providing some examples of recipes I used before. This is called Chain of Thought Prompting. To achieve this, we will provide the AI with examples of things I would like it to imitate before asking it to generate its own. Usually, this would be stuff like a poem or press release, but recipes would be best in our case. It’s like a mini training session for the AI, helping reduce the risk of hallucinating weird solutions like using olive oil instead of butter. So I provided some examples of hot cross bun recipes I found online, and I already can see it commenting and even trying to suggest its own. Not so fast, BakerGPT!

So we have our overqualified assistant who has been researching buns all its life. Let’s ask it to engage in some self-reflexion — what does it think makes a good or bad hot cross bun recipe?

So that’s promising — it seems to know exactly the qualities I’m after! Let’s ask what we must do with the recipe to get the best characteristics whilst eliminating the bad.

I want more reflexion! How could it make the recipe even better?

Let’s pause here because this is super impressive. Right away, the suggestion of bread improver had never even occurred to me. I mean, what even is bread improver? A quick search reveals a mixture of emulsifiers, enzymes, and flour treatment agents that help break down gluten and improve the quality of the dough and final rise. That sounds just like what I need! Other great shouts include soaking the dried fruit in orange juice and pre-fermenting. Nice to also know I could adapt this to be gluten-free or vegan if required.

Ok, so this all sounds great. Let’s ask it to generate a recipe using all the suggestions provided. Here is what it produced:

British Hot Cross Buns

Ingredients:

For the buns:

- 300ml full-fat milk

- 100g butter

- 500g strong bread flour

- 1 tsp salt

- 50g caster sugar

- 25g brown sugar

- 1 tbsp sunflower oil

- 7g sachet fast-action or easy-blend yeast

- 1–2 tsp bread improver

- 2 eggs, beaten

- 100g mixed dried fruits (sultanas, raisins, currants, dried cranberries, chopped dried apricots)

- 50g chopped nuts (walnuts, pecans, or almonds)

- Zest of 1 orange and 1 lemon

- 1 apple, peeled, cored, and finely chopped

- 2 tsp ground cinnamon

- 1 tsp mixed spice

- 1/2 tsp ground ginger

- 1/4 tsp ground nutmeg

For the cross:

- 75g plain flour, plus extra for dusting

For the glaze:

- 100g powdered sugar

- 2–3 tbsp milk or lemon juice

Method:

1. In a small saucepan, gently heat the milk with the orange and lemon zest, cinnamon stick, and a few cardamom pods. Once warm, remove from heat and let it infuse for 10 minutes. Strain the milk and discard the solids.

2. Bring the infused milk to a boil, then remove from heat and add 100g butter. Leave to cool until it reaches hand temperature.

3. In a large mixing bowl, combine the strong bread flour, salt, caster sugar, brown sugar, fast-action or easy-blend yeast, and bread improver. Create a well in the centre.

4. Pour the warm milk and butter mixture into the well, followed by the beaten eggs. Stir with a wooden spoon, then use your hands to form a sticky dough.

5. Knead the dough on a lightly floured surface for 5–7 minutes until smooth and elastic. Place it in a lightly oiled bowl, cover with oiled cling film or a damp tea towel, and let rise in a warm place for 1 hour or until doubled in size.

6. Add the mixed dried fruits, chopped nuts, orange and lemon zest, chopped apple, and spices to the dough. Knead to distribute the ingredients evenly. Cover and let rise again for another hour or until doubled in size.

7. Preheat the oven to 200C/180C fan/gas. Then, divide the dough into 15 even pieces (about 75g each) and roll into smooth balls. Place on baking trays lined with parchment paper, leaving enough space for expansion. Cover and let prove for 1 more hour.

8. Mix the plain flour with water to make a thick paste for the cross. Pipelines across the buns form crosses. Bake for 18–20 minutes or until golden brown.

9. Remove the buns from the oven and let them cool slightly on a wire rack. Mix powdered sugar with milk or lemon juice to create a glaze. Drizzle the glaze over the warm buns.

Serve these delicious, tender, and flavourful hot cross buns warm with butter, and enjoy the improved texture brought by the addition of bread improver.

With bated breath and fingers crossed, I set out to create these AI-inspired buns. Hours of my life were at stake, and tension in the kitchen was palpable… then, finally, the iPhone timer pinged. I had done it, and I have to say the results were nothing short of spectacular.

I brought a bunch into the office. My colleagues were blown away by how soft, moist, and flavourful these were (even after sitting in Tupperware for 2 days). Somehow through the alchemy of prompt engineering and baking, I’d made something incredible. I was running around the flat proclaiming to my partner we should start an AI bakery.

But why stop there? How far could we push this?

Growing up in an Iraqi-Austrian household, the exotic aromas and bold flavors of the Middle East were a comforting constant. So I decided to pay homage to my roots and mix some of those techniques and flavors into my buns, asking ChatGPT to reimagine this recipe from an Iraqi perspective. The idea of taking a British baked good with a literal cross on it and the best of the middle east has something of a crusader-esk poor taste to it.

Still, the results were anything but — an unholy union of deliciousness.

Spiced Za’atar Cross Buns

- 300ml full-fat milk

- 100g butter

- 500g strong bread flour

- 1 tsp salt

- 1 tbsp sunflower oil

- 7g sachet fast-action or easy-blend yeast

- 1–2 tsp bread improver

- 2 eggs, beaten

- 100g crumbled feta cheese

- 75g chopped dates or dried apricots

- 50g toasted pine nuts

- 2 tbsp chopped fresh mint or parsley

- 1 tsp ground cumin

- 1/2 tsp ground coriander

- 1/4 tsp ground cinnamon

- 1/4 tsp ground cardamom

- 1/4 tsp ground allspice

- 1/4 tsp paprika

- 1/4 tsp black pepper

For the cross:

- 75g plain flour, plus extra for dusting

For the topping:

- 1 egg, beaten for egg wash

- Sesame seeds

Method:

1. In a small saucepan, gently heat the milk and butter until the butter melts and the mixture reaches hand temperature.

2. In a large mixing bowl, combine the strong bread flour, salt, sunflower oil, fast-action or easy-blend yeast, and bread improver. Create a well in the centre.

3. Pour the warm milk and butter mixture into the well, followed by the beaten eggs. Stir with a wooden spoon, then use your hands to form a sticky dough.

4. Knead the dough on a lightly floured surface for 5–7 minutes until smooth and elastic. Place it in a lightly oiled bowl, cover with oiled cling film or a damp tea towel, and let rise in a warm place for 1 hour or until doubled in size.

5. Add the crumbled feta cheese, chopped dates or dried apricots, toasted pine nuts, fresh herbs, and spices to the dough. Knead to distribute the ingredients evenly. Cover and let rise again for another hour or until doubled in size.

6. Preheat the oven to 200C/180C fan/gas

7. Divide the dough into 15 even pieces (about 75g each) and roll into smooth balls. Place on baking trays lined with parchment paper, leaving enough space for expansion. Cover and let prove for 1 more hour.

8. Mix the plain flour with water to make a thick paste for the cross. Pipelines across the buns form crosses. Brush the buns with beaten egg for egg wash and sprinkle sesame seeds on top. Bake for 18–20 minutes or until golden brown.

9. Remove the buns from the oven and let them cool slightly on a wire rack. Serve these Middle Eastern-inspired hot cross buns warm with a side of hummus or tzatziki, or enjoy them as a flavorful snack or accompaniment to a meal.

The combination of feta cheese, dried fruit, pine nuts, and aromatic spices creates a delicious and unique twist on the traditional hot cross bun.

A hot cross bun perfect for dipping with hummus? I’d found heaven! These buns were impressive, and the use of dried apricots with spices and cheese felt like little bites of bliss evoking memories of my father baking.

I went on to create a few more variations: Latvian baltic buns with smoked ham, grated gouda, minced garlic, and chopped dill; Japanese Umami Cross Buns with tamagoyaki omelet, shitake mushroom, and pickled ginger flavored with soy sauce and mirin; and finally the Welsh Celtic Buns comprised of strong cheddar, crumbled laverbread (seaweed) and crispy bacon topped off with fresh chives.

Some of the wilder experiments asked what a hot cross bun could look like inspired by Japanese fashion designer Issey Miyake (sweetened red bean paste, matcha, and chopped candied yuzu) or clothing brand H&M (milk and white chocolate chips with toasted hazelnuts and vanilla).

What surprised me about all this was how fun it is to use a tool like ChatGPT to create my own test kitchen of ideas. It’s like a cooking simulator, a real-world version of Nintendo’s ‘Cooking Mama’. Within seconds I could be dreaming up new recipes and flavors with no limits on what techniques or ingredients to experiment with from any regional culinary background or school of cooking.

Machines are particularly well suited to this as their connections are more diverse and thus have a less compartmentalized view of the world than us humans. Even if I did not have an ingredient, ChatGPT could suggest an alternative or let me know if something in the cupboard would work.

What is exciting about this for me is not just being able to produce better recipes but the ability to take chances and be more creative and curious in our approach to food. You usually find a recipe, buy the ingredients, cook, and hope for the best.

Now with AI, we are freed up to play with it, tailor it to our tastes, and even ask why something may be better or worse. A chance to even take old recipes and rework them into something new. After all, very few (if any) foods are invented. Most are contemporary twists on traditional themes.

As Lynne Olver wrote on the Food Timeline, “Today’s grilled cheese sandwich is connected to ancient cooks who melted cheese on bread. 1950s meatloaf is connected to ground cooked meat products promoted at the turn of the 20th century, which are, in turn, related to ancient Roman minces.”

As a culture, we’re cooking less and buying more prepared meals. Since the mid-sixties, the time spent preparing meals has fallen by half. While the global trend is the same, Americans lead the way, spending less time cooking than any other country. I hope using AI to cook this way is more fun and exciting than working from prescribed recipes and will bring an entirely new type of cook into the kitchen.

You see, cooking changes your relationship with food. Instead of consuming something, now you’re making it. The more people we can get interested in cooking and asking questions about where ingredients come from can only be better for us and our environment. The alternative is that we become so alienated that within a generation, cooking a meal from scratch will seem as exotic and ambitious — as “extreme” — as most of us today regard brewing beer, baking a loaf of bread, or putting up a crock of sauerkraut.

I wouldn’t recommend asking a tool like ChatGPT to generate something from scratch just yet. Still, as shown above, a mixture of specific prompts that set Roles and use Chain of Thought prompting and Reflexion is particularly effective in achieving the best results for not just cooking but many forms of creative work.

Now, every time I see a hot cross bun, I no longer feel a sense of dread — AI has given me a chance to think differently about baking. To those willing to experiment, AI makes exploring things like cooking more accessible. Meals become achievements, expressions, discoveries, and relationships and help us honor in a way where we come from.

This mad hybrid of human, machine, and food goes beyond nutritionism and essentialism. It serves as a tool for training that connects us with nature and teaches us how to utilize AI for a brighter future.

Happy prompt baking everyone.

Also published [here.](https://How ChatGPT Took Me From Baking Disaster to Masterchef)


Written by raudaschl | Physician turned product manager writing about all things medicine, business and technology.
Published by HackerNoon on 2023/05/24