Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · AI · Neurons to a language model · about 18 min to read

Watch: Attention from scratch: the mechanism that ate the field
▶ VideoPlay it as a journeyTutor comes with a plan

RNNs and LSTMs

Attention and the Transformer
Attention and the Transformer · Open board

The Attention and the Transformer board opens on a translation machine that reads one word at a time and forgets the beginning of long sentences. This lesson is that machine, and the repair that nearly saved it.

Before you start. From What a Neural Network Is you need one unit: inputs multiplied by weights, added up, then passed through an activation. From How It Learns (loss, gradient descent, backprop) you need backpropagation: when the answer is wrong, the blame is handed backwards through the network, multiplied by each weight it crosses on the way. From Tokens & Embeddings you need one fact: every word becomes a list of numbers before the machine sees it.

Lesson 8 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • A sentence has no fixed length, and the network wants one
  • 1990, San Diego: the hidden state, a note carried from word to word
  • 1991, Munich: the vanishing gradient, blame that fades to nothing
  • 1997: the LSTM’s cell state, a second note nobody rewrites
  • Gates: three dials that decide keep, write, and show
  • 2014: one reader, one writer, and one note between them
  • What does one word do to the slip?
  • How fast does the blame fade?
  • What does the pinned card do at one word?
  • All of it in code

Terms it explains: Attention and the Transformer, hidden state, recurrent neural network, RNN, vanishing gradient, cell state, LSTM, gate, weight, attention matrix, causal mask, cross-attention, feed-forward (FFN/MLP), layer norm, multi-head, O(n²), positional encoding, Query/Key/Value, residual connection, scaled dot-product attention, self-attention, stack of N blocks, transformer block.

Related papers

Review AI