If you have ever chatted with an AI tool, you may have noticed something curious: ask the same question twice, and you rarely get the same answer. That small observation is the perfect starting point for this course because it points to what AI really is. A language model is not a reference book that looks up facts. It is, at its core, a probability machine. That difference sounds technical, but it shapes everything about working with AI, what you can trust it with, where it needs your judgment, and why it sometimes gets things confidently wrong. In this chapter we will build that foundation, step by step and with no prior knowledge required.
Same question, different context
Run both versions and compare the answers.
Without context
Prompt
Answer
With context
Prompt
Answer
What just happened in that experiment
The model did not "change its mind." It computed a different probability distribution over possible answers because the context changed. And that points to the central difference from every piece of software you know from your studies: Excel returns the same result for the same input, every time. It is *deterministic*. A language model is *probabilistic*: it estimates which continuation of a text is most likely, and that estimate depends on every single word in the input. Change the input, and you change the estimate. Now a reasonable question would be: where does this characteristic come from?
How a LLM learns
The honest answer fills entire research papers, but the good news is that the core idea fits on one page, and that is all you need for this course. What follows is the training process on an abstract level: three steps, no mathematics, just the logic behind them. If the details spark your curiosity, the "Further material" section at the end of this chapter is your friend. We especially recommend the 3Blue1Brown video series "Neural Networks" which turns the mathematics behind the scenes into beautiful visual animations and builds real intuition.
Step 1: A gigantic fill-in-the-blank exercise
Training starts with a task so simple it almost sounds like a joke. The model works through enormous amounts of text like books, websites, academic articles Its only job is: given the text so far, predict the next word. "The ECB has raised its key interest ___" — what comes next? At first, the model's guesses are no better than random. But after every single guess, it gets to peek at the word that actually followed and learns from the difference. Billions of small corrections later, something remarkable has happened: the model seems to be intelligent. To predict text well, the model had to pick up grammar, style, facts, and even a working sense of how topics connect. Nobody programmed any of that in, it emerged from the exercise.
Step 2: Billions of tiny dials
But where does all that learning go? Inside the model sit billions of numerical values, called parameters. Picture them as tiny dials that together determine every prediction. Each wrong guess in Step 1 nudges thousands of these dials by a fraction. Two things about this parameters are worth holding on to. First, no single dial stores a fact, and the model keeps no copy of the documents it reads. What emerges, dial by dial, is a statistical map of language: which words tend to follow which others, in which contexts and in which tone. Second, this is exactly why the model can write fluently about e.g. balance sheets without having a single balance sheet stored anywhere and why its "knowledge" behaves so differently from a database. That difference will matter a lot in Chapter 1.2.
Step 3: Learning to be helpful
One ingredient is still missing. A model trained only on prediction is very good at *continuing* text, but continuing is not the same as helping. Ask it a question, and it might just produce ten more questions, because that is a perfectly plausible continuation. So a second training phase follows: the model writes answers, humans rate them, and the model is optimized toward the responses people found helpful and correct. This procedure is called *Reinforcement Learning from Human Feedback* (RLHF), and it is the reason modern models feel like conversation partners rather than autocomplete engines (Ouyang et al., 2022).
A short history of AI
Three stages are enough for intuition. First: for decades, rule-based expert systems and classical statistical learning methods dominated — explicit if-then logic on one side, models such as logistic regression on the other, for example in credit scoring. Second: from 2012 onward, deep learning took over — multi-layer neural networks that learn patterns from raw data on their own; the visible breakthrough came in image recognition (AlexNet, 2012). Third: in 2017, a Google team published the Transformer architecture (Vaswani et al., 2017) — the blueprint behind practically every modern language model. Its core mechanism, attention, lets the model focus on the relevant other words in a text while processing each word. Only this made language understanding at today's quality possible.
How an LLM generates text: tokens and probabilities
A Large Language Model (LLM) does not process text as words but as tokens — text fragments that are sometimes a whole word, sometimes only a syllable. "Return on equity," for instance, is split into several tokens. For each next token, the model computes a probability distribution over its entire vocabulary and samples from it.
An example: after the sequence "The ECB has ... its key interest rate," the model assigns high probabilities to "cut," "raised," and "left unchanged" — and very low ones to "baked." Which token gets chosen depends on a setting called temperature: at low temperature the model almost always picks the most likely token; at higher temperature it spreads out more. That is why you rarely get exactly the same answer to the same question twice.
An LLM does not answer the question "What is true?" but the question "What text is plausible here?". Most of the time the two coincide, but not always. Chapter 1.2 covers exactly the cases where they diverge.
The next token is a probability, not a fact
Adjust how much the model is allowed to vary its choice, then generate — and watch which token gets picked.
The limits of AI
The limits follow directly from the probabilistic character. An LLM is an extraordinarily strong tool for language tasks: summarizing, rephrasing, structuring, drafting, writing code, spotting patterns in text. It is, however, not a database (facts can be wrong), not a calculator (arithmetic emerges as text prediction, not computation — even though modern models increasingly call external tools for this), and no substitute for your own judgment. If you need a balance-sheet figure, look it up; if you need that figure explained, contextualized, or turned into a report draft, the LLM is the right tool.
Which models exist and when to use them
For a start, a rough map along two axes is enough. First, the model family: the relevant providers today are Anthropic (Claude), OpenAI (the GPT series), Google (Gemini), and open models such as Llama (Meta) or Mistral, which companies can run on their own infrastructure. Second, model size within a family: large models deliver the highest quality on complex analysis and writing tasks but cost more and respond more slowly. Small models suit simple, frequent tasks — classifying emails, for example. Rule of thumb: task complexity determines model size; data sensitivity determines the deployment form (cloud vs. own infrastructure — see Chapter 1.4).
The regulatory frame: first contact with the EU AI Act
In August 2024, the EU's AI Regulation (Regulation (EU) 2024/1689) entered into force. Two points suffice at this stage. First, the regulation classifies AI systems by risk, from minimal to prohibited, and attaches graduated obligations to each class. Second, Article 4 has obliged companies since February 2025 to ensure sufficient AI competence among their staff. Chapter 1.5 covers the AI Act in detail.
[CONCLUSION] If you have understood that an LLM optimizes plausibility rather than truth, you already hold the most important thinking tool of this course. Everything that follows, failure modes, prompt technique, data security, is a consequence of this one principle.
Further material
- Vaswani et al. (2017): Attention Is All You Need — the original Transformer paper
- 3Blue1Brown: video series Neural Networks / But what is a GPT? — visual intuition without formula overload