Transformers and Attention Explained: How AI Reads Every Word at Once

Business Pill 46 · The design behind today’s huge models

Attention lets a model read every word at once and weigh which other words matter most. That is the power of the transformer, and its bill.

A short explainer video. The numbers in it are round numbers for illustration.

The Short Answer

A model that reads one sentence one word at a time has half forgotten the start by the time it reaches the end.

The fix was a new design: read every word at once, and for each word ask which other words matter most.

A Worked Example

Take the sentence โ€œShe sat on the bank of the river.โ€ Is bank a place for money, or the side of a river? Read one word at a time, the clue is half forgotten by the end.

Read all at once, bank looks hard at river, and the meaning is settled. That looking is called attention. The design built on it is the transformer.

Why the Design Scaled

Two things followed. Because every word is read at once, the work can be split across thousands of chips.

That is what made today’s huge models possible.

The Bill

But every word looks at every other word. So if you double the text, the work roughly quadruples.

Attention weighs every word against every other. That is its power, and its bill.

Bar chart: relative attention work of 1 for the original text and about 4 when the text is doubled
Doubling the text roughly quadruples the work, because every word looks at every other word. Rule of thumb from the video.

The One Question to Ask

  1. How much text do we really need to send?

How This Concept Connects

Layer 2 of 8 · Models & Training, on the Business Engineer Concept Map

  • Transformers and Attention builds on GPUs. Transformers read every word at once so the work splits across thousands of chips, the side-by-side sums GPUs are built for.
  • Transformers and Attention constrains Context Window. Attention weighs every word against every other, so doubling the text roughly quadruples the work a longer window must pay for.
  • Scaling Laws builds on Transformers and Attention. Reading every word at once let work spread across thousands of chips, which made today’s huge models and their scaling possible.
  • Embeddings builds on Transformers and Attention. Both lessons use the word bank to show meaning depends on context; embeddings turn that meaning into coordinates on a map.
Business Engineer framework
The Nine Layers of AI
The model layer of the AI stack.
See all 141 concepts on one map
Get the full Concept Map as a free poster.
Get the map

More Business Pills

Scroll to Top

Discover more from FourWeekMBA

Subscribe now to keep reading and get access to the full archive.

Continue reading

FourWeekMBA