Videos
Short videos
The YouTube shorts published so far, with transcripts and links to the notion they cover.
An AI classifies your messages perfectly during training.
Can you trust it?
The book's trap, built on purpose: in training, incidents are long,
with a polite formula.
Information requests are short.
Two rules then work equally well: read the words…
or read the length.
Like a clever student who guesses the answer from the size of the question.
In the test, we flip it: short incidents, long requests.
And the three methods tested make exactly the same errors.
Why?
In training, the polite formula only appeared with incidents.
A clue just as convenient as the category itself.
The fix: change the data, not the model.
On 24 new messages, accuracy goes from 50% to 79.2%.
So, does your AI read the task…
or the length, the source, the date?
Only a test where the clue no longer follows the category can tell.
Chapter 4 of The Internal Mechanics of LLMs sets this trap and exposes it.
Subscribe so you don't miss the next one!
85% agreement between two humans… half of it by chance
Transcript
Two people label the same 100 texts.
They agree 85 times.
Is that a lot?
Labelling a text is like calling offside: you apply a written rule.
Two referees with the same rule should call the same fouls.
85% agreement.
But part of that agreement happens…
by chance.
Imagine two graders who read nothing and flip a coin.
They would agree once in two: 50%, by pure chance.
Cohen's kappa keeps only the agreement beyond chance.
85 minus 50, over 100 minus 50…
0.70.
And disagreements hide in borderline cases.
“The invoice is wrong”: an incident, or a request for information?
Two people may hesitate.
The solution: write the rule with its counter-examples, measure agreement,
and only then judge a machine.
A tool cannot be better than the definition of what you ask it.
So, when you hear that an AI “does as well as humans”…
which humans, and following which written rule?
Chapter 3 of The Internal Mechanics of LLMs builds this reference step by step.
Subscribe so you don't miss the next one!
Paris, an AI's 433rd answer… then 1st thanks to a single sentence
Transcript
Does an AI know the capital of France?
Let's test it, with a real model: GPT-2.
We give it the book's French sentence: “La capitale de la France est”,
the capital of France is.
And we look at which token it ranks first to continue.
Verdict: at the top, “a”, “la”, “un”…
And Paris?
In 433rd place.
A one in 4,000 chance.
Now let's add one single sentence before it: “La capitale de l'Allemagne est
Berlin”, the capital of Germany is Berlin.
And we ask exactly the same question again.
Paris jumps from 433rd to first place.
And right behind it…
Berlin.
The model learned nothing: its weights did not move.
Only the text changed.
A plausible explanation: it recognizes a pattern, this country, that capital,
and it extends it.
So, did the AI know the answer…
or did it just copy a shape?
To decide, you have to open the model and look inside.
Chapter 2 of The Internal Mechanics of LLMs runs this experiment,
and chapter 8 opens the model.
Subscribe so you don't miss the next one!
80% correct… and not a single incident detected
Transcript
An AI tool sorts customer service messages.
Score: 80% correct answers.
Good news?
Think of a mail sorter with two trays.
Incident: a breakdown, a blockage.
Information: a question about price or delivery time.
We test it on 10 messages: 8 information requests…
and only 2 incidents.
Now take a lazy tool that always answers “information” without reading anything.
Score: 8 out of 10.
80%, too!
Except the lazy tool never found a single incident.
Exactly what the service wanted to avoid.
The fix: before discussing a score, compute the score of a trivial method,
the baseline, on the same messages.
If it already gets 80%, the tool learned nothing useful.
And first, write down the task's contract: what the tool receives,
the allowed answers, what counts as correct…
and what to do with doubtful cases.
So, is 80% good or not?
It depends on what the dumbest method does…
and on what you expected from the tool.
Chapter 1 of The Internal Mechanics of LLMs sets out this contract,
and chapter 3 builds the reference that says what is correct.
Subscribe so you don't miss the next one!
An AI judging an AI: can we trust it?
Transcript
To evaluate an AI, we increasingly ask another AI for its opinion.
Can we trust it?
That is the idea of the LLM judge.
You give it a set of criteria and two answers.
It picks the better one and explains why.
It is fast and cheap.
But it has its biases.
It often prefers the first answer it is shown: swap the order,
and its verdict may flip too.
It also sometimes confuses length with quality.
A few good practices: present the answers in both orders,
require the explanation before the score, and use a low temperature.
And if the judge is itself a model, who checks the judge?
Chapter 15 of The Mechanics of LLMs concludes with the evaluation of AI systems.
Subscribe so you don't miss what comes next!
Three models, four tools: why MCP simplifies everything
Transcript
To connect three models to four tools, how many connectors do you need to write?
12.
Without a standard, each model needs its own connector for each tool.
With m models and n tools, you need m times n.
It quickly becomes unmanageable.
MCP, the Model Context Protocol, acts as a universal plug, like USB-C.
Each tool is plugged in only once, and every application can use it.
With three models and four tools,
you go from twelve connectors to seven: three plus four.
But if an agent can plug into hundreds of tools,
how does it pick the right one without getting lost?
Chapter 14 of The Mechanics of LLMs presents MCP and agentic protocols.
Subscribe so you don't miss what comes next!
Answering from an unseen document: RAG and tools
Transcript
How can an AI answer questions about a document it never saw during training?
Thanks to RAG.
It is an open-book exam: instead of answering from memory,
the model first looks for the right passages in a collection of documents.
Three steps.
Retrieve: find the passages closest to the question.
Augment: add them to the context.
Generate: the model answers based on them.
And if RAG gives the model eyes, tools give it hands.
For 345 times 987, it is better to call a calculator than to guess.
The result: 340,515.
But if the retrieved passages are bad, can the answer still be good?
Chapter 13 of The Mechanics of LLMs presents RAG, tools and agents.
Subscribe so you don't miss what comes next!
Writing to think better: the chain of reasoning
Transcript
Why does an AI that writes down its reasoning make fewer mistakes in math?
A classic model tries to guess the answer directly.
A reasoning model first writes intermediate steps, like a student on scratch paper.
Every word it writes is a little more computation.
Writing the steps gives the model time to explore, to check, and to correct.
For example: three books at twelve dollars, paid with a fifty-dollar bill.
Step one: three times twelve, 36.
Step two: fifty minus thirty-six, 14.
The change is fourteen dollars.
But well-written reasoning is not proof: it can be wrong while looking convincing.
So, how do you check an AI's reasoning?
Chapter 12 of The Mechanics of LLMs presents reasoning models.
Subscribe so you don't miss what comes next!
Same question, new answer: the random draw and temperature
Transcript
Why does the same question sometimes give two different answers?
At each step, the model gives a probability to every possible word.
For example: hello, forty-five percent.
Hi, thirty-five.
Yo, twenty.
Then it draws at random according to these odds.
Temperature changes these odds.
Low, the favorite word crushes the others: safe but repetitive answers.
High, the odds get closer: more varied answers, but riskier ones.
With a temperature of zero point five, hello goes from 45 to 55 percent.
With a temperature of two, it drops to 39, and yo rises to 26.
So, for a medical assistant, and for writing a poem,
which temperature would you choose?
Chapter 11 of The Mechanics of LLMs details generation strategies.
Subscribe so you don't miss what comes next!
Teaching an AI to say no: alignment
Transcript
Showing good answers to an AI is not enough.
You also have to teach it what it should not say.
But how?
People are shown a question and two answers from the model.
Their task is simple: pick the better one.
Comparing is much easier than writing a perfect answer.
For example: explain the derivative to a high school student.
Answer A: the derivative measures how fast a quantity changes.
Answer B: it is a math nerd thing, not very useful.
The evaluators choose A.
Thousands of these choices are then used to train the model to prefer answers of
the first kind.
That is the idea behind RLHF, and more recent methods like DPO.
But an aligned model reflects the preferences of those who made the choices.
So, who should make them?
Chapter 10 of The Mechanics of LLMs explains alignment and its limits.
Subscribe so you don't miss what comes next!
A raw model continues, it does not answer: fine-tuning and LoRA
Transcript
Ask a raw model: what is the capital of France?
It may answer Paris.
Or it may continue with: what is the capital of Germany?
After pre-training, the model knows how to continue a text, not how to answer.
Supervised fine-tuning shows it pairs: an instruction, then the ideal answer.
It learns the behavior of an assistant.
We do not teach it new facts, but how to use what it already knows.
And here, the quality of the examples matters far more than their number.
To adapt a model without retraining everything, there is LoRA.
Instead of changing a matrix of about 16 million numbers,
you train two small matrices of about 32,000 numbers.
Like sticky notes in a textbook.
And if you can stick on several sets of notes,
can you keep one base model for several jobs?
Chapter 9 of The Mechanics of LLMs presents supervised fine-tuning and LoRA.
Subscribe so you don't miss what comes next!
140 GB for one model: why does it take so many GPUs?
Transcript
Why does it take dozens of graphics cards to train a large language model?
Let's do the math.
A model with seventy billion parameters, each stored on two bytes,
already weighs 140 GB.
An H one hundred card only has 80.
And that is only the weights.
To learn, it also has to keep the activations,
the gradients and the optimizer states.
The memory bill climbs even higher.
One card is no longer enough: the model alone already exceeds its memory,
before any learning begins.
Two answers.
Spread the work across several cards.
And reduce the precision of the numbers: computing in 16 bits instead of 32 halves
the space each number takes.
Same model, same numbers: at sixteen bits,
each one takes half the room it takes at thirty-two.
How far can we reduce the precision of the numbers before the model loses quality?
Chapter 8 of The Mechanics of LLMs details these training optimizations.
Subscribe so you don't miss what comes next!
Why doesn't AI know the news? | The cutoff date
Transcript
Ask an AI about this week's news.
Quite often, it does not know.
Why?
During pre-training, the model reads huge amounts of text while learning to guess
the next word.
But this reading stops on a specific date: the cutoff date.
After that, it knows nothing.
According to the Chinchilla study, about 20 tokens per parameter.
So a model with 70 billion parameters should read about 1.4 trillion tokens.
Adding new knowledge afterwards is not simple.
While learning a cooking recipe, the model could forget how to do an addition.
This is called catastrophic forgetting.
So, how can a model get recent information, without retraining it every time?
Chapter 7 of The Mechanics of LLMs explains pre-training and its limits.
671 billion parameters, 37 in use: mixture of experts
Transcript
A model with 671 billion parameters that only uses 37 billion for each word.
That is DeepSeek-V3.
How is that possible?
This is the mixture of experts.
The model contains many specialized networks.
For each word, a dispatcher, the router, picks the few experts that will process it.
The others stay idle.
Think of a large hospital.
At the front desk, each patient is sent to the right specialist.
The hospital knows a huge amount, but each patient only sees a few doctors.
The trap is a router that sends everything to the same expert.
That one gets overtrained, and the others become useless.
So a penalty is added to force the work to be shared.
One last question: if only 37 billion parameters work on each word,
does the model need less memory, or just less computation?
Chapter 6 of The Mechanics of LLMs describes the mixture of experts architecture.
Twice the text, four times the compute? | The cost of attention
Transcript
If you double the length of a text, does the work of attention double too?
No.
It is multiplied by four.
In attention, every word is compared with all the others.
With 8 words, that makes 64 comparisons.
With 16 words, 256.
The cost follows the square of the length.
For a model that reads entire books,
this square becomes a real wall of computation and memory.
One solution, used for example by Mistral, is the sliding window.
Each word only looks at its close neighbors,
like a flashlight that follows the reading instead of lighting up the whole stadium.
The cost now only grows in a straight line.
But if each word only sees its neighbors,
how can information from the beginning of the text still reach the end?
Chapter 5 of The Mechanics of LLMs explores these architecture optimizations.
BERT or GPT: read or write? | Encoder and decoder
Transcript
BERT and GPT come from the same invention: the Transformer.
Yet one is mainly for reading, and the other for writing.
Why?
The encoder reads the whole sentence at once, in both directions.
It is built to understand: classify a review, spot the name of a place or a person.
That is the BERT family.
The decoder writes one word after another, looking only at what came before.
Its exercise: guess the next word.
At a very large scale, that gave us GPT, LLaMA and Mistral.
Do you need a large generative model to sort customer reviews into positive and
negative?
Often, no.
A BERT-type model does it very well, and costs far less.
So, in a real system, why do we often combine the two: an encoder to search,
and a large model to write?
Chapter 4 of The Mechanics of LLMs presents these families of models.
How does AI know what “it” refers to? | Attention
Transcript
In the sentence “the cat drinks the milk because it is thirsty”,
how does a machine understand that the word it refers to the cat?
The Transformer does not read one word after another.
For each word, it looks at the whole sentence and asks which words it needs.
Then it gives each one a weight.
It is a bit like a library.
Your question is the query.
The labels on the books are the keys.
Their content is the values.
You compare the query with every key, then mostly read the books that match.
Here, the word it compares its query with the keys of the other words.
The strongest match is with cat.
So its meaning is enriched mostly by the meaning of cat.
But if all the words are read at the same time,
how does the model know that John eats the lion, and not the other way around?
Chapter 3 of The Mechanics of LLMs explains attention,
and the answer to this question.
Does AI really read your words? | Tokenization
Transcript
When you write to an AI, it does not really read your words.
It reads pieces of words, turned into numbers.
Before any computation, the text is cut into small units called tokens.
The phrase “Tokenization is useful” becomes four pieces, and each one gets a number.
The model only ever sees these numbers.
Why not whole words?
There are far too many, with every inflection and typo.
And single letters would make texts very long.
Pieces of words are the compromise.
A concrete consequence: AI services bill in tokens, not words.
And two different models do not necessarily split the same text the same way.
One last question: if one language is split into more pieces than another,
what happens to the cost, and to how much text the model can read at once?
Chapter 2 of The Mechanics of LLMs covers tokenization and embeddings in detail.
99.9% correct… and still useless? | Precision and recall
Transcript
Take a screening test for a rare disease.
Out of 1,000 people, only one is sick.
The test says everyone is healthy.
Is it a good test?
If you count its correct answers, it is right 99.9% of the time.
Almost perfect.
Except it missed the one person we were looking for.
The overall score is not enough.
When the test raises an alert, is it right?
That is precision.
Among the people who are really sick, how many does it find?
That is recall.
You need to look at both.
Another example: 100 emails, 20 of them scams.
The filter blocks 10, and 8 are real scams.
It is right 8 times out of 10.
But it lets 12 through: it only catches 8 out of 20.
So, which error is worse?
For a disease, missing a sick person is often worse than a false alarm.
For a spam filter, it is the other way around.
And in your field, which error costs the most?
Chapter 1 of The Mechanics of LLMs looks at these measures and their pitfalls.