Course
BASICModule 1: How LLMs Work· 1/3

What Is a Language Model

A machine that continues text

A language model (LLM — large language model) solves one problem: given the start of some text, predict which word comes next. Given "The capital of France is," the model outputs "Paris." Given your email and the request "make it more polite," it continues the conversation with the text of a polite email.

The whole range of behavior — translation, code, document analysis, holding a conversation — grows out of that single operation, repeated many times: the model writes out its answer word by word, choosing the next one each time.

Where the model "knows" things

The model was trained on a huge body of text: books, articles, websites, code. During training it tuned billions of internal coefficients (weights) so that its predictions matched the real texts. To continue a text about chemistry well, you have to "learn" chemistry; to continue code, you learn the patterns of programming.

That is why the model answers questions it never saw verbatim. It absorbed the patterns of language and the world rather than memorizing a database of ready-made answers.

💡

The model stores knowledge in its weights, not as texts. You cannot pull an exact quote or number out of it "like from a database" — the model reconstructs them from memory, sometimes wrongly. More on this in the lesson on hallucinations.

Does it understand anything

Leave the debate about "real understanding" to the philosophers. The practical fact: the model grasps the meaning of a request well enough to be useful. It picks up on irony, holds the context of a conversation, notices contradictions in a text.

The other side of the same fact: the model picks a plausible continuation rather than checking its answer against reality. It has no built-in truth detector. A beautiful, confident, well-formed answer and a correct answer are different things.

Chat under the hood

A conversation with Claude works simply: the whole exchange (your messages and the model's replies) is glued into one long text, and the model writes out the next reply. It reads each new question of yours together with the entire chat history.

Two practical consequences follow:

  • The model sees only the current chat. Start a new conversation and the history is gone — you have to give the context again.
  • Everything you wrote earlier in this chat affects the answers. An awkward wording at the start can drag the conversation off course — sometimes it is easier to start a clean chat.

Key takeaways

  • An LLM predicts the continuation of text; all its abilities grew out of that task.
  • Its knowledge comes from the training texts and lives in the weights — the model generalizes rather than quoting a database.
  • The model generates something plausible; it has no built-in check for truth.
  • A chat is one long text: the model sees the whole history of the current conversation and nothing beyond it.
CHECK YOURSELF
1. What basic task does a language model solve?
2. Why can a confident, well-formed answer from the model turn out to be wrong?
3. What does the model see when answering your message in a chat?
Tokens, Context & Knowledge Cutoff