影片高階EN8.1 萬 次觀看
Build an LLM from Scratch 3: Coding attention mechanisms
看影片(在新分頁開啟原站)連到 YouTube・Sebastian Raschka
摘要
由 Sebastian Raschka 講解如何從零編碼大型語言模型的核心引擎——注意力機制。內容涵蓋無訓練權重的簡化版自注意力、引入可訓練權重的真實自注意力、因果注意力遮罩以防止偷窺未來詞元,以及多頭注意力的實作與效能比較。
This video demonstrates how to code attention mechanisms from scratch, covering self-attention, causal masking, dropout, and multi-head attention implementations using PyTorch.
摘要、重點與章節標題由語言模型整理,細節(誰說的、數字、先後)可能有誤;要引用請以原始內容為準。
重點
- 從零實作自注意力機制,包含計算注意力分數與權重。
- 加入因果遮罩與 Dropout 遮罩以符合現代 LLM 架構需求。
- 實作並比較多頭注意力與 PyTorch 內建版本的效能差異。
章節
依話題轉折切分,標題由 AI 產生
- 00:003.3.1 A simple self-attention mechanism without trainable weights
- 41:013.3.2 Computing attention weights for all input tokens
- 52:403.4.1 Computing the attention weights step by step
- 1:12:333.4.2 Implementing a compact SelfAttention class
- 1:21:003.5.1 Applying a causal attention mask
- 1:32:333.5.2 Masking additional attention weights with dropout
- 1:38:053.5.3 Implementing a compact causal self-attention class
- 1:46:553.6.1 Stacking multiple single-head attention layers
- 1:58:553.6.2 Implementing multi-head attention with weight splits
提到的工具與公司
適合誰看
適合希望深入理解 Transformer 架構原理並具備程式實作能力的開發者。
摘要依據
- 講者
- Sebastian Raschka
- 依據
- 人工字幕
為什麼排在這裡
- 人氣
- 0.45
- 新鮮
- 0.09
在主題頁與搜尋結果裡,名次由相關、人氣、新鮮三個分數決定;這一頁沒有搜尋的關鍵字,所以沒有相關分數。排序怎麼算
相關內容
- Coding a Transformer from scratch on PyTorch, with full explanation, training and inference.影片 ・ Umar Jamil ・ 2 小時 59 分 ・
- What I Learned From Implementing LLM Architectures From Scratch (And How to Get Started)影片 ・ Sebastian Raschka ・ 53 分鐘 ・
- Attention? Attention!文章 ・ Lilian Weng(部落格) ・
- A Visual Guide to Attention Mechanisms in LLMs - Luis Serrano, Data Hack 2025 with @Analyticsvidhya影片 ・ Luis Serrano Academy ・ 52 分鐘 ・
- A Visual Guide to Attention Variants in Modern LLMs文章 ・ Sebastian Raschka(部落格) ・
- Attention in transformers, step-by-step | Deep Learning Chapter 6影片 ・ 3Blue1Brown ・ 26 分鐘 ・
這個來源最近的內容
摘要由 AI 根據原文產生,可能有誤;完整內容請看原站。看影片(在新分頁開啟原站)
