Transformer Architecture Explained: Attention Is All You Need | LLM Course #8
The paper that started the LLM revolution. In Lecture 8 of the LLM Masterclass: the 2017 Google paper "Attention Is All You Need" and its eight authors, why removing the RNN made training parallel, self-attention with queries, keys and values, scaled dot-product attention softmax(QKᵀ/√d)·V in Python, the full Transformer (6 encoder + 6 decoder blocks, 8 heads, positional encoding) and its results. 💻 Code for this lecture (branch lecture-08): https://github.com/programmingline/chotugpt/tree/lecture-08 Lecture 8 of 32 — LLM Masterclass · Module 1: How LLMs were invented ⚠️ ChotuGPT is a simplified teaching model. The 3-token, 2-number Q, K and V matrices are toy values for teaching. In this lecture: • June 2017: Vaswani, Shazeer, Parmar, Uszkoreit, Jones, Gomez, Kaiser, Polosukhin (NeurIPS 2017) • No recurrence: every word processed in parallel on GPUs • Self-attention: every word looks directly at every other word • Query, key, value and softmax(QKᵀ/√d)·V • Scaled dot-product attention in NumPy (weights 0.25 / 0.25 / 0.5) • Encoder × 6, decoder × 6, multi-head attention with 8 heads, positional encoding • 28.4 BLEU on English→German; base model trained in about 12 hours on 8 GPUs Chapters: 00:00 Lecture 7 quiz answer 00:09 Attention Is All You Need 00:18 June 2017: the paper and its authors 00:49 Everything at once: self-attention 01:12 The moment everything changed 01:19 Query, key and value 01:57 Self-attention in Python 02:18 The full Transformer 02:43 The results 03:05 Quiz 03:25 Recap & next lecture ✅ Lecture 7 quiz answer: B, look back at all the words and weigh how relevant each one is. ❓ Quiz: What did the Transformer remove? A) attention B) recurrence (reading word by word) C) training data. Comment your answer. I reveal it in Lecture 9! 👍 Like, subscribe and comment your quiz answer. ⏮ Previous: Lecture 7 — The attention idea ⏭ Next: Lecture 9 — The scaling bet: GPT-1 to GPT-3 Sources: A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, I. Polosukhin, "Attention Is All You Need", NeurIPS 2017 (arXiv:1706.03762). #LLM #Transformer #AttentionIsAllYouNeed…more
The paper that started the LLM revolution. In Lecture 8 of the LLM Masterclass: the 2017 Google paper "Attention Is All You Need" and its eight authors, why removing the RNN made training parallel, self-attention with queries, keys and values, scaled dot-product attention softmax(QKᵀ/√d)·V in Python, the full Transformer (6 encoder + 6 decoder blocks, 8 heads, positional encoding) and its results. 💻 Code for this lecture (branch lecture-08): https://github.com/programmingline/chotugpt/tree/lecture-08 Lecture 8 of 32 — LLM Masterclass · Module 1: How LLMs were invented ⚠️ ChotuGPT is a simplified teaching model. The 3-token, 2-number Q, K and V matrices are toy values for teaching. In this lecture: • June 2017: Vaswani, Shazeer, Parmar, Uszkoreit, Jones, Gomez, Kaiser, Polosukhin (NeurIPS 2017) • No recurrence: every word processed in parallel on GPUs • Self-attention: every word looks directly at every other word • Query, key, value and softmax(QKᵀ/√d)·V • Scaled dot-product attention in NumPy (weights 0.25 / 0.25 / 0.5) • Encoder × 6, decoder × 6, multi-head attention with 8 heads, positional encoding • 28.4 BLEU on English→German; base model trained in about 12 hours on 8 GPUs Chapters: 00:00 Lecture 7 quiz answer 00:09 Attention Is All You Need 00:18 June 2017: the paper and its authors 00:49 Everything at once: self-attention 01:12 The moment everything changed 01:19 Query, key and value 01:57 Self-attention in Python 02:18 The full Transformer 02:43 The results 03:05 Quiz 03:25 Recap & next lecture ✅ Lecture 7 quiz answer: B, look back at all the words and weigh how relevant each one is. ❓ Quiz: What did the Transformer remove? A) attention B) recurrence (reading word by word) C) training data. Comment your answer. I reveal it in Lecture 9! 👍 Like, subscribe and comment your quiz answer. ⏮ Previous: Lecture 7 — The attention idea ⏭ Next: Lecture 9 — The scaling bet: GPT-1 to GPT-3 Sources: A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, I. Polosukhin, "Attention Is All You Need", NeurIPS 2017 (arXiv:1706.03762). #LLM #Transformer #AttentionIsAllYouNeed