<html lang=en><head><style> .article-container { width: 100%; font-family: Microsoft JhengHei,Helvetica Neue,Helvetica,Arial,sans-serif; } ul, ol { margin: 12px auto; max-width: 740px; color: #535150; line-height: 1.8; padding-left: 0px; } .graf--img { display: table; justify-content: center; align-items: center; text-align: center; color: gray; font-size: 14px; letter-spacing: 0px; margin: 10px auto 50px; width: 100%; position: relative; clear: both; } .graf--img.center img { width: 100%; max-width: 740px; margin: 10px auto 0px; display: block; margin: 0 auto; } .graf--img.full img { width: 100%; } .captionTheme__wrapper { width: 100%; font-style: normal; line-height: 22px; font-size: 16px; max-width: 600px; margin-top: 8px; display: inline-block; } .graf--img.full { max-width: 100%; margin: 40px 0px; display: block; margin: 0 auto; align-items: center; } .graf--figure { text-align: center; color: gray; font-style: italic; font-size: 15px; margin: 28px auto; box-sizing: border-box; } .graf--figure iframe { width: 100%; max-width: 740px; margin: 0 auto; } .graf--p { font-size: 16px; line-height: 1.8; font-family: Microsoft JhengHei fixed, Helvetica Neue ,Microsoft JhengHei, Helvetica, Segoe UI, Tahoma, Arial, sans-serif; letter-spacing: 1px; font-weight: 400; max-width: 740px; color: #535150; text-align: left; } .graf--p > a { color: #00B3C6 !important; text-decoration: none !important; } .graf--li > a { color: #00B3C6 !important; text-decoration: none !important; } .graf--quotesSpecial > a { color: #00B3C6 !important; text-decoration: none !important; } .graf--blockquote > a { color: #00B3C6 !important; text-decoration: none !important; } .graf--h1 > a { color: #00B3C6 !important; text-decoration: none !important; } .graf--h2 > a { color: #00B3C6 !important; text-decoration: none !important; } .graf--h3 > a { color: #00B3C6 !important; text-decoration: none !important; } a.graf--mention { color: #535150 !important; text-decoration: underline !important; font-weight: 700; } .graf--h2 { font-size: 24px; padding: 0; max-width: 740px; text-align: left; letter-spacing: 1px; font-weight: 700; margin-top: 34px; line-height: 1.5; } .graf--h3 { font-size: 18px; padding: 0; max-width: 740px; text-align: left; letter-spacing: 1px; font-weight: 700; margin-top: 28px; line-height: 1.5; } .graf--li { font-size: 16px; padding: 0px 0px 0px 4px; font-weight: 400; letter-spacing: 0px; list-style-position: outside; text-align:left; margin-left: 24px; } .graf--hr { width: 100%; margin: 0px auto; transform: translateY(-50%); position: relative; padding: 0px; text-align: left; max-width: 740px; margin: 0 auto; } .graf--hr hr { height: 0; } .graf--blockquote { padding: 10px 0px 10px 16px; font-size: 16px; color: #7A7574; letter-spacing: 1px; margin: 28px 0px; border-left: 4px solid #DDD9D8; width: 100%; max-width: 740px; text-align: left; } .graf--quotesSpecial { display: table; color: #7A7574; position: relative; padding: 31.5px 40px; text-align: center; letter-spacing: 0px; position: relative; margin: 29px auto; font-family: Microsoft JhengHei fixed, Helvetica Neue, Microsoft JhengHei, Helvetica, Segoe UI, Tahoma, Arial, sans-serif; font-size: 16px; -webkit-box-ordinal-group: 1; -webkit-box-flex: 0; } .embed-wrapper { max-width: 740px; border: 1px solid #DDD9D8; display: block; padding: 12px; border-radius: 8px; margin: 12px 0px; text-decoration: none !important; } .embed-title { font-size: 16px; font-weight: 700; color: #535150; margin-bottom: 8px; text-align: left; line-height: 1.5; text-decoration: none !important; } .embed-description { width: 100%; font-size: 14px; color: #7A7574; line-height: 1.5; max-height: 150px; text-align: left; overflow: hidden; padding: 12px 0px; } .embed-url > a { width: 100%; font-size: 14px; color: #141413 !important; text-decoration: none !important; line-height: 1.5; text-align: left; } .embed-thumbnail-wrapper { padding-left: 12px; } .embed-thumbnail { width:100px; border-radius: 8px; } pre { background: #F6F6F6; border-radius: 8px; padding: 16px; font-size: 16px; color: #535150; line-height: 180%; text-align: left; } .lexical__textBold { font-weight: bold; } .lexical__textItalic { font-style: italic; } .lexical__textUnderline { text-decoration: underline; } .lexical__textStrikethrough { text-decoration: line-through; } .lexical__textUnderlineStrikethrough { text-decoration: underline line-through; } .lexical__textSubscript { font-size: 0.8em; vertical-align: sub; } .lexical__textSuperscript { font-size: 0.8em; vertical-align: super; } .lexical__textCode { background-color: rgb(240, 242, 245); padding: 1px 0.25rem; font-family: Menlo, Consolas, Monaco, monospace; font-size: 94%; } </style></head><body><div class=article-container><p class=graf--p><a href=https://www.threads.net/intent/post?text=%E2%80%9C%E6%88%91%E6%83%B3%E8%A6%81%E4%B8%80%E5%A4%A9%E5%88%86%E4%BA%AB%E4%B8%80%E9%BB%9E%E3%80%8CLLM%E5%BE%9E%E5%BA%95%E5%B1%A4%E5%A0%86%E7%96%8A%E7%9A%84%E6%8A%80%E8%A1%93%E3%80%8D%EF%BC%8C%E4%B8%A6%E4%B8%94%E6%AF%8F%E7%AF%87%E6%96%87%E7%AB%A0%E9%95%B7%E5%BA%A6%E6%8E%A7%E5%88%B6%E5%9C%A8%E4%B8%89%E5%88%86%E9%90%98%E4%BB%A5%E5%85%A7%EF%BC%8C%E8%AE%93%E5%A4%A7%E5%AE%B6%E4%B8%8D%E6%9C%83%E5%A3%93%E5%8A%9B%E5%A4%AA%E5%A4%A7%EF%BC%8C%E4%BD%86%E6%98%AF%E5%8F%88%E8%83%BD%E5%A4%A0%E6%AF%8F%E5%A4%A9%E6%88%90%E9%95%B7%E4%B8%80%E9%BB%9E%E3%80%82%E2%80%9D%20%20%20%E2%80%94%E4%BE%86%E8%87%AALearnAI%E5%9C%A8LearnAI%E7%9A%84%E6%B2%99%E9%BE%8D%E7%9A%84%E7%AF%80%E9%8C%84%20%20https://vocus.cc/article/667e2eb6fd897800016200a4?utm_source=threads%26utm_medium=social%26utm_campaign=quoteshare target=_blank></a></p><p class=graf--p dir=ltr><span style=white-space: pre-wrap;>我想要一天分享一點「</span><b>從底層堆疊的技術</strong></b><span style=white-space: pre-wrap;>」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。</span></p><p class=graf--p><br></p><p class=graf--p dir=ltr><span style=white-space: pre-wrap;>目前我們已經完成:</span></p><ul class=lexical__ul><li value=1 class=graf--li>-Head Attention 數學說明:</span><a href=https://vocus.cc/article/667b7a06fd89780001c3a315 target=_blank>說書 - 從0開始 - 52</span></a></li><li value=2 class=graf--li>-Head Attention 數學說明:</span><a href=https://vocus.cc/article/667bac83fd89780001c77dbc target=_blank>說書 - 從0開始 - 53</span></a></li><li value=3 class=graf--li> 機制程式說明 - 輸入端:</span><a href=https://vocus.cc/article/667bac83fd89780001c77dbc target=_blank>說書 - 從0開始 - 53</span></a></li><li value=4 class=graf--li> 機制程式說明 - Query 端:</span><a href=https://vocus.cc/article/667cc5fcfd89780001d63a93 target=_blank>說書 - 從0開始 - 54</span></a></li><li value=5 class=graf--li> 機制程式說明 - Key 端:</span><a href=https://vocus.cc/article/667cc5fcfd89780001d63a93 target=_blank>說書 - 從0開始 - 54</span></a></li><li value=6 class=graf--li> 機制程式說明 - Value 端:</span><a href=https://vocus.cc/article/667ccb49fd89780001d6a75f target=_blank>說書 - 從0開始 - 55</span></a></li><li value=7 class=graf--li> 機制程式說明 - Query 、 Key 、 Value 結果:</span><a href=https://vocus.cc/article/667cd20dfd89780001d72f80 target=_blank>說書 - 從0開始 - 56</span></a></li><li value=8 class=graf--li> 機制程式說明 - Attention Score 計算:</span><a href=https://vocus.cc/article/667cdc8cfd89780001d80799 target=_blank>說書 - 從0開始 - 57</span></a></li><li value=9 class=graf--li> 機制程式說明 - Attention Score 正規化計算:</span><a href=https://vocus.cc/article/667d1c1ffd89780001dca70d target=_blank>說書 - 從0開始 - 58</span></a></li><li value=10 class=graf--li> 機制程式說明 - 輸出結果計算:</span><a href=https://vocus.cc/article/667e1247fd897800015fe9f1 target=_blank>說書 - 從0開始 - 59</span></a></li><li value=11 class=graf--li> 機制程式說明 - 輸出結果呈現:</span><a href=https://vocus.cc/article/667e2eb6fd897800016200a4 target=_blank>說書 - 從0開始 - 60</span></a></li></ul><p class=graf--p><br></p><p class=graf--p dir=ltr><span style=white-space: pre-wrap;>我們有始有終,做個整理:</span></p><div class=graf--img float><div class=lexical__imageWrapper><img src=https://images.vocus.cc/3bf276c5-fa3b-4158-8948-84297dd71e65.png data-src=https://d2a6d2ofes041u.cloudfront.net/resize?compression=6&norotation=true&url=https%3A%2F%2Fimages.vocus.cc%2F3bf276c5-fa3b-4158-8948-84297dd71e65.png&width=740&sign=o9oXzZTEj_AAUhT3TQBDBW9vL3m0oRQh9UZYiNHlK6o class=lazy data-original-src=https://images.vocus.cc/3bf276c5-fa3b-4158-8948-84297dd71e65.png data-lowquality=false data-width=764 data-height=512 alt=raw-image></div><div></div></div><ul class=lexical__ul><li value=1 class=graf--li><span style=white-space: pre-wrap;>回顧 </span><a href=https://vocus.cc/article/667b7a06fd89780001c3a315 target=_blank>說書 - 從0開始 - 52</span></a></li><li value=2 class=graf--li> 機制就是給定一排字,每個字有其對應向量 a</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>1</span></sup><span style=white-space: pre-wrap;>、a</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>2</span></sup><span style=white-space: pre-wrap;>、a</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>3</span></sup><span style=white-space: pre-wrap;>、a</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>4</span></sup><span style=white-space: pre-wrap;>,然後輸出向量 b</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>1</span></sup><span style=white-space: pre-wrap;>、b</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>2</span></sup><span style=white-space: pre-wrap;>、b</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>3</span></sup><span style=white-space: pre-wrap;>、b</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>4</span></sup></li></ul><p class=graf--p><br></p><p class=graf--p><br></p><p class=graf--p dir=ltr><span style=white-space: pre-wrap;>然後我現在經歷 </span><a href=https://vocus.cc/article/667b7a06fd89780001c3a315 target=_blank>說書 - 從0開始 - 52</span></a><span style=white-space: pre-wrap;> 至 </span><a href=https://vocus.cc/article/667e2eb6fd897800016200a4 target=_blank>說書 - 從0開始 - 60</span></a><span style=white-space: pre-wrap;> 的奮鬥得到:</span></p><div class=graf--img float><div class=lexical__imageWrapper><img src=https://images.vocus.cc/bb9c6546-ee5b-497a-824d-d69f155d05c3.png data-src=https://d2a6d2ofes041u.cloudfront.net/resize?compression=6&norotation=true&url=https%3A%2F%2Fimages.vocus.cc%2Fbb9c6546-ee5b-497a-824d-d69f155d05c3.png&width=522&sign=yXNnKyicx2pLEudEaZYCgAM9EOvCSaNz0QNNjNkb3os class=lazy data-original-src=https://images.vocus.cc/bb9c6546-ee5b-497a-824d-d69f155d05c3.png data-lowquality=false data-width=522 data-height=210 alt=raw-image></div><div></div></div><ul class=lexical__ul><li value=1 class=graf--li><span style=white-space: pre-wrap;>回顧 </span><a href=https://vocus.cc/article/667bac83fd89780001c77dbc target=_blank>說書 - 從0開始 - 53</span></a><span style=white-space: pre-wrap;> 說現在設定一個句子有三個字</span></li><li value=2 class=graf--li><span style=white-space: pre-wrap;>兩相對照知 b</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>1</span></sup><span style=white-space: pre-wrap;> = [1.9366 6.6831 1.5951] 、b</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>2</span></sup><span style=white-space: pre-wrap;> = [2.000 7.9640 0.0540] 、 b</span><sup style=white-space: pre-wrap;><span class=lexical__textSuperscript>3</span></sup><span style=white-space: pre-wrap;> = [1.9997 7.7599 0.3584]</span></li></ul><p class=graf--p><br></p><p class=graf--p dir=ltr><br></p></div></body></html>