Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
金研究室 勉強会 『もう一度理解する Transformer(前編)』
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
winnie279
July 12, 2022
Science
0
120
金研究室 勉強会 『もう一度理解する Transformer(前編)』
もう一度理解するTransformer(前編), 中村勇士, 2022
winnie279
July 12, 2022
Tweet
Share
More Decks by winnie279
See All by winnie279
NowWay:訪⽇外国⼈旅⾏者向けの災害⽀援サービス
yjn279
0
16
「みえるーむ」(都知事杯Open Data Hackathon 2024 Final Stage)
yjn279
0
72
「みえるーむ」(都知事杯オープンデータ・ハッカソン 2024)
yjn279
0
77
5分で学ぶOpenAI APIハンズオン
yjn279
0
230
『確率思考の戦略論』
yjn279
0
150
Amazonまでのレコメンド入門
yjn279
1
180
もう一度理解するTransformer(後編)
yjn279
0
89
金研究室 勉強会 『U-Netとそのバリエーションについて』
yjn279
0
910
金研究室 勉強会 『Seismic Data Augmentation Based on Conditional Generative Adversarial Networks』
yjn279
0
110
Other Decks in Science
See All in Science
主成分分析に基づく教師なし特徴抽出法を用いたコラーゲン-グリコサミノグリカンメッシュの遺伝子発現への影響
tagtag
PRO
0
210
Kaggle: NeurIPS - Open Polymer Prediction 2025 コンペ 反省会
calpis10000
0
420
NDCG is NOT All I Need
statditto
2
2.9k
データベース06: SQL (3/3) 副問い合わせ
trycycle
PRO
1
730
Distributional Regression
tackyas
0
370
データマイニング - ノードの中心性
trycycle
PRO
0
350
Optimization of the Tournament Format for the Nationwide High School Kyudo Competition in Japan
konakalab
0
160
Accelerated Computing for Climate forecast
inureyes
PRO
0
160
(メタ)科学コミュニケーターからみたAI for Scienceの同床異夢
rmaruy
0
180
アクシズを探せ! 各勢力の位置関係についての考察
miu_crescent
PRO
1
110
白金鉱業Meetup_Vol.20 効果検証ことはじめ / Introduction to Impact Evaluation
brainpadpr
2
1.7k
知能とはなにかーヒトとAIのあいだー
tagtag
PRO
0
160
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Utilizing Notion as your number one productivity tool
mfonobong
4
250
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
140
Why Our Code Smells
bkeepers
PRO
340
58k
The SEO Collaboration Effect
kristinabergwall1
0
380
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
220
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
190
Transcript
もう一度理解する Transformer(前編) 金研 機械学習勉強会 2022/07/12 中村勇士
もう一度とは? • 『Attention is all you need』読みました ◦ 見返してみたら、約1年前でした(見たい方は こちら)
◦ 難しくてなかなか理解できず → リベンジします • Transformerとは? ◦ 2017年の自然言語処理モデル ◦ 高性能、様々な分野で使われる ・BERT → Google 翻訳 ・GPT-3 → 1ヶ月間ブログを書いたのに AIだと気づかれず ・ViT → 画像認識
Transformerまでの道のり • なぜ難しかったのか? ◦ 基本的にAttentionを知らなかった ◦ ほかの文章生成モデルを知らなかった • どうすれば良いか? ◦
まずは基本的なAttentionを理解する! ◦ ほかの文章生成モデルを知る! • RNN • Bi-RNN • Encoder-Decoder • Attention • Transformer • BERT or GPT-3 or ViT 機械学習勉強会で 出てきた 前半 RNNを不使用 後半以降 RNNを不使用
seq2seq(sequence to sequence) • 文章とは? ◦ 単語や句読点などの記号を順に並べたもの ◦ 時系列データの1つ →
地震波形・音波・株価など • 文章生成モデル ◦ 系列データから系列データへ ◦ ある文章から別の文章を生成(翻訳など) ◦ リアルタイム震度予測 • 文字をどうやって入力するの? ◦ 単語をベクトルに変換する ◦ IDを振るようなイメージ this is . a pen これ は ペン です 。 ID 単語 ベクトル 1 りんご [0, 0, 0, 1] 2 みかん [0, 0, 1, 0] …… …… …… 7 ばなな [0, 1, 1, 0] …… …… ……
• 前後の情報を持てる • 文字の説明 ◦ x:入力データ ◦ h:隠れ状態 ◦ W,
U:重み ◦ b:バイアス Bi-RNN(Bidirectional RNN) this h s is . a pen これ は ペン です 。 結合 以降の情報
• 文脈ベクトル(context vector)をもつ • 入力と出力を異なる長さにできる • 文字の説明 ◦ h:隠れ状態 ◦
y:出力 ◦ c:文脈ベクトル Encoder-Decoder this h t is . a pen <bos> これ は は これ 文脈ベクトル 1つ前の出力 隠れ状態
• 単語間の関係性に「注目」できる • 文脈ベクトルが可変長 ◦ 長い文章でも情報が失われない ◦ 時系列情報を取り込みやすい • 文字の説明
◦ h~ t :Attention適用後の隠れ層 ◦ h t :隠れ層 ◦ c :文脈ベクトル ◦ b :バイアス Attention this h s h t h~ t c is . a pen <bos> これ は は
• 単語間の関係性に「注目」できる • 文脈ベクトルが可変長 ◦ 長い文章でも情報が失われない ◦ 時系列情報を取り込みやすい • 文字の説明
◦ t :出力の時刻 ◦ τ :入力の時刻 ◦ h s :エンコーダの隠れ層 ◦ c :文脈ベクトル ◦ a :重み attention weights Attention this h s h t h~ t c a is . a pen <bos> これ は は Attention
• 単語間の関係性に「注目」できる • 文脈ベクトルが可変長 ◦ 長い文章でも情報が失われない ◦ 時系列情報を取り込みやすい • 文字の説明
◦ t :出力の時刻 ◦ τ :入力の時刻 ◦ h s :エンコーダの隠れ層 ◦ h t :エンコーダの隠れ層 ◦ a :重み Attention this h s h t h~ t c a is . a pen <bos> これ は は Attention
• 単語間の関係性に「注目」できる • 文脈ベクトルが可変長 ◦ 長い文章でも情報が失われない ◦ 時系列情報を取り込みやすい • まとめ
◦ AttentionはEncoder-Decoderに c(t)を加えたもの ◦ cは単語と単語の関係性から 文脈ベクトルを合成する Attention this h s h t h~ t c a is . a pen <bos> これ は は Attention
まとめ • Attentionまでのseq2seq ◦ 初期段階からRNNが利用されている → ただし並列計算はできない ◦ 文章全体の意味を持つ文脈ベクトルが使われている ◦
単語間の関係性に注目する Attentionが導入された • 今後の流れ ◦ 応用的なAttentionの理解 ◦ Transformer全体の理解 ◦ Transformerから派生した モデルの理解 this h s h t h~ t c a is . a pen <bos> これ は は Attention