OPEN SLIDES IN A FULL WINDOW

MODULE 01 // 10:00

From Perceptrons to Self-Attention

Clara explains how language models connect words through numbers and attention, using high-school-level examples and original graphics.

YOUR GUIDE: Clara Wren

A 10-minute video with basic synthetic narration. Open the slides separately or read Clara’s script below. No coding or advanced math is required.

1. How AI connects words

Hi, I’m Clara Wren. You type a question, press Enter, and a paragraph appears. What happened between those two moments? Today we’ll build a useful picture of that process without advanced math. We’ll follow words as they become numbers, see how a model connects information, and ask what its answer actually proves. By the end, you should be able to explain attention to a friend using an ordinary sentence. You do not need to code along. You only need multiplication, curiosity, and a willingness to pause before accepting a convincing answer. One boundary before we start: we’re looking at a common kind of language model called a Transformer. Other designs exist. The glowing machine in this illustration is an artistic metaphor, rather than a picture of the actual software.

2. Text becomes numbers

A computer does not receive a sentence as an idea. First, a tokenizer breaks the text into pieces called tokens. A token might be a whole word, part of a word, or punctuation. Different tokenizers can divide the same sentence differently, so counting words is not a reliable token count. Each token gets a number ID, a little like a book’s location in a catalog. The model uses that ID to look up a vector, which is simply a list of numbers. Those numbers give the model something it can calculate with. Here is our simplified route: text, token pieces, IDs, then vectors. Later layers change those vectors using the surrounding text. The number assigned to a token is an address. A larger ID does not mean a more important word.

3. A neuron makes a weighted calculation

Let’s make one small piece of a neural network less mysterious. Imagine two input numbers, two and one. Give the first input a weight of one half, and the second a weight of negative one. Multiply each input by its weight, add the results, then add a bias of one quarter. Two times one half is one. One times negative one is negative one. Those cancel, leaving one quarter. An activation function then transforms the result. A simple example called ReLU keeps positive values and replaces negative values with zero. Our result stays one quarter. These numbers are invented for arithmetic practice. They are not a real language detector. A classical perceptron uses a threshold. Modern networks commonly use other activations and many connected calculations.

4. Training and answering are different jobs

Where do useful weights come from? During training, a model makes predictions, measures how far those predictions are from a target, and adjusts its parameters. Weights and biases are examples of parameters. Think of practicing a musical instrument and changing how you play after feedback. During ordinary answering, often called inference, the model uses the parameters it already has. Adding a sentence to a chat changes the information available in that conversation. It does not, by itself, retrain the model. An application can also save messages or retrieve documents, which is a separate operation. Here is a quick check: if you tell an assistant your favorite color, has that automatically changed its neural-network weights? No. It may use the message while it remains available in context.

5. Context changes what a word suggests

Look at these two scenes. A riverbank and a financial bank share a word, but suggest very different things. In the first sentence, river helps us interpret bank. In the second, deposited and money provide different clues. A language model needs a way to connect information across a sentence rather than treat every word as isolated. In older recurrent designs, a hidden state travels along the sequence one step at a time. That creates a dependency between steps. Transformers introduced a different architecture built around attention, allowing more parallel work across positions during training. Attention lets a position combine information from other allowed positions. Our picture illustrates the two meanings. It does not show the model’s actual internal representations, which are numbers rather than miniature landscapes.

6. Attention combines information

Attention has three roles with names you will hear often: query, key, and value. They are numerical representations produced by learned calculations. A query gets compared with keys to produce matching scores. A step called softmax turns the allowed scores into nonnegative weights that add up to one. The output mixes value vectors according to those weights. You can loosely imagine looking back through notes and giving some passages more influence than others. Keep the limit of that analogy in mind: the software is performing calculations. It is not deciding what to notice the way a person does. Different attention heads can learn different patterns. A large attention weight tells us about that calculation, but it does not independently show that a sentence is true.

7. A tiny attention example

Let’s use small numbers so we can check the idea ourselves. Suppose three allowed values are eight, four, and two. Suppose their attention weights are sixty percent, thirty percent, and ten percent. These weights are invented for this explanation. They did not come from a trained model. Multiply each value by its share: eight times point six is four point eight. Four times point three is one point two. Two times point one is point two. Add those contributions and we get six point two. That is a weighted blend. Real attention usually mixes whole vectors, or lists of numbers, instead of these single values. The same idea applies to each position in the output vector. Pause here if you like and check that the shares total one hundred percent.

8. The model cannot peek ahead

Imagine practicing next-word prediction with the sentence The cat sat. At the position containing The, the model should not be allowed to peek at cat or sat. At cat, it can use The and cat, but it should not see sat. A causal mask enforces that restriction in attention. Read the table one row at a time. Use means the position is allowed. Hidden means the mask blocks it. During training, the full example can already be available to the computer, and the mask still restricts what each position can use. This helps explain how training can compute many positions in parallel. Ordinary generation has a different dependency: after selecting a new token, the system can use that token when it computes the next one.

9. A Transformer repeats these building blocks

We have zoomed in on one operation, but a Transformer contains more. It uses multiple attention heads, feed-forward layers that transform representations, and other components that help information move through the network. Position information helps the model distinguish different word orders. Repeated blocks refine the representations, and a final calculation produces scores for possible output tokens. A decoding rule selects a token, appends it, and continues. Repeating that process can produce a sentence or a longer response. There is no single tiny neuron that stores every answer like a filing cabinet. Useful behavior comes from many learned computations working together. Our tour is intentionally simplified. You now have enough of the structure to ask better questions about what information the application supplies and how its answers should be tested.

10. A good answer still needs evidence

Let’s finish with three questions. What is a token? It is a unit from the tokenizer’s vocabulary, which might be a word piece or punctuation. What does attention do? It combines value representations using weights calculated from queries and keys, while respecting restrictions such as a causal mask. And does a fluent answer prove that it is correct? No. An answer can sound convincing while missing the evidence your task requires. Suppose a support assistant says every repair takes one hour. Ask which current policy supports that claim. Attention weights alone will not provide that verification. Today you followed text into numerical representations, checked a weighted blend, and explained why a model cannot peek ahead during causal prediction. I’m Clara Wren. Keep asking what the system used, what it computed, and how you can check the result.

Knowledge checks

Answer first, then reveal the explanation. These are self-checks, not an automatically graded assessment.

1. What is a token?

Reveal answer and explanation

A unit from a tokenizer’s vocabulary. It may be a word, a word piece, or punctuation.

2. Why does causal attention hide future positions?

Reveal answer and explanation

It prevents the model from using future tokens when learning to predict what comes next.

3. Does a fluent response prove factual correctness?

Reveal answer and explanation

No. Check the answer against relevant evidence.

What worked, and what to keep

You followed text into numerical representations, checked a weighted blend, and explained causal masking. Keep asking which information the application supplied and how you can verify the answer.

Sources and further reading

Bracketed numbers in the lesson refer to these primary papers and official documentation. The explanations, examples, experiments, and assessment are original teaching material.

// KEY ARCHITECTURAL TAKEAWAYS

  • Tokens turn text into units a model can represent with numbers.
  • Attention mixes information from allowed positions.
  • A convincing answer still needs evidence.