← Guide

🌱 Beginner β€” AI Fundamentals

Chapter 21 of 24

πŸ‹οΈ Chapter 21: Training a Model

How models learn from data

Training is how a model learns from data. It repeatedly predicts the next token, compares to the correct answer (loss), and updates its internal numbers (parameters) so predictions get better.

Training loop (simplified)

Data

Text (or pairs) the model learns from

β†’

Tokenize

Turn text into token IDs

β†’

Forward

Model predicts next token

β†’

Loss

Compare prediction to correct answer

β†’

Backward

Compute gradients

β†’

Update

Adjust billions of parameters

Repeat over huge datasets for many steps. "Parameters" are the numbers being updated; more parameters = more capacity to memorize patterns.

In practice

Training needs huge datasets, lots of compute (GPUs), and many steps. You don’t usually train from scratch; you fine-tune an existing model on your data.