Lesson 01.06
How an AI model learns
You will be able to explain training as adjusting parameters to reduce error.
What you’ll do
- FamiliarStart with something familiar
- IdeaThe idea
- Try itTry it
- EngineeringWhy this matters in engineering
- Apply itApply it
- Check1 question, with feedback
Start with something familiar
Analogy
Imagine guessing the cost of a house from its size. Your first guess is €1,000 per square metre. A real example costs more, so you adjust your guess.
The idea
A model has adjustable numerical values called parameters. During training, an algorithm changes these values to improve a measured objective. In language-model pretraining, a common objective is predicting tokens from training text. Real models have far more parameters and use many examples; our house example is deliberately tiny.
Try it
LabAdjust one parameter
Adjust the weight until the prediction error is zero. Then consider why fitting one house is not enough.
- Prediction = area × weight =
- 100 × €1,000 = €100,000
- Error = absolute(actual − prediction) =
- |€200,000 − €100,000| = €100,000
Weight (EUR per unit of area)
€1,000
- Start: weight €1,000 per unit of area, error €100,000
Starting error €100,000. Your adjustments will appear here.
You are adjusting the weight by hand. In training, an algorithm makes these adjustments automatically.
IllustrativeOne-parameter educational model, not a real valuation tool.
Why this matters in engineering
You normally do not train a foundational model when building a chatbot. You use an existing trained model and design the surrounding application.
Apply it
Exercise
Your turn
Find the correct weight and explain why another house may still be predicted incorrectly.