A call to the AI kitchen brigade: write a cookbook!

How did we, as humankind, ever learn to cook? Take bread. At some point, someone must have forgotten a bowl of grain porridge, only to discover later that the mixture had started to bubble and, once heated, suddenly became much tastier and lighter than intended. No idea what yeast was, no knowledge of fermentation, just the practical discovery: if you leave this mixture alone for a while, something useful happens. Or take the fact that some ingredients only become safe to eat after prolonged heating, such as potatoes and cassava. There are many more foods we only discovered after plenty of random experimentation, disgust and possibly stomach aches.

Some recipes are so complicated that it is hard to imagine how one could ever discover them. Especially those baking recipes: only when you use exactly x grams of flour, y grams of sugar, and z grams of yeast at a ver specific temperature, you get (after a specific baking time) the result you want. And then you have those totally unexpected combinations that apparently work very well: caramel and sea salt, strawberries and balsamico, bacon and banana, et cetera

For everything, there’s a first time. Experiment, experiment, and experiment. When we have found something edible after all this trial and error, it is relayed to others through grandma’s notebook, recipe books on the bookshelves, or search engines on internet.

Recipes are good for people who do not like to experiment, but they are also very handy because you can build upon everything that has already been discovered, and you don’t have to do all the trial and error work. 

Some of these ‘insights’ appear to be very sticky, and very wrong.

Like mushrooms that should never be cleaned under a running water tap because ‘they soak up water’ (not true), or that you never should add salt when boiling pulses because that would make their skins too hard (not true), or that eggs need to be shocked in order to make their peel easier to remove (not true).

The fun of cooking is that with a bit of knowledge of recipes, and a bit of feeling for experiment, you can discover tasty new things.

What has this to do with AI?

For all kinds of reasons there is criticism on AI systems that are now being thrown at us. One of those criticisms is that AI is mostly a box filled with statistics. Everybody knows about the wisecrack “there ar lies, damn lies, and statistics”. Statistics is not met with warm feelings by everybody – most people remember that it used to be quite complicated at school. So, emotion plays a role, but apart from that, you can understand the problem. When a system is right 9 out of 10 times, how can you recognize that one case when the output is wrong? Especially when the systems are designed to sound extremely convincing and confident.

The way those statistics-based AI systems work, looks a bit like the trial & error approach that was used when exploring new recipes.

The best dinner in the world

Imagine a group of enthusiastic but totally inexperienced culinary amateurs at your service. There are all kinds of ingredients on the table and the assignment is simple: cook the best dinner you can come up with. The only thing that you do is tasting and giving feedback: good or bad, plus how far the result is off – nothing more. You don’t give any instructions – the only thing you have done, is putting them in groups that each take a next step in the preparation. You prepare for tens, hundreds, maybe thousands of dinners that you have to taste. But you expectation is that the amateurs learn from your feedback.

They start enthusiastically and initially they just do random stuff. The first group of amateurs picks random ingredients and passes them in a random amount to the next group. They process the ingredients: cleaning, cutting, peeling, or something else. The next group prepares the ingredients: marinating, stirring, bundling: it starts to look like cooking but their actions are still totally random. Next groups does the actual cooking: boiling, baking, frying, freezing. Then everything is put on plates and finally ordered into rounds.

Then, you can savour a starter of sauerkraut icecream with licorice sauce, a main of puréed mussels with chocolate sprinkles, and a dessert of a fried whole turnip. It’s clear that you have some feedback.

Your feedback is of course ‘not good’, and you also indicate the biggest problems. You do this for every group: what’s wrong with the order of the dishes, how the food on each plate is composed, what type of preparation was most wrong, and of course which of the ingredients were too much or too little. The culinary amateurs will adapt their way of working and make another attempt. After many rounds, at last something acceptable comes out: they have learned how to cook.

This is roughly how deep learning works: one of the core technologies in AI. In this case, it’s not a bunch of culinary amateurs, but simple calculation units (neurons) that have been organized in layers, where every layer processes the output of the previous layer, forming a network. Just like every group of culinary amateurs built upon the work of the previous group. Feedback is given by indicating how far the output of this neural network differs from what it has to be, after which all calculation units are adapted a little bit, depending how big the error on every level is.

The meal preparation was presented with just a few layers (ingredients, preparation, cooking, composing, serving) but in practice, many more steps are needed for a good meal. In the same way, an AI neural network needs a lot of layers to do something useful – hence the term ‘deep’ learning, the depth is the number of layers involved.

From trial & error to recipes

The above is a nice analogy, but there is one big difference. That gang of AI workers, those enthusiastic culinary amateurs, have now learned at which temperature an oven must be set for a specific type of bakery, or which combination of spices works well. But: they did not record this in a reusable way. In other words, they have not written down their insights in a recipe booklet. Those AI models that have been trained on real-world data, are basically just a long list of tables with statistical information. An explicit rule “if this, then that” is not there. Experience yes, but no knowledge.

The difference between implicit experience and explicit knowledge can be observed in humans, too.

The Nobel prize winning psychologist Daniel Kahneman calls this in his book Thinking, fast and slow ‘system 1’ and ‘system 2’. Here, ‘system 1’ is everything that we conclude directly. A ball is thrown in your direction and you catch it. You talk to a candidate in a job interview and you are immediately impressed. On the other hand, ‘system 2’ is everything that requires you to think. Calculating 651 x 1281. Why you are still not hiring the candidate. Everything that requires explicit reasoning steps to get to a result.

Those recipes are the oldest concepts in AI. The birth of AI as a field of scientific study as on the famous Dartmouth Workshop, already some 70 years ago. The approach was to imitate human thought: how can you make a computer that can reason? This is also called Good Old Fashioned AI (GOFAI).

That approach was harder than anticipated: it is not easy to catch all human knowledge in reasoning steps. For higher level reasoning (‘when a pedestrian crosses the street, you have to brake’) it is more or less possible, but the problem was mainly to deal with the noisy reality. How to tell a computer what a ‘pedestrian’ is and what ‘crossing’ really? Compare it with recipes: ‘fry the onion 5 minutes in olive oil’ is easier to implement than ‘cut the onion in pieces’: it is harder to break that down in precise small steps. 

Recipes are oldfashioned!

The issues that were encountered to have a computer reason like a human led to an ‘AI winter’ in the 90s. Nobody expected anything from AI anymore and investments waned. The term AI became a little bit suspect, too. So alternative approaches that involved doing a lot of calculations and statistics were not called AI but rather ‘machine learning’.

This new approach started from the data itself. The computer searches for patterns in the data and thus finds out what works best in practice – just like the culinary amateurs that just try things out and find out what is tasty or not.

This way of working benefited enormously from some developments that came together. The first was the ‘backpropagation’ technique: the way the feedback on the perfect dinner is distributed to the amateurs. The approach was already known, but a smart way of doing the calculations made it very efficient. Other developments were cheaper computers and internet which made a lot of data available. Besides, specific computer chips (GPUs, mostly used for gaming) appeared very convenient to do those backpropagation calculations.

This ‘deep learning’ approach appeared to be very effective in many areas. The pattern was: when there is a lot of data, deep learning will probably give a useful solution. More is better. The other buzzword that came up by that time was ‘big data’, something that now sounds very 2010.

My first job, in the 90s, was to work on automated sorting of postal letters: design a computer system that can read handwritten addresses on those letters. This was done at the research laboratory of KPN, which was absolute world class at that time. When I asked for the secret, they admitted that they had some nice tricks, but that the most important was to have a lot of training data. They simply had the most. More is better! (They still exist as a separate company today, Prime Vision in Delft.)

For the time being, the pinnacle of the development of Deep Learning is the ‘transformer’: a calculation scheme that can be seen as the engine of the large language models that are used in chatbots. (More on the role of these transformers in my very first blog: Explain AI like you explain the concept “automobile” to someone from the Middle Ages)

Despite their successes, Deep Learning and its modern nephew, the Transformer, are not without problems. For the transformer, that sits in language models, hallucination is the biggest issue: inventing things that do not exist. Can that be solved?

The best cook has knowledge and experience

You can see it at the Great British Bakeoff: the winners have excellent knowledge of recipes so that for every assignment they can mobilize the relevant set of techniques. Additionally, they have experience, so that they have a sense for good combinations of flavours, or enabling them to improvise when things go wrong.

The home cook will recognize that without experience, it can be quite risky to use a very complex recipe when you have guests for dinner.

A good choice is then to choose a simpler recipe. However, most home cooks will hesitate to use too many prefabricated meal components like ready-made sauces, or even microwave meals. That feels like cheating. Just like we now have some debate on the use of AI to craft your mails (not meals) or other texts: fully AI-generated texts are increasingly frowned upon, but using AI as a companion is OK as long as it’s done in a thoughtful way.

The best way to create good AI is to combine data-driven AI (Machine Learning) with knowledge-based AI that is based on explicit knowledge rules. This is called ‘neurosymbolic’ AI: ‘neuro’ refers to the neural networks of Deep Learning, and the ‘symbolic’ refers to knowledge rules, that are usually expressed in symbols. The challenge is to combine these two approaches effectively: it is not yet clear what’s the best way to do it. The multi billion investments of the last years have all gone to the data approach, and very slowly, people are realizing that it is useful to add knowledge to all of this.

The future of AI is not in even bigger kitchens with more tasting rounds, but in systems that have learnt to write down what they discovered.

Related blogs:

Posted in

Plaats een reactie