Save this video free

Attention mechanisms

Mohit Iyyer · 1:12:56 · Watch on YouTube

Part of University of Maryland CMSC 723. See all 20 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Mohit Iyyer explains how self-attention addresses recurrent neural networks' vanishing-gradient, information-bottleneck, and sequential-computation problems. He derives query, key, and value projections, causal masking, and the matrix operations that let Transformers compute all token representations in parallel during training, while noting that autoregressive generation remains sequential.

Key takeaways

Chapters

0:00 Course Roadmap and Semester Project Expectations
3:15 Language-Model Training: Forward Pass, Loss, and Gradient Update
6:37 PyTorch Autograd and Cross-Entropy Loss
9:55 Optimizers, Training Batches, and Data Reuse
12:38 Why Cross-Entropy Produces a Q Minus P Gradient
21:05 RNN Matrix Products and the Vanishing-Gradient Problem
24:50 RNN State Bottlenecks and Sequential Computation
30:44 Attention Shortcuts and the Move to Self-Attention
37:05 Query, Key, and Value Projections from Token Embeddings
43:56 Dot-Product Attention Scores and Weighted Values
50:37 Causal Attention Prevents Future-Token Leakage
55:12 Batched Self-Attention with Matrix Multiplication and Masks
1:05:41 Training Parallelism Versus Sequential Autoregressive Decoding
1:10:44 Shared Attention Parameters and Missing Position Information

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:11 Okay. So let's get started everyone. Today we are going to start um talking about the basics underlying transformer language models um specifically the attention mechanism which is kind of the centerpiece of this architecture. we will kind of transition from recurrent neural networks which we talked about last time to um uh transformers and by the end of class on Wednesday hopefully we will have completed um you know everything we need to know about a transformer and we will move on to different ways that we can apply this architecture to training language models. we'll start talking about

0:58 scaling and um pre-training, post-training, a mixture of experts, things like that. So, that's kind of where we're going um in the next coming weeks. Uh before that, just a reminder that um the project groups have been formed now. So, um, we highly encourage you to get together with your group as quickly as possible to try and come up with some initial ideas and, um, you know, come discuss with anyone of, uh, the instructors, TAs or myself in our office hours if you have any questions on whether your project is appropriate, feasible, whatever. I just wanted to make a note that because we did get uh

1:46 quite a few questions about this in the office hours um that uh like a good project doesn't necessarily have to work like your idea doesn't have to get the greatest results or anything like that. We are mainly looking for effort like your does your project reflect an appropriate amount of work through the course of a semester? Um, and also kind of did you take the effort to try and understand in the case that you got a poor result, why your model is failing, what you would need to do um to address

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Mohit Iyyer.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.