AI, my grandma and her cherry pie

Cherry pie floating in a sky with random math formulas flying around it
December 28, 2024

Dear Grandma,

If you were still alive you would be shaking your head at the state of the world, telling me that everyone has gone crazy and then give me all the time in the world to let me work through some of the crazier things that I am trying to understand. So today let me bend your heavenly ears trying to figure out how people, computers, and artificial intelligence (AI) work together to create systems that supposedly can answer any question I can think of. I know you would be more interested if we talk through all of this highfalutin stuff using an example that’s dear to both of us: baking cherry pies!

Let’s start with the people involved, a group of workers, many of them in the global south, sitting at computers and feeding the beast. Their job is to look at information on the internet—like articles about making pies—and organize it in a way that computers can understand better.

Here’s what they do:

  1. They read through web pages, like online magazine articles about pie making.
  2. They don’t copy entire articles. Instead, they pick out key information, like:
    – Ingredients for a pie crust (flour, butter, water, salt)
    – Steps for making the crust
    – Baking instructions (like setting the oven to 180°C)
    – Popular fillings (cherry, apple, blueberry)
  3. They type this information into a special program designed for organizing data, not unlike Microsoft Excel, but a tool specifically created for this task.
  4. They also add labels to this information, like “recipe,” “baking,” or “dessert.”

This work is called data annotation and content moderation. It is super important but can be challenging. Yet, wages are low and sometimes they have to review disturbing content. But hey, at least they get to stare at a screen all day while shaping the future of AI.

Once these workers finish their task, all this organized information gets moved from their local computers over the internet to gigantic data centers filled with hugely power hungry computers. But who needs polar ice caps when we can have instant access to the best cheery pie recipes, right?

Some Lingo to get right

So, what is AI (Artificial Intelligence) actually? AI is special software that runs on these powerful computers in the data centres spread around the globe. One type of AI used are the pleasantly named ‘AI Assistants’ like ChatGPT, which most people have now heard of even though it’s not quite as cute as ‘Google’. By the way, those AI assistants are also called ‘Large Language Model Assistant’ (LLMA), even less cute. They are like super-smart digital librarians that gobble up all the information stored on the computers.

And then the word “algorithm” pops up everywhere, even if you are not looking. An algorithm is a set of instructions that tells the AI software how to solve a problem or do a task. But for the more powerful AI assistants of the world, it’s not just one set of instructions – it’s many sets working together, like a team of expert bakers in a big kitchen.

Ever wondered what an algorithm might look like?

Many algorithms in AI are actually written as mathematical formulas. No wonder, me the old mathophobe, has been very suspicious of them. Let’s check out a simple example of what one small part of an AI algorithm might look like before I get cold feet:

pie_recipe_score = (0.4 * ingredient_match) + (0.3 * user_ratings) + (0.2 * preparation_time) + (0.1 * recipe_age)

Explain please!

Pie_recipe_score: This is what the algorithm calculates to decide how good a cherry pie recipe is.

Ingredient_match: How well the recipe’s ingredients match what I am looking for (like fresh cherries).

User_ratings: How highly other bakers have rated this recipe.

Preparation_time: How long it takes to make the pie (shorter might be better for some people who are not of the slow food persuasion).

Recipe_age: How new or old the recipe is (newer recipes might use more modern techniques which means they never will know what grandma’s pie tasted like).

The numbers (0.4, 0.3, 0.2, 0.1) show how much importance the algorithm gives to each factor.

This formula tells the AI software how to calculate a score for each cherry pie recipe it finds in the computer’s storage. The computer performs these calculations incredibly fast, a lot faster than I can say “a la mode”, processing thousands of recipes per second, and the AI software uses these calculations to sort through all the possibilities and find the best cherry pie recipe for you. Teamwork, eh?

 

The mystery of how it actually happens

But how does the AI software actually find the right information to answer questions. When I ask, “How do I make a cherry pie?”, here’s what happens:

  1. Breaking Down the Question: The AI software first breaks my question into smaller parts called “tokens”. For “How do I make a cherry pie?”, the tokens might be “How”, “do”, “I”, “make”, “cherry”, “pie”. This process is called tokenization. And no, tokenism is different. That’s more like me being allowed into a young, techy, nerdy meet up as a 60+ woman and making the group look inclusive.
  2. Number Conversion: The AI turns these tokens into a set of numbers. That seems to work well since the information stored in the computer’s memory is already in a similar number format. This conversion allows the AI to work with the question mathematically. And here we are again: math rules!
  3. Pattern Matching and Relevance Scoring: The AI compares the numbers it has broken my pie question into to numbers in the computer’s storage, looking for similar patterns. This is where it uses complex algorithms to calculate how relevant each piece of stored information is to my question. For example:
    – It might give high relevance scores to recipes that mention “cherry pie” or “pie crust”.
    – It could give medium scores to general baking information.
    – It might give low scores to information about cherry trees or other unrelated topics like cherry pit spitting competitions in Georgia.
  4. Context Consideration: The AI doesn’t just look at individual words like “cherry” or “pie”. It considers how they relate to each other, understanding my question about making a pie, and that it’s not just about cherries or pies separately. This is part of its contextual understanding.
  5. Weighing Importance: Some parts of my question might be more important. In “How do I make a cherry pie?”, the AI knows to focus on “make” and “cherry pie” rather than “How do I” when searching for relevant information.
  6. Making Connections: The AI recognizes relationships between different pie-making concepts. It knows that “baking” is related to pie-making, and that you’ll need a “rolling pin” for the crust, even if you didn’t mention these specifically.
  7. Considering Multiple Options: Instead of immediately choosing one recipe, the AI considers several possible cherry pie recipes stored in the computer’s memory. It ranks these based on their relevance scores.
  8. Formulating the Answer: Finally, the AI selects the information with the highest relevance scores and uses it to formulate an answer to my question.

This process allows the AI software, running on those mighty, power-hungry computers, to quickly search through thousands of pie recipes and baking tips to provide relevant answers to my pie-making question. And, grandma, in case you wonder why we can’t just stay with good old-fashioned Google: Google gives us a broad list of search results to lose ourselves into and explore websites for hours, taking me from cherry pie making to those cute cat videos. AI assistants aim to provide a focused answer to my specific pie-making question, saving me time in sifting through multiple sources and never having to see another cat video.

The good, the bad and the really weird

The really clever thing about AI is that its algorithms can learn and improve over time. The more questions people ask about all sorts of topics (yes, we can expand beyond cherry pies) the better the AI gets at answering them. The computers store more and more information, and the AI software gets better and better at processing it.

However. While this process is very fast and often accurate, it’s absolutely not perfect. The AI can only work with the information stored on the computers, and, darned, sometimes it might misunderstand or have the wrong information. It’s like Aunt Bertha not using her glasses when trying to decipher your smudged, handwritten cherry pie recipe. Her pies turned out rubbish on some notable occasions.

Let me wrap this up with a kicker:  while AI can seem very smart, it doesn’t actually know what a pie or a crust is in the way we do. No real-world experiences! It’s just software performing incredibly complex pattern matching based on the data it has been given by humans. And finally: it’ll never be able to taste glorious pies! By the way, never “a la mode” for me… it’s whipping cream all the way.