Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
Large Language Models
·
Module 2
The Core Attention Mechanism
1
The ABCs of Attention: Query, Key, and Value
Define the roles of query, key, and value vectors in the attention mechanism.
2
Dot Products and Token Relevance
Explain how dot products between queries and keys measure token relevance.
3
Scaled Dot-Product Attention Calculation
Compute scaled dot-product attention given Q, K, and V matrices, including the application of softmax to convert scores into a probability distribution.
4
Scaling Dot Products for Stable Softmax
Explain why the dot products are scaled by the square root of the key dimension to prevent softmax saturation and vanishing gradients.
5
Implementing Causal Masking in Autoregressive Models
Explain how causal masking is implemented to prevent attention to future tokens in autoregressive models.
Previous module
Foundations of Text Representation
Next module
Building the Transformer Block