I stopped treating it as magic.

November 17, 2026

I wanted to understand how large language models work. Not the marketing version. The actual mechanics.

I found Google's Introduction to Large Language Models course. It was about an hour. Useful, well-paced. I got the badge.

But a course alone left me with terms I recognised and couldn't connect to anything real. So I went to ChatGPT straight after and used this prompt:

The prompt I used

I have just completed [course name] about [subject].
I recognise some of the terms, but I want to understand them by connecting them to a real example.
Use [product or feature] as our example. My current level is [describe your experience].
First, give me a short outline of how we will work through it. Then explain only the first step and wait for me to say "next."

For each step:

  • Explain what happens, using simple language.
  • Connect it to the same example.
  • Name the relevant concepts and explain what they contribute.
  • Distinguish documented facts about the product from general explanations or assumptions.
  • If a concept does not directly apply, explain that rather than forcing it into the example.

Let me explain my understanding in my own words. Tell me what I got right and correct specific mistakes before moving on. Do not ask a question at the end of every explanation.
After we cover the process, give me one small exercise that applies the concepts. Explain what the exercise will help me understand.

I gave it the course, a product to use as an example, and my current level. It walked me through the process one step at a time and checked my understanding at each one.

I chose Notion AI's text summariser as the example. What follows is my understanding of how a typical transformer-based summariser works. It is not a description of Notion's exact internal implementation.

Flowchart showing how a transformer-based LLM processes input and generates a summary

The full process, from input to summary. Each section below is one part of this.

First, we give it something to summarise

Imagine these are your meeting notes:

We planned to launch on Friday. Testing found a payment bug, so we moved the launch to Tuesday. Maya will fix the bug by Monday. Marketing stays paused until testing passes.

You ask the AI: "Summarise these notes."

There are two parts here. The instruction tells the model what to do. The notes give it the information to work with.

Those notes are part of its context for this request. The model doesn't need to be retrained to use them.

The text becomes numbers

Before the model can process the text, it needs to turn it into numbers.

First, the instruction and notes are split into small pieces called tokens. A token can be a whole word, part of a word, or punctuation.

Each token gets a numerical ID. The model then maps that ID to a list of numbers called an embedding. These numerical representations are what the model processes. Position information also helps it account for the order of the tokens.

So the preparation looks like this:

Text becomes tokens. Tokens get IDs. Those IDs are mapped to numerical representations.

The transformer processes the information

The representations pass through a transformer, a type of neural network with many processing layers.

One important operation inside these layers is attention. It combines information across tokens, helping the model process relationships within the text.

Take this sentence:

Marketing stays paused until testing passes.

"Until testing passes" tells us the condition for restarting marketing. Its relationship to "stays paused" matters.

Multi-head attention performs several attention calculations in parallel. I think of this as looking at relationships from different angles. The results are then combined.

Next comes a feed-forward network: another set of learned calculations that further processes the representation at each token position.

Attention and feed-forward processing repeat through many layers. The calculations use parameters — the internal numbers the model learned during training.

This processing helps the model generate an appropriate summary, but it does not guarantee that every important detail will survive.

The summary is generated one piece at a time

After processing the input, the model calculates scores for possible next tokens. Those scores are converted into probabilities, and a selection method chooses a token.

Suppose the first token is "Launch."

The model then uses the input and what it has generated so far to predict the next token. It keeps repeating this process, gradually forming something like:

Launch moved to Tuesday because of a payment bug. Maya will fix it by Monday. Marketing stays paused until testing passes.

The model generates the summary one token at a time. It does not select a complete, stored answer.

Generation stops when it produces an end-of-response token or reaches a configured output limit. The output tokens are decoded back into readable text.

If the application displays the text gradually as it arrives, that is called streaming.

A readable summary still needs checking

This was the most important part of the process for me: a summary can sound clear and still be wrong or incomplete.

For our meeting notes, I would check:

  • Did it preserve Tuesday as the new launch date?
  • Did it keep Maya's responsibility and Monday's deadline?
  • Did it explain that marketing stays paused until testing passes?
  • Did it add anything the notes did not say?

Leaving out the testing condition is an omission. Saying "the payment bug has been fixed" would be an unsupported claim — often called a hallucination.

A useful summary needs to be shorter while preserving the information people need to act correctly.

That is what this example helped me understand. The model uses patterns learned during training, together with the context we supply, to generate a summary. We then need to check whether that summary actually does the job.

The hour I spent watching the course gave me vocabulary. The prompt gave me understanding. And writing this down made both stick.

GitHub
LinkedIn