L031 · How AI thinks · 2 min

Attention, in plain words

Attention is how a model decides which earlier words matter most for the word it is writing now.

01 · The idea

When a chatbot reads your message, it breaks it into tokens. To understand any one token, it looks back at all the others and asks: which of these help me make sense of this one?

Take the sentence "The cat sat on the mat because it was warm." To work out what "it" means, the model gives more weight to "mat" and "warm" and less to "the" or "on". That weighting is called attention.

Modern language models are built on a design called the transformer, and attention is its core trick. The model runs many attention steps in layers, each one picking up different links: grammar, meaning, who did what to whom.

This is why chatbots can follow long, messy messages. It also explains a weakness: attention gets spread thin over very long text, so small details can get less focus.

02 · Think of it like this

It is like reading with a highlighter. For every word, you quickly mark the few earlier words that explain it, and you read the word in light of those marks.

03 · Do it now

04 · Quick check

In simple terms, what does attention do inside a language model?