Back to the lesson libraryMECHANISM · 13 MIN
M15.8 CONNECT THE MECHANISM

Follow one token through a transformer

Follow "a bird sings" through GPT-2 small, from token IDs to the scores that pick the next word, with the shape of every tensor along the way. Then see why long prompts get expensive.

LESSON OVERVIEW13 min lesson

Lesson overview

Follow "a bird sings" through GPT-2 small, from token IDs to the scores that pick the next word, with the shape of every tensor along the way. Then see why long prompts get expensive.

What you’ll explore

  • Trace a decoder-only transformer from token representations through contextual updates to vocabulary scores.
Suggest a correction

A precise note can make an explanation better.

Choose the scene and describe what needs attention. Download a feedback file to share through a channel you already use. This page does not send feedback or connect you with a reviewer.

The file includes this note, the scene title, and lesson metadata. Your saved progress and quiz responses are excluded. Download before leaving or reloading to keep your note.