Attention in transformers, step-by-step | Deep Learning Chapter 6

3Blue1Brown5 HN recommenders · 2024–2026
4.8M views · explainer · evergreen · Uploaded 2024-04-07

3Blue1Brown's visual walkthrough of the attention mechanism inside transformers, covering self-attention, multiple heads and cross-attention. It is chapter 6 of his deep learning series.

HN treats it as the go-to visual explanation of attention, recommended to people who find text-based transformer explainers hard to follow.

Watch on YouTube

8 comments from Hacker News

@rahimnathwani2024 · in “Visualizing Attention, a Transformer's Heart [video]”

He lists Ring Attention and half a dozen other techniques, but they're not within the scope of this video: [VIDEO]

@lolinder2024 · in “YouTube seems to once again be rolling out its widely hated new web redesign”

Eh, insightful and thoughtful videos tend to have better comments than the low brow videos, but they're still not useful . The best of them read like a decent-but-not-great subreddit's comment thread. Taking one example, 3Blue1Brown's Deep Learning series, episode 6. Here are the top few comments [0]: > I'm a university lecturer with a PhD in AI, and I cannot compete with the quality of this work. Videos like this put the entire higher education system to shame. Fantastic! This is a nice comment, but doesn't contribute anything to my day. I'm sure the creator is glad to see it and I'm glad someone said it, but I don't need to read it. > Are you kidding me? ONE WEEK FOR 2 MASTERPIECES?! > Thank you so much! Same story. > I've got to say - "Attention Is All You Need" is an incredible title for a research paper. And now we're down to the reddit comments. > As a graduating PhD student working in Natural Language Processing, I still found that video to be extremely beneficial. Awesome! Nice. > 3b1b is the only content producer whose videos I start by first making coffee, then upvoting, then hitting the play button. Nice. > Attention existed before the 2017 paper "Attention Is All You Need". > The main contribution was that attention was... all you needed for sequence processing (you didn't need recurrence). Self-attention specifically was novel though. Finally a comment that contributed something. Not much, mind you (the video doesn't actually claim otherwise), but something . Unf

CriticalView on HN
@tomashm2024 · in “The Illustrated Transformer (2018)”

This is good, but what bade me finally understand the transformer architecture [0] and attention [1], are 3Blue1Brown's videos. 0. [LINK] 1. [VIDEO]

Strongly recommendsView on HN
@MAXPOOL2024 · in “The Engineer’s Guide to Deep Learning: Understanding the Transformer Model”

There are many others that are better. 1/ The Annotated Transformer Attention is All You Need [LINK] 2/ Transformers from Scratch [LINK] 3/ Andrej Karpathy has really good series of intros: [LINK] Let's build GPT: from scratch, in code, spelled out. [LINK] GPT with Andrej Karpathy: Part 1 [LINK] 4/ 3Blue1Brown: But what is a GPT? Visual intro to transformers | Chapter 5, Deep Learning [LINK] Attention in transformers, visually explained | Chapter 6, Deep Learning [VIDEO] Full 3Blue1Brown Neural Networks playlist [LINK]

RecommendsView on HN
@superkuh2024 · in “LLMs Aren't Thinking, They're Just Counting Votes”

> when an LLM tells us that the sun rises in the east, it's not because it truly understands astronomy or the solar system. Rather, it has seen the phrase "sun rises in the east" repeated so many times in its training data that this becomes the highest probability answer. It's less about understanding and more about pattern recognition. This is not too different from most human person's experience with basic education ( [LINK] ). Though it is obvious that humans can do more than that too. And while "voting" that may be a close-enough metaphor for the multi-layer perceptron layers, it is not what is happening in the attention layers. I suggest checking out 3blue1brown's videos on gradient descent [LINK] and "How might LLMs store facts" [LINK] versus how attention works [VIDEO]

RecommendsView on HN
@peterlai2025 · in “3Blue1Brown Follow-Up: From Hypothetical Examples to LLM Circuit Visualization”

About a year ago, I watched this 3Blue1Brown LLM tutorial ( [VIDEO] ) on how a model’s self-attention mechanism is used to predict the next token in a sequence, and I was surprised by how little we know about what actually happens when processing the sentence “A fluffy blue creature roamed the verdant forest.” A year later, the field of mechanistic interpretability has seen significant advancements, and we're now able to "decompose" models into interpretable circuits that help explain how LLMs produce predictions. Using the second iteration of an LLM "debugger" I've been working on, I compare the hypothetical representations used in the tutorial to the actual representations I see when extracting a circuit that describes the processing of this specific sentence. If you're into model interpretability, please take a look! [LINK]

@onlyrealcuzzo2026 · in “Claude Opus 4.8”

Because it doesn't work like how you think at all. You're still thinking it works like Chain of Thought. It doesn't. And the difference is key! It works by introducing probabilistic noise, and exploring N paths fully (each with noise) in parallel (all compressed). It's reasoning at a much, much smaller (probabilistic) level than running everything through the expensive large model (deterministic) and sometimes catching that it said, "I think 1.12 is greater than 1.9 because 12 is bigger than 9, final answer". The easiest way to think about it is: if you understand how hyper words work, it's as if it's searching for different versions of the hyper words that probilisticslly would lead to better outcomes IF it fed them to the LLM before it even does. That's not actually how it works exactly. But I think it is close enough to be helpful to understand where the gain is, a rough idea of what's happening (searching paths), and how it can potentially have huge orders of magnitude improvements (doing so without paying the full price of exploring the paths through the expensive and huge model). And also why it is so much harder to determine what it's "thinking". If you aren't familiar with hyper words, this is an amazing series: [VIDEO] The general idea is that a token is a multidimensional vector to represent a word -> think like "man" is a [noun, singular, English, pronoun, masculine, contemporary, ...]. Each time is sees a new word, it mutates this word to mean some new token (ofte

Strongly recommendsView on HN
@wren69912026 · in “Can I Buy Your KV Cache?”

If you want the actual maths instead of handwaving, I recommend: [LINK] For something gentler, 3Blue1Brown: [VIDEO] (this is part of a series)

RecommendsView on HN