LearnAI home

Under the Hood ยท Lesson 5

Training vs Inference

Cooking school vs cooking dinner: how models learn and how they answer.

Cooking School vs Cooking Dinner

Every AI model lives two very different lives, and mixing them up causes most of the confusion about how this stuff works.

Training is cooking school. Years of it. The model studies millions of examples, makes mistakes, gets corrected, and slowly wires in its skills. It's brutally expensive: months of time on warehouses full of specialized chips, with an electricity bill that could make a small nation wince. But it happens once (well, once per model version).

Inference is cooking dinner. Someone orders a dish (that's your prompt) and the trained chef whips it up in seconds using skills already learned. It's fast, it's cheap-ish per plate, and it happens billions of times a day.

TrainingInference
AnalogyCulinary schoolTonight's dinner service
HappensOnce, before releaseEvery single time you hit send
TakesWeeks to monthsSeconds
CostsAstronomical (total)Small (per request)
The model isChangingFrozen

Here's the kicker most people miss: during inference, the model is frozen. When you chat with an AI, it is not learning from you in real time. Your conversation doesn't rewire its brain. The chef isn't attending night classes between your appetizer and your main course. They're just cooking from skills locked in at graduation.

This is why a model can't "remember you" between separate chats by default, and why telling it a correction today doesn't fix it for everyone tomorrow. Model improvements ship the way new phone models do: in the next trained version.

The Three Stages of Chef School

Training itself isn't one blob. Modern models go through three broad phases. Same chef, three levels of polish.

Pretraining is the massive one: the model reads a gargantuan slice of text (books, articles, websites, code) and learns by playing next-token prediction on all of it (Lesson 3 energy). This is where it absorbs grammar, facts, reasoning patterns, and forty ways to apologize in corporate English. Think of it as culinary school teaching every foundational technique: knife skills, sauces, timing. The result is a model that's knowledgeable but a bit feral: it completes text, but it doesn't yet know it's supposed to be a helpful assistant.

Fine-tuning takes that raw generalist and trains it further on a smaller, carefully curated dataset, often examples of high-quality question-and-answer conversations, or specialized material like medical texts or legal documents. This is the specialty course after graduation: the chef already has technique, now they're learning to run a sushi counter specifically. Fine-tuning is dramatically cheaper than pretraining because the heavy lifting is done; you're steering skills, not building them.

RLHF (reinforcement learning from human feedback) is the taste-testing phase. Humans compare pairs of model answers and pick the better one: more helpful, more honest, less likely to suggest glue as a pizza topping. Those preferences train the model toward answers people actually want. It's diners rating dishes until the chef internalizes what "delicious" means. This stage is a huge part of why modern chatbots feel polite and cooperative rather than like a random-internet-text firehose.

The pipeline at a glance

PRETRAINING --> FINE-TUNING --> RLHF read everything practice being learn what humans predict tokens an assistant actually prefer (months, $$$$) (days-weeks, $$) (ongoing polish, $$)

...then the model is FROZEN and shipped. Every chat you have = INFERENCE on that frozen model.

When people say "the model was trained on the internet," picture a student who read the entire library, then took an etiquette class, then had thousands of people rate their small talk. That's the pipeline.

Why This Split Matters to You

Once you internalize training vs inference, a bunch of everyday AI mysteries dissolve:

  • "Why doesn't it know about last week's news?" Its knowledge froze when training ended (the knowledge cutoff).
  • "Why is the API priced per token?" You're paying for inference compute, plate by plate.
  • "Why do new model versions feel smarter?" Someone went back to cooking school with better ingredients and more ovens.

Checkpoint

Training is the expensive one-time learning phase; inference is the fast frozen-model answering phase, and pretraining, fine-tuning, and RLHF are the three courses of chef school.

Kitchen Quiz

๐Ÿ“ Quiz

Question 1 of 4

When you send a prompt to a chatbot and get an answer, which phase is happening?

Found this useful? Pass it on.