Let me take you down memory lane to when we were all in high school.

During our high school years, one subject was especially popular. It was math.

There was a group of people who hated it. There was a group of people who absolutely loved it.

In which category did you fall? 

What were you doing during your math lecture? Were you someone who loved it? Or someone who stared at the board during the lecture, wondering, “Where on earth are these equations even going to help me? What is the use of memorizing these mathematical formulae?”

Honestly, most of us have had that thought, but guess what? Most of us were wrong. 

Courtesy of ChatGPT.

Let’s continue with a quick story.

Think about the time when you were sitting in your math lecture and your professor drew a straight line on the board. As they put their chalk down, they say, “Take y = mx + c. Find y when x = 10.” 

You nod. You solve it in your notebook, show it to the professor, and he seems happy. 

You also end up scoring good marks on your test. And by the end of the year, you forget it.

Now fast forward a decade. You open ChatGPT and type in a question.

Behind that input, the same equation we just discussed is running billions of times, and that too in a couple of seconds. 

Honestly, nobody expected something like this to happen. But it is!

So, in the next few minutes, I will be discussing 5 school lessons that are being used inside every AI model.


1) y = mx + c

I’m so sure that you have seen this equation during your high school years. If not, you must have got some cool class-bunking stories.

When you see this equation, there’s a voice in your head that says, “Take a number x, multiply it by a number m, and then add a third number c. That is your straight line.”

Now let’s connect this idea with a neuron. This is because, interestingly, every neuron inside an AI model is exactly doing the same thing. 

It’s a pretty straightforward process. It takes the input, multiplies it by weights (the m’s), and finally adds a bias (the c). 

The output derived is then passed ahead.

Have you heard about a model having 70 billion parameters? The number 70B associated with it? 

This is what gets counted as 70 billion. The M’s and the C’s


2) Matrices

Do you remember this grid of numbers that we had to multiply in high school? The matrix?

Well, in the field of AI, it matters a lot.

An AI model isn’t computing billions of lines one at a time. That alone would take forever.

Instead, it collects all the numbers and pushes them into grids. Then it multiplies the grids in one go. This is known as matrix multiplication, and it's a core part of an AI model.

It is another reason why AI runs on GPUs. A GPU is a chip built to multiply grids at a very rapid rate.


3) Average

This one is the simplest on the list. You simply add all the numbers and divide by the total number of numbers present.

So tell me, how does an AI model measure that it is performing badly? 

For this, it needs a score.

To do so, it takes a batch of examples, calculates how wrong it was on each, and averages those mistakes. That average number is known as loss. And the goal of AI is to reduce that loss. The average of its mistakes.

Though language models use a different formula for every mistake than the one we learned in school, the idea of averaging remains the same.


4) Slope

Going back in time, I remember this lesson in calculus.

How steep is a graph at a point?

Let’s come up with a very interesting scenario. Imagine standing on a hill surrounded by thick fog.

You are in a position where you can’t see the bottom, but you can feel the ground with the help of your feet. You take one small step downhill, feel the ground, and then step downhill again. You keep repeating this. That is, taking slow steps, until you reach the bottom.

And guess what? That is how AI learns. 

It checks the slope of its loss, then takes a small step in the direction that reduces the loss and keeps repeating this a million times. That is gradient descent in a nutshell.

Honestly, I believe it is the most important idea in training. The only difference is that here, there are billions of directions.


5) Percentages

This is another simple one. It’s the chances that add up to a hundred.

Let’s say when ChatGPT is predicting the next word, it’s not directly just picking a single word and then moving ahead. Instead, it gives every possible word a percentage.

For example, if the question is “What is the capital of France?”, let’s say Paris gets 95%, Lyon gets 3%, Nice gets 1%, and so on. All of them add up to 100%.

Then it picks one from that list. 

There is a reason why you get different outputs for the exact same prompt. Interestingly, there is a specific setting for it. That setting is known as temperature. If the temperature is set low, it means the model always chooses the highest-probability word. Whereas if the temperature is set high, it takes a few more chances and might not pick the highest-probability word. Used for creative responses.


My Take

I believe understanding AI is connecting it back to the fundamentals. The basic things that we have learned. That's exactly why I feel having strong fundamentals is essential.

What we discussed was just a line, a grid with numbers, an average, the slope, and the percentage. I’m sure most of you already know them all.

Which is the one mathematical technique that you believe is most important when it comes to understanding AI? Let me know in the comments.

Enjoyed the read? You can connect with me on LinkedIn: ShreyasNaphad and X: NaphadShreyas.