The attention mechanism is well known for its use in Transformers. But where does it come from? It’s origins lie in fixing a strange problems of RNNs.
Chapters
0:00 Introduction
0:22 Machine Translation
2:01 Attention Mechanism
8:04 Outro
The attention mechanism is well known for its use in Transformers. But where does it come from? It’s origins lie in fixing a strange problems of RNNs.
Chapters
0:00 Introduction
0:22 Machine Translation
2:01 Attention Mechanism
8:04 Outro
Chapters
0:00 Introduction
1:54 Neural N-Gram Models
6:03 Recurrent Neural Networks
11:47 LSTM Cells
12:22 Outro
An introduction to language modeling, followed by an explanation of the N-Gram language model!
Sources (includes the entire series): https://docs.google.com/document/d/1e…
Chapters
0:00 Introduction
1:39 What is NLP?
2:45 What is a Language Model?
4:38 N-Gram Language Model
7:20 Inference
9:18 Outro
https://www.youtube.com/watch?v=9-Jl0dxWQs8
AI Alignment forum post from the Deepmind researchers referenced at the video’s start:
https://www.alignmentforum.org/posts/…
Anthropic posts about superposition referenced near the end:
https://transformer-circuits.pub/2022…
https://transformer-circuits.pub/2023…
Some added resources for those interested in learning more about mechanistic interpretability, offered by Neel Nanda
Mechanistic interpretability paper reading list
https://www.alignmentforum.org/posts/…
Getting started in mechanistic interpretability
https://www.neelnanda.io/mechanistic-…
An interactive demo of sparse autoencoders (made by Neuronpedia)
https://www.neuronpedia.org/gemma-sco…
Coding tutorials for mechanistic interpretability (made by ARENA)
https://arena3-chapter1-transformer-i…
Sections:
0:00 – Where facts in LLMs live
2:15 – Quick refresher on transformers
4:39 – Assumptions for our toy example
6:07 – Inside a multilayer perceptron
15:38 – Counting parameters
17:04 – Superposition
21:37 – Up next
If you’re interested in the herculean task of interpreting what these large networks might actually be doing, the Transformer Circuits posts by Anthropic are great. In particular, it was only after reading one of these that I started thinking of the combination of the value and output matrices as being a combined low-rank map from the embedding space to itself, which, at least in my mind, made things much clearer than other sources.
https://transformer-circuits.pub/2021…
An early paper on how directions in embedding spaces have meaning:
https://arxiv.org/pdf/1301.3781.pdf
Timestamps:
0:00 – Who this was made for
0:41 – What are large language models?
7:48 – Where to learn more
This one is a bit more symbol-heavy, and that’s actually the point. The goal here is to represent in somewhat more formal terms the intuition for how backpropagation works in part 3 of the series, hopefully providing some connection between that video and other texts/code that you come across later.
For more on backpropagation:
http://neuralnetworksanddeeplearning….
https://github.com/mnielsen/neural-ne…
http://colah.github.io/posts/2015-08-…
https://colah.github.io/posts/2015-08-Backprop
The following video is sort of an appendix to this one. The main goal with the follow-on video is to show the connection between the visual walkthrough here, and the representation of these “nudges” in terms of partial derivatives that you will find when reading about backpropagation in other resources, like Michael Nielsen’s book or Chis Olah’s blog.
Video timeline:
0:00 – Introduction
0:23 – Recap
3:07 – Intuitive walkthrough example
9:33 – Stochastic gradient descent
12:28 – Final words
To learn more, I highly recommend the book by Michael Nielsen
http://neuralnetworksanddeeplearning….
The book walks through the code behind the example in these videos, which you can find here:
https://github.com/mnielsen/neural-ne…
MNIST database:
http://yann.lecun.com/exdb/mnist/
Also check out Chris Olah’s blog:
http://colah.github.io/
His post on Neural networks and topology is particular beautiful, but honestly all of the stuff there is great.
And if you like that, you’ll love the publications at distill:
https://distill.pub/