Oboe
No history yet

How does AI learn?

I'm so excited to help you explore how artificial intelligence learns! It's a fascinating journey that completely changes how we think about computers, but before we dive into the core concepts, I'd love to learn a little more about what brings you here.

What inspired your interest in how AI learns, and how much background do you already have in tech or computer science?

I have some tech/coding background but want to understand AI specifically.

It's awesome that you have a coding background! That actually gives us a great shortcut because you already know how traditional software works. We can use that to pin down exactly what makes artificial intelligence different.

The Great Paradigm Shift

In traditional programming, you write (the code) and supply some inputs, and the computer calculates the output. But with Machine Learning, we flip that equation completely on its head.

A two-row comparison showing the inverted flow of data and rules between traditional programming and machine learning.

As you can see in the visualization, in , we feed the computer the inputs and the desired outputs (the training data). The machine's job is to figure out the rules that connect them.

Continue to pattern recognition

Let's dive right into how computers actually recognize patterns in data without us writing explicit rules.

The Anatomy of a Feature

To find patterns, a machine learning model can't just look at a messy pile of raw data and magically understand it. First, the data must be broken down into measurable characteristics called . These features are the individual clues the model uses to solve a puzzle. Let's look at a classic example: identifying whether an email is spam.
Email Text SnippetFeature 1: Has "$" Symbol?Feature 2: Contains "Urgent"?Label: Is Spam?
"Your account is locked. Urgent action needed!"NoYesYes (Spam)
"Collect your $1000 prize now!"YesNoYes (Spam)
"Hey, are we still meeting for lunch tomorrow?"NoNoNo (Safe)
Once the computer has these features represented as numbers (like 1 for "yes" and 0 for "no"), it maps them mathematically to the desired output. This mathematical transformation is called a . At its simplest, the model assigns a custom weight to each feature to calculate a final score, allowing it to draw a clear decision boundary between "spam" and "not spam."

A scatter plot of email data points separated into safe and spam categories by a diagonal linear decision boundary.

I've set up a visualization above to show you how a model uses these features to draw a decision boundary between safe and spam emails. By plotting the features as coordinates on a grid, the math naturally groups similar data points together, letting the AI draw a line to cleanly separate them.

How does the AI know where to draw that line?

That is the ultimate question! The AI doesn't just guess where to place that decision boundary; it uses a mathematical strategy to constantly adjust the line until it's in the perfect spot.

The Game of Hot and Cold

When a machine learning model starts training, it has no idea where to put the boundary. It actually starts by drawing a line completely at random.

To move this random line to the right spot, the AI uses two core concepts:

  • Weights: These are knobs the model tweaks to change the angle and position of the boundary line.
  • Loss (or Error): This is a mathematical penalty score that measures how many mistakes the model is currently making.

Think of it like a game of hotter or colder. Every time the AI adjusts its , it checks the loss. If the loss goes down, it's getting "warmer" (closer to the perfect line). If the loss goes up, it's getting "colder," so it backs up and tries a different direction. This systematic process of sliding the line step-by-step to minimize error is called .

A scatter plot of email features showing spam and safe categories separated by a diagonal decision boundary.

I've updated our previous visualization so you can see this tuning in action.

Notice how with each step, the algorithm recalculates the loss and nudges the line. It keeps doing this over and over again—sometimes through millions of iterations—until the line can't possibly separate the groups any better.