Chapter 1

This is a primer for people who have heard a lot about “AI” and maybe even used it a good bit, but would like to know more of the facts: what it is, how it came to be, what it is capable of, etc. My goal is to provide a baseline understanding of these questions about AI so that your own opinions about it, whatever they may be, can be better informed.

As you know, AI is already affecting industry and our daily lives. I am not confident about where things will go in the future, except to say that we are just barely beginning to experience its repercussions on our society. This is the time to reflect and study what’s going on.

I’m not trying to advocate for a specific stance towards AI – I believe that the things I will explain can be accepted by people who think AI should be destroyed, people who want AI to do all of their work and thinking, and everyone in between. These are important debates for serious people, and I hope that they will be more profitable if they are better grounded in knowledge about AI.

About me

I’m a software engineer who works for Microsoft. I’ve used AI extensively for work and personal projects, built software that integrates AI, and completed self-driven courses on how AI is built. I do not have it all figured out. I suspect that anyone who makes confident predictions about what impact AI will have on this or that field of human endeavor is selling something. But I do have some understanding of what it is and what its current strengths and weaknesses are, and I aim to share those with you.

What do we mean by AI?

The term AI can be misleading. Everyone knows that it stands for “artificial intelligence,” of course, and for many people this sounds philosophical: an AI must be some kind of entity that has transcended software and acquired consciousness or other human characteristics. But when OpenAI or Google offers an “AI” product, they are not making any such fantastical claim – they are using a software term of art.

AI has been used in the tech world for decades to describe the field that’s more technically known as machine learning. In a nutshell, machine learning refers to techniques to get computers to do what we want without us specifically programming what they do. We want to give them a goal and have them “learn” how to achieve it. The reason we do this is that the real world is always much more complex than anything we can describe in a manageable list of rules. So instead we try to build systems that can get better by trying things, seeing the result, and looking for patterns.

The basic techniques have been around for quite a while. (We’ll talk more in Part II about what has changed in the last few years to suddenly propel AI into the limelight.) Think about Amazon product recommendations. Amazon engineers are not tasked with thinking of every specific pattern that they might want to base recommendations on. (“For people who read this dog training book, recommend a specific collar that the book talks about to them.”) Instead, they build a system that can discover patterns too subtle to put into words and use them to make predictions about what someone might want to buy next.

All modern AI products (AI text generators, chat products, “agentic” tools, image or video generators) are AIs in this technical sense – they are powered by machine learning techniques. This next section is going to help you understand how they work. It’s going to get a little abstract, and if you choose to skip it, you’ll still be able to read and understand the rest of the primer. But AI will remain fundamentally a magic box to you, and you’ll have to take other people’s word for what it is and how we should think about it. I encourage you to give it your best shot – I think you’ll be surprised how simple the core idea is!

Machine learning fundamentals

In machine learning, we build systems that recognize patterns and achieve our goals by trial and error rather than by following specific steps. These systems are called models, and they operate on data. We feed some data in, and they give back a prediction or a description of some kind.

There are many ways of building machine learning models, but the game-changing modern AIs all belong to a family of models called neural networks. Neural networks were invented in the 1960s and designed to mimic animal brains. That sounds like it would be complicated, but it’s really not too bad! Think of a neural network like a subway line, a set of routes that go through stations on their way to a last stop: Image

In a neural network, the stations are called neurons, because they are inspired by the neurons in the brain. And the whole thing is just a math problem. We start with some input number, and then each neuron has its own number that it multiplies by, and its own number that it adds. These numbers are called the weights. Then the output is what you get after you work out all the arithmetic. (Neurons can and usually do have more than one input number – the graph is a simplification.)

Here’s what it might look like if we put in a bunch of weightsand an input and output: Image

It’s a little tedious, but it’s just math. So that’s what a neural network is. But there are still so many questions to answer, such as:

  1. Where do the weights come from?
  2. Why would the result of all that math be anything meaningful?
  3. What if I want to work with something that’s not a number?
  4. How does any of this let an AI cheat on someone’s homework?

Neural network training

If a neural network is just a bunch of neurons and their weights that get multiplied and added up, why should that result mean anything to anyone? This is the goal of training, which means adjusting the weights of the neurons until the output is consistently what you are looking for. In the small example I sketched out above, there are only six, so you could just adjust them yourself until they work the way you want.

Let’s see what that would look like for our example. Suppose we want a model that will predict the grade a student will get on a test based on how much studying they do. So we’ll say that the input is the number of hours that they studied, and we want the output to be a good prediction of their final grade. What is our example model above predicting for students that study just two hours? Image

The output is 14.5 – not a very good grade! But now let’s say we happen to know of a student that studied for 2 hours and got an 80% - looks like we need to update our model to be more accurate. Let’s try changing just a couple of the weights: Image

That’s getting a lot closer to a reasonable prediction. Let’s adjust a little further to get it right: Image

Nice! Our model is making a correct prediction. Let’s see what it says a student who studied for 4 hours should score: Image

Uh-oh – that can’t be right unless the test has an option for a lot of extra credit. We could keep going and try to tune everything so that it produces good outputs for both 2 and 4, but it would be pretty difficult, and then someone would come along and ask us about a student who studied for 6 hours, or 0. And that’s just for 6 neurons - modern AI models have trillions of neurons – good luck tweaking all of those by hand!

Needless to say, this is not how training works. Instead, a neural network starts with random values for its weights. Then they are trained using a simple loop:

  • Put in some data where we know the right answer already.
  • Check how close the output was to the right answer.
  • Have a program tweak all the weights just a little bit to move the output closer to the right answer.

That’s it! That’s really the whole process which produced modern AIs – their makers did that over and over again until the results were good. Of course it’s not as easy as it sounds – each of those steps had to be designed very carefully to work at the scales we are talking about. But it’s literally true that everything that modern AI models achieve can be attributed to their makers running this loop very well, many times.

Wrapping up

So now you know what AI is at the core: a series of mathematical operations that turn one number into another number, produced by a simple loop that makes it a bit better every time. When you type your question into ChatGPT, there’s a neural network model that’s doing all this math to produce its response. That’s the entire secret.

Next, I’ll help you understand why such a simple idea suddenly produced incredible results out of nowhere in the 2020s, and how “number comes in, do some math, number goes out” gets turned into language comprehension, image generation, and AI agents building software.

Next: Chapter 2 - Why did AI get so good so recently?     Chapter 3 - How we use AI