Module 1 · foundation

What is an LLM?

We'll start at the basics. What are these Large Language Models, how do they differ from “classic AI”, and why does the core trick, predicting the next chunk of text, work so stunningly well? At the end of this module you can explain in one sentence what an LLM is, and you'll have seen it for yourself in a tokenizer.

What you'll learn: the AI landscape (AI → ML → DL → LLM), the core trick, tokens and embeddings, computing with meaning, scale and emergent behaviour.

LLM fundamentals

Lesson 1.1: The AI landscape

Goal: know where “LLM” fits in the broader AI field, so that terms don't get muddled.

In the standard literature, an LLM sits in four nested boxes. From broad to narrow:

AI
Broad term, anything that simulates “intelligent behaviour”. A chess program from 1990 is also AI.
Machine Learning (ML)
Systems that learn patterns from data, instead of explicit rules. Risk models on a large registry (like SCORE2) belong here.
Deep Learning (DL)
Machine Learning with deep neural networks, many layers, millions to billions of tunable parameters. AI-ECG and AI-echo sit here.
LLM
Deep Learning applied to language. Trained on enormous text corpora; ChatGPT, Claude, Gemini and DeepSeek are publicly accessible examples.
Four layers, from broad to narrow
AIchess program, anything that looks ‘intelligent’
Machine LearningSCORE2: patterns from data, not a language model
Deep LearningAI-ECG, AI-echo
LLMChatGPT, Claude, Gemini: predicting language

Practical consequence: if someone says “we do AI on the ward”, the first sensible follow-up question is, which layer exactly? A hand-tuned risk model is something very different from a generative text model.

Questions for lesson 1.1

1. Which statement is true about the relationship between AI, ML, DL and LLM?

2. A colleague says: “our department uses AI” and turns out to mean a 10-variable risk model à la SCORE2. What is a correct characterisation?

Lesson 1.2: The core trick in one sentence

Goal: the same sentence as an anchor for everything that follows.

The entire operation of an LLM is in one sentence:

The core trick
An LLM is a statistical model that predicts the most likely next chunk of text, given everything that came before.

Three consequences that will keep returning throughout the course:

  • It doesn't “think”, it computes probabilities over the next text material.
  • It doesn't know anything personally, it has memorised patterns from its training data, not truth.
  • It doesn't hallucinate by accident, a fluent, plausible-sounding but incorrect answer is precisely how it works. More on that in module 5.

Why this matters for cardiologists

An LLM can answer “what's the ESC class for PET-CT in prosthetic valve endocarditis?” with a fluent, structured answer including a fictitious chapter and table number that doesn't exist. Not because it “lies”, but because it can statistically reproduce the form of such a citation well. That's why providing source instead of asking source will soon be the most important prompt principle.

Questions for lesson 1.2

3. What is the core trick of an LLM?

4. An LLM invents a table number in a guideline. What's the best name for this?

Live exercise: feel the core trick yourself

Open an empty chat and type literally this (without further context):

Finish this sentence, as naturally as possible in a medical context: “My patient is suffering from …”. Then give 5 possible next words with estimated probability (indicative only).

Goal: see that the model suggests words like “pain”, “shortness of breath”, “dizziness”, “headache”, no deep medical knowledge needed, just statistical frequency in its training corpus.

Lesson 1.3: Tokens, embeddings and vectors

Goal: know why an LLM doesn't actually see “words”, and what that means for your prompts.

An LLM doesn't process words the way you do. It sees tokens, sub-word chunks. “My patient is suffering from” becomes something like My · patient · is · suffer · ing · from, 6 tokens. Each token is then translated into a vector: a list of thousands of numbers (in GPT-4-class models around 12,288 dimensions) that captures “something” about that token.

The trick of training: the model learns to choose these vectors so that tokens with similar meaning lie close to each other in the high-dimensional space. “Chest pain”, “angina” and “thoracic complaints” end up close together, without anyone ever explicitly entering that. That's called an embedding.

Sentence → tokens → neighbours in meaning
My patient is suffer ing from
chest pain angina thoracic complaints knee

Close together: synonyms. Further away: a different organ. That is why “ST-segment elevation” often still works when you meant “ST elevation”.

Practical consequence for you

Synonyms often work well: you don't have to write exactly “ST elevation” if you mean “ST-segment rise”. But: very rare technical terminology or recently introduced abbreviations can stand isolated in vector space, then the answer drifts.

Questions for lesson 1.3

5. What is the smallest unit an LLM internally computes with?

6. Why does ChatGPT usually “understand” that chest pain and angina share the same domain?

Live exercise: see the tokens

Open OpenAI's tokenizer tool at platform.openai.com/tokenizer (free, no account needed for a test) or let the model do it itself:

Split the following sentence into tokens, as a typical LLM (such as GPT-4) would. Give the list of tokens numbered below one another: "A 62-year-old man with retrosternal pressing pain radiating to the left arm, since 40 minutes, with ST elevations in II, III, aVF."

Goal: notice that “retrosternal” and “ST elevations” can split into multiple tokens, which is why typos in such terms can sometimes throw the answer surprisingly off balance.

Lesson 1.4: Computing with meaning

Goal: understand why semantic search and RAG work (returns in module 2).

Because tokens are vectors, you can play with them using basic arithmetic. The classic from 2013: king − man + woman ≈ queen. It also works medically: cardiologist − heart + brain ≈ neurologist. What is a relationship in the real world turns out to be a direction in vector space.

Three practical applications, which will return in module 2:

  • Semantic search. A query “chest complaints” also finds documents with “thoracic pain”, without you entering that synonym.
  • RAG pipelines. Documents (guidelines, records) are stored in a vector database. On a question, the system pastes the most relevant pieces into the prompt, for the LLM that gives the answer.
  • “Chat with your PDF”. The technology behind “ask your ESC guideline” or “talk to this study”.
RAG in four steps (not the model ‘from memory’)
1 Your question, e.g. ESC in prosthetic valve endocarditis
2 Find the nearest passages in the guideline
3 Paste those passages into the prompt
4 The model answers from what is in the prompt now

Questions for lesson 1.4

7. What is “RAG” in one sentence?

Lesson 1.5: Scale and emergent behaviour

Goal: understand why this works so extremely well compared to 10 years ago.

Three orders of magnitude larger than ten years ago, that's what makes the current generation of LLMs different:

~1 trillion+ parameters (tunable weights) in GPT-4-class models (estimate)
15–30 trillion tokens of training data, virtually all digitally available text
~2,000 GWh per full training (≈ annual consumption of 700,000 households)

The surprising consequence is called emergent behaviour: at sufficient scale, capabilities appear that no one explicitly programmed. Translating between 100+ languages, simple reasoning steps, writing code, summarising clinical cases, none of that is literally in the training instructions.

What that means for you

What was “not quite” last year is often usable this year. GPT-3 (2020) failed on MedQA. GPT-4 (2023): above USMLE pass rate. Models in 2025–2026: 95%+ on comparable academic exams. Expect the norm to shift, and keep re-testing yourself, including use cases you thought last year were too complex.

Questions for lesson 1.5

8. What do researchers mean by “emergent behaviour” in LLMs?

9. What is a sensible attitude toward new LLM versions?

Live exercise: spot emergent behaviour yourself

Give a complex multi-step task no one explicitly “taught” the model. Paste this prompt:

Make a table with three columns: (1) clinical symptom, (2) top 3 cardiac differential diagnoses, (3) top 2 non-cardiac 'mimics'. Symptoms: - acute thoracic pain - syncope during exertion - new atrial fibrillation in a 35-year-old Then indicate in 3 sentences which of these three symptoms you feel least confident about for yourself, and why. Don't add a disclaimer, treat this as an educational exercise for a cardiologist.

Goal: notice that the model can both produce a correct table and reflect at a meta level on its own uncertainty, both capabilities that were impossible with GPT-3 (2020).

Take-home from module 1

1. One line

An LLM predicts the most likely next chunk of text. It doesn't think, knows nothing, but imitates language stunningly well.

2. Vectors

Tokens become vectors; synonyms lie close together. That's why it “understands”, and why RAG works.

3. Scale

What didn't work last year may work this year. Re-test your use cases regularly. But remain the safety layer yourself.