Skip to content
M.U.N.U.O.Data × AI × Systems

Artificial Intelligence Foundations

Attention and Transformers

Module 7 of 10

Learning objectives

  • Explain the ideas behind attention and transformers.
  • Apply the ideas to the example and identify how you would check the result.

Concepts

Attention maps a query and keys to scores, normalizes the scores, and combines values using the resulting weights. Transformers use this operation alongside feed-forward layers and positional information.

Practical example

Select a token and inspect which other words receive weight. Treat the example weights as a teaching illustration.

Try the exercise
  1. Define the task. Select a token and inspect which other words receive weight. Treat the example weights as a teaching illustration.
  2. Identify the key idea. Attention maps a query and keys to scores, normalizes the scores, and combines values using the resulting weights.
  3. Check your decision. Describe an alternative and how you would compare its results.
Open the interactive lab

Knowledge check

What do attention weights control?

What does softmax do here?

Why include position information?