AI Fundamentals

Fit the Line

Watch a computer adjust its knobs until its "wrongness" number shrinks.

Fit the Line — interactive video preview

What you'll learn

  • Training
  • Loss
  • Gradient Descent

In this video

Okay, you've met the box with knobs. You've seen what "learn" really means. Now I'll show you both ideas teaming up — this is the moment a computer actually starts learning right in front of you.

Watch the dots show up one by one. They look kinda scattered, right? But trust me — they're not just splattered around. There's a secret shape hiding in there, and your eyes can almost feel it.

See it? Lean back from the screen a sec. There's a kind of slope going up from bottom-left to top-right. That ghosty pink streak is the line your brain just guessed. Pretty cool — your eyes did math without asking.

So let's actually draw one. Here comes a line — but wait, is THIS the right one? Could be flatter. Could be steeper. Could be lower. There are a zillion lines we could pick. We need a way to tell which one's actually good.

Watch — here's a bad line, way off the dots. Now an okay one, getting closer. And finally, a great one that slices right through the middle. Your eyes already know which is best. Now let's teach the computer to know too.

Here's the trick. For every single dot, we draw a tiny red stick to the line. That's the miss — how far off the line is from that dot. Watch them pop up one by one. Short red sticks mean the line's nailing it. Long ones mean it's way off.

Now stack all those red sticks together and add them up. Boom — one number. That's the total miss, sitting right there in the corner. Scientists call this the loss. It's basically the line's wrongness score, all in one tidy digit.

Look at the number flip as the line changes. Bad line — big number, red. Better line — number drops, turns yellow. Great line — tiny number, glowing green. Our whole job now? Push that number down. The smaller, the smarter.

Okay, your turn — go play. Slide the pink knob to tilt the line, slide the blue knob to lift or drop it. Keep an eye on the miss number up top. Try to chase it down as low as you can. Don't worry about getting it perfect — just feel it move.

Did you notice what your brain just did? Guess a knob, check the number, adjust, repeat. Round and round. That's literally the four-step loop from last time. You weren't just playing — you were training a tiny AI with your hands.

Now hand the job to the computer. No fingers, no sliders — it just nudges the knobs a teensy bit, checks the miss, nudges again. Watch the line wiggle and snap into place. Eighty tiny tries, faster than you can blink.

Drag the slider yourself and travel through training. At step one, the line's a mess and the number's huge. Slide forward — see how the miss melts down? That shrinking number? That's learning happening in slow motion.

Take a sec — you just watched real AI training. The green line? That's the AI. The blue dots? That's the data we showed it. The red miss? That's its wrongness. Training is just one thing: shrink the wrongness. That's it.

Now picture this — but with millions of knobs instead of two. ChatGPT? Billions. The big art-makers? Same deal. They're doing exactly what you saw, just gigantic. Nudge, check, nudge, check — for days, on thousands of computers at once.

But here's a sneaky problem. What if the AI gets a little TOO good at our dots — so good it just memorises them and freaks out on anything new? That's a real trap, and it's where we're heading next. See you there.

Topics

#Training#Loss#Gradient Descent

Ready to try it yourself?

Fit the Line is a hands-on interactive video — watch it, then play with the idea live in your browser. Free, no sign-up.

Open in Kekula →