Loading video...

Video Failed to Load

Go Home

You can literally type a sentence and watch a Transformer process it. This interactive explainer runs a GPT-style model in the browser and lets you follow the whole path: tokenization → embeddings → Q/K/V → attention → MLP → logits → next-token probabilities You can inspect attention maps, intermediate...

134,999 views • 20 days ago •via X (Twitter)

21 Comments

Sam's profile picture
Sam20 days ago

this visualizer is insane. actually seeing attention weights shift live makes the math click way faster than reading a paper

景哥|AI落地与智能体实践's profile picture
景哥|AI落地与智能体实践20 days ago

浏览器里交互式演示 Transformer 推理全过程,可看注意力图、调整采样参数。能把抽象的 Transformer 架构,变成可实时观察的完整链路。

Sapafy.com's profile picture
Sapafy.com20 days ago

5.6GB RAM?

Rob Parker's profile picture
Rob Parker20 days ago

Super cool! Thanks

Aditya | AI Infra's profile picture
Aditya | AI Infra19 days ago

Great @techNmak 🙌🏼 This'll definitely help people to understand how transformer architecture works internally.

anish's profile picture
anish19 days ago

typing a sentence and watching a transformer process it is such a good way to learn attention lol. does it show each head separately?

George's profile picture
George20 days ago

The masked self attention is really clear but I think you could make the multiple heads clearer, perhaps show some depth with slight 3d rather than a 2d plane for each head.

realMattAbrams's profile picture
realMattAbrams19 days ago

Looks awesome. Told my daughter that LLMs are essentially giant guided plinko machines. A bit of a oversimplification, but your explainer shows it action. Thanks for sharing it!

Aapakari's profile picture
Aapakari20 days ago

How faithful is the browser model to a real GPT?

Daniel Plays's profile picture
Daniel Plays19 days ago

the "watch" framing oversells it. you see static snapshots, not the actual compute happening.

晗BaiHoo's profile picture
晗BaiHoo20 days ago

wow amazing

Brjan | AI Builder's profile picture
Brjan | AI Builder20 days ago

that hands-on approach will really help demystify how transformers work

Harold Finch's profile picture
Harold Finch20 days ago

Would love to try

BitAres's profile picture
BitAres20 days ago

First experiment I'd try: swap one word and compare the attention maps.

Stevo Changa's profile picture
Stevo Changa20 days ago

Nice clean looks

Trillionaire on Transit's profile picture
Trillionaire on Transit20 days ago

Insane visualisation

Eleftheria Batsou's profile picture
Eleftheria Batsou19 days ago

Thank you for sharing this!! Have a great Sunday

Adrian Hsu's profile picture
Adrian Hsu19 days ago

the MLP step is where the diagram version always lost me. poking temperature and watching the next-token probs move is the useful part.

René Cannaò's profile picture
René Cannaò20 days ago

I'd start by changing one word and comparing the attention maps.

Joey D's profile picture
Joey D19 days ago

You guys make this for DVA at GT?

Crio Songo's profile picture
Crio Songo20 days ago

Nice, been wanting to inspect attention maps without spinning up a notebook. Browser-based is clutch.

Related Videos

New short course: Attention in Transformers: Concepts and Code in PyTorch. Last week we released a course on how LLM transformers work. This week, go deeper and learn about the technical ideas behind the attention mechanism, and see how to code it in PyTorch. This course is built with Joshua Starmer, Founder and CEO of StatQuest. The attention mechanism was a breakthrough that led to transformers, the architecture powering large language models like ChatGPT. Transformers, introduced in the 2017 paper: "Attention is All You Need" by Viswani and others, took off because of its highly scalable design. In this course, you’ll learn how the attention mechanism, a key element of transformer-based LLMs, works and implement it in PyTorch. You'll develop deep intuition about building reliable, functional, and scalable AI applications. What you will do: - Understand the evolution of the attention mechanism, a key breakthrough that led to transformers. - Learn the relationships between word embeddings, positional embeddings, and attention. - Learn about the Query, Key, and Value matrices, and how to produce and use them in attention. - Walk through the math required to calculate self-attention and masked self-attention to learn why and how they work. - Understand the difference between self-attention and masked self-attention and how one is used in the encoder to build context-aware embeddings and the other is used in the decoder for generative outputs. - Learn the details of the encoder-decoder architecture, cross-attention, and multi-head attention and how they are all incorporated into a transformer. - Use PyTorch to code a class that implements self-attention, masked self-attention, and multi-head attention. There're lots of exciting technical details in this course. Please sign up here:

Andrew Ng

132,544 views • 1 year ago