Module 0 · Lesson 2 of 10
What a large language model is
A model guesses the next piece
A language model scores every piece of text that could come next, then picks one, usually one of the highest scores.
Scene 1 of 5 · Send some words
Send "The capital of France is": the model gives a score to each piece that could come next.
- You — healthy
- Language model — healthy
- Send some words. Send "The capital of France is": the model gives a score to each piece that could come next.
- One piece stands out. "Paris" gets 92 chances in 100, since that pattern filled its training text again and again.
- A fact it never read. Now send "Our shop's refund window, in days, is", a fact about your shop that was never in its training.
- Only a guess. Here "90" leads with only 36 in 100, so another run could as easily write "30".
- It sounds equally confident. Both answers come back in the same confident voice, so a reader cannot spot the guess.
- Now you try. Send different words, and see whether one next piece stands out. For example: Top piece: "blue", with 86 chances in 100. This pattern was common in its training text, so one piece stands far above the rest.
Scene 1 of 5: Send some words. Send "The capital of France is": the model gives a score to each piece that could come next.
Key points
- For any words you send, the model scores what could come next.
- A pattern it read many times in training gets one clear winner.
- A fact it never read gets a likely-sounding guess, with no evidence behind it.
- A guess comes out in the same sure voice as a known fact.
A (A program trained on a huge amount of text to guess the next piece of text. It writes answers one piece at a time.), or LLM, is a program trained on a huge amount of text: books, websites and code. From all that text it learned one skill very well. Given some words, it guesses which piece of text most likely comes next. It picks with a little randomness, so the same question can get different answers.
A chat model then gets a second round of (The long, costly process in which a model learns from data. It happens before the model is used, not during each request.), on examples of requests paired with good replies, often with people rating its answers. That is why it answers a question instead of only continuing your text.
To write an answer, it makes that guess again and again. It adds one small piece, then guesses the next one, until the answer is complete. That is why answers appear a few words at a time, when the app shows them as they are written.
A model on its own does not look anything up while it writes. It works from what it learned in training and the text you send. It can sometimes work out a fact it was never told. It cannot reliably know your private data or recent news: send that text, or give it a tool to look it up.
In system design: Your backend treats the model as a slow, costly function: text goes in, text comes out. Most of the design work is everything around that call.