SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Visualizing and Understanding
Neural Models in NLP
Jiwei Li, Xinlei Chen, Eduard Hovy, and Dan Jurafsky
NAACL 2016, pages 681-691.
論文 コード TechTalks.tv
読み手: 岡崎 直観 (東北大学) (@chokkanorg)
第8回最先端NLP勉強会
※但し書きがある場合を除き,スライド中の図・表はLi+ (2016) の引用
本研究の貢献: DNNモデルの解釈
• 人間が設計した素性からなるモデルは解釈可能
• 例: 線形識別モデルにおける素性の重み
• 今や幅広いタスクでDNNが最高性能を達成
• 単語ベクトルや隠れ層などでモデルの解釈が困難に
• DNNは意味合成をどのように実現しているのか?
• 強調(intensification)や否定(negation)の取り扱い
• 文中の離れた場所の単語の意味の合成
• 文中の不要な要素(ストップワード)の除去
• 単語の顕著度(saliency)を可視化する手法を検討
• 分散: 文中の単語ベクトルの平均からの乖離度
• 偏微分: 解いているタスクへの単語ベクトルの貢献度
Li+ (2016) Visualizing and Understanding Neural Models in NLP 2
本研究で用いたタスク (1/2):
Stanford Sentiment Treebank (Socher+ 13)
• 句構造に5段階の評価ラベルが付与されたデータ
• 句構造を単語列に展開し,単語列から評価ラベル
を予測する問題に変換した
• 単語列からラベルを予測する方が一般的なため
• 実験設定
• 最適化: ミニバッチAdaGrad
• 次元数: 60 (入力層と隠れ層)
Li+ (2016) Visualizing and Understanding Neural Models in NLP 3
(Socher+ 2013)
モデル 5クラス 2クラス
RNN 0.429 0.850
LSTM 0.469 0.870
双方向LSTM 0.488 0.878
本研究で用いたタスク (2/2):
Seq2seqによる文生成
• 入力文をベクトルにエンコードして,同じ文をデ
コード(生成)するタスク(オートエンコーダ)
• エンコード/デコードにはLSTMを採用
• WMT’14コーパスの英語400万文(平均22.5単語)
を学習データとして利用
Li+ (2016) Visualizing and Understanding Neural Models in NLP 4
very good movie
very good movie
<EOS> very good movie
<EOS>
𝑥𝑥𝑡𝑡
ℎ𝑡𝑡
𝑦𝑦𝑡𝑡 = softmax 𝑊𝑊(𝑦𝑦𝑦)
ℎ𝑡𝑡
句ベクトルの可視化(次元削減なし)
• 強調(左): 特定の次元が強くなる傾向が見られる
• 否定(右): 特定の次元の反転が見られるが(枠線),
強調の場合と比べると傾向は不明瞭
• (読み手注)ベクトルを積極的に変換しているように見える
Li+ (2016) Visualizing and Understanding Neural Models in NLP 5
句ベクトルの可視化(t-SNE)
Li+ (2016) Visualizing and Understanding Neural Models in NLP 6
悪そうなクラスタ
not badが混ざっている (not good ≒ bad; not bad ≠ good)
文ベクトルの可視化(t-SNE)
Li+ (2016) Visualizing and Understanding Neural Models in NLP 7
主節がlikeで逆接を入れるとかなり
遠ざかる
主節がhateで逆接を入れた場合は,
あまり遠ざからない
単語ベクトルの分散による顕著度
• 文𝑆𝑆中の単語𝑖𝑖のベクトル𝒙𝒙𝑖𝑖の𝑗𝑗次元目𝑥𝑥𝑖𝑖,𝑗𝑗の顕著度
Var𝑆𝑆 𝑖𝑖, 𝑗𝑗 = 𝑥𝑥𝑖𝑖,𝑗𝑗 −
1
𝑆𝑆
�
𝑖𝑖′∈𝑆𝑆
𝑥𝑥𝑖𝑖′,𝑗𝑗
2
• 単語ベクトルも学習対象とする場合のみ利用可
• ベクトル合成過程などを可視化できない
Li+ (2016) Visualizing and Understanding Neural Models in NLP 8
文𝑆𝑆中の全単語ベクトル
の𝑗𝑗次元目の平均値
分散の可視化例:
評判を反映しそうな単語の顕著度が上昇
Li+ (2016) Visualizing and Understanding Neural Models in NLP 9
偏微分による顕著度(画像認識の場合)
ILSVRC 2013のテストセットに対して,どのピクセルがクラス分類に貢献したかを可視化
(物体の位置をアノテートしていないのに大体の位置が分かる!)
K Simonyan, A Veldaldi, A Zisserman. Deep Inside Convolutional Networks: Visualising Image
Classification Models and Saliency Maps. ICLR 2014.
Li+ (2016) Visualizing and Understanding Neural Models in NLP 10
偏微分による顕著度
• 文𝑆𝑆中の単語𝑖𝑖のベクトル𝒙𝒙𝑖𝑖の𝑗𝑗次元目𝑥𝑥𝑖𝑖,𝑗𝑗の顕著度
Grad𝑆𝑆 𝑖𝑖, 𝑗𝑗 =
𝜕𝜕𝑙𝑙(𝒙𝒙1 … 𝒙𝒙 𝑆𝑆 , �𝑦𝑦)
𝜕𝜕𝑥𝑥𝑖𝑖,𝑗𝑗
• 解釈: 確率推定値(スコア)の一次近似
𝑙𝑙 𝒙𝒙1 … 𝒙𝒙 𝑆𝑆 , �𝑦𝑦 ≈ 𝑙𝑙 𝑥𝑥𝑖𝑖,𝑗𝑗 + 𝑙𝑙′
𝑥𝑥𝑖𝑖,𝑗𝑗 𝛿𝛿𝑥𝑥 = 𝑙𝑙′
𝑥𝑥𝑖𝑖,𝑗𝑗 𝛿𝛿𝑥𝑥 + 𝑏𝑏
• 単語ベクトルの値を微小に(𝛿𝛿𝑥𝑥だけ)変化させるとき,ラ
ベル�𝑦𝑦の確率推定値(スコア)に大きな影響を与えるも
のを見つける
Li+ (2016) Visualizing and Understanding Neural Models in NLP 11
ラベル�𝑦𝑦を予測した際の
確率推定値またはスコア
一次までのテイラー展開 𝑥𝑥𝑖𝑖,𝑗𝑗を𝛿𝛿𝑥𝑥だけ動か
した時の影響度
定数項
誤差逆伝搬法で計算可
偏微分の可視化例(評判分析)
精度の高いモデル(双方向LSTM)の方がhateによりフォーカスしている
Li+ (2016) Visualizing and Understanding Neural Models in NLP 12
偏微分の可視化例(文生成)
(I like the movie through the plot is boring)
Li+ (2016) Visualizing and Understanding Neural Models in NLP 13
内容語の生成: 入力文の単語ベクトルを使う
機能語の生成: 直前の語(言語モデル)を使う
まとめ
• 単語の顕著度(saliency)を可視化する手法を検討
• 分散: 文中の単語ベクトルの平均からの乖離度
• 偏微分: 解いているタスクへの単語ベクトルの貢献度
• 言語処理のニューラルモデルの可視化の第一歩
• どの可視化方法が良いかは分からない
• ニューラルネットワークの比較検討はこれから
• 読み手の感想
• 文生成モデルの解析は興味深かった
• アテンションを可視化することとの関連性は?
Li+ (2016) Visualizing and Understanding Neural Models in NLP 14

Weitere ähnliche Inhalte

Was ist angesagt?

Active Learning 入門
Active Learning 入門Active Learning 入門
Active Learning 入門
Shuyo Nakatani
 
(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...
(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...
(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...
Masahiro Suzuki
 

Was ist angesagt? (20)

Word Tour: One-dimensional Word Embeddings via the Traveling Salesman Problem...
Word Tour: One-dimensional Word Embeddings via the Traveling Salesman Problem...Word Tour: One-dimensional Word Embeddings via the Traveling Salesman Problem...
Word Tour: One-dimensional Word Embeddings via the Traveling Salesman Problem...
 
ブラックボックスからXAI (説明可能なAI) へ - LIME (Local Interpretable Model-agnostic Explanat...
ブラックボックスからXAI (説明可能なAI) へ - LIME (Local Interpretable Model-agnostic Explanat...ブラックボックスからXAI (説明可能なAI) へ - LIME (Local Interpretable Model-agnostic Explanat...
ブラックボックスからXAI (説明可能なAI) へ - LIME (Local Interpretable Model-agnostic Explanat...
 
[DL輪読会]BERT: Pre-training of Deep Bidirectional Transformers for Language Und...
[DL輪読会]BERT: Pre-training of Deep Bidirectional Transformers for Language Und...[DL輪読会]BERT: Pre-training of Deep Bidirectional Transformers for Language Und...
[DL輪読会]BERT: Pre-training of Deep Bidirectional Transformers for Language Und...
 
全力解説!Transformer
全力解説!Transformer全力解説!Transformer
全力解説!Transformer
 
KDD Cup 2021 時系列異常検知コンペ 参加報告
KDD Cup 2021 時系列異常検知コンペ 参加報告KDD Cup 2021 時系列異常検知コンペ 参加報告
KDD Cup 2021 時系列異常検知コンペ 参加報告
 
[DL輪読会]Model soups: averaging weights of multiple fine-tuned models improves ...
[DL輪読会]Model soups: averaging weights of multiple fine-tuned models improves ...[DL輪読会]Model soups: averaging weights of multiple fine-tuned models improves ...
[DL輪読会]Model soups: averaging weights of multiple fine-tuned models improves ...
 
Active Learning 入門
Active Learning 入門Active Learning 入門
Active Learning 入門
 
PRML学習者から入る深層生成モデル入門
PRML学習者から入る深層生成モデル入門PRML学習者から入る深層生成モデル入門
PRML学習者から入る深層生成モデル入門
 
[DL輪読会]Pay Attention to MLPs (gMLP)
[DL輪読会]Pay Attention to MLPs	(gMLP)[DL輪読会]Pay Attention to MLPs	(gMLP)
[DL輪読会]Pay Attention to MLPs (gMLP)
 
【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?
 
言語と画像の表現学習
言語と画像の表現学習言語と画像の表現学習
言語と画像の表現学習
 
AdaFace(CVPR2022)
AdaFace(CVPR2022)AdaFace(CVPR2022)
AdaFace(CVPR2022)
 
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
 
マルチモーダル深層学習の研究動向
マルチモーダル深層学習の研究動向マルチモーダル深層学習の研究動向
マルチモーダル深層学習の研究動向
 
[DL輪読会]Flow-based Deep Generative Models
[DL輪読会]Flow-based Deep Generative Models[DL輪読会]Flow-based Deep Generative Models
[DL輪読会]Flow-based Deep Generative Models
 
SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜
SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜
SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜
 
正準相関分析
正準相関分析正準相関分析
正準相関分析
 
Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
 
(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...
(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...
(DL hacks輪読) How to Train Deep Variational Autoencoders and Probabilistic Lad...
 
変分ベイズ法の説明
変分ベイズ法の説明変分ベイズ法の説明
変分ベイズ法の説明
 

Andere mochten auch

Andere mochten auch (10)

Modeling missing data in distant supervision for information extraction (Ritt...
Modeling missing data in distant supervision for information extraction (Ritt...Modeling missing data in distant supervision for information extraction (Ritt...
Modeling missing data in distant supervision for information extraction (Ritt...
 
Pennington, Socher, and Manning. (2014) GloVe: Global vectors for word repres...
Pennington, Socher, and Manning. (2014) GloVe: Global vectors for word repres...Pennington, Socher, and Manning. (2014) GloVe: Global vectors for word repres...
Pennington, Socher, and Manning. (2014) GloVe: Global vectors for word repres...
 
Learning to automatically solve algebra word problems
Learning to automatically solve algebra word problemsLearning to automatically solve algebra word problems
Learning to automatically solve algebra word problems
 
研究室における研究・実装ノウハウの共有
研究室における研究・実装ノウハウの共有研究室における研究・実装ノウハウの共有
研究室における研究・実装ノウハウの共有
 
Supervised Learning of Universal Sentence Representations from Natural Langua...
Supervised Learning of Universal Sentence Representations from Natural Langua...Supervised Learning of Universal Sentence Representations from Natural Langua...
Supervised Learning of Universal Sentence Representations from Natural Langua...
 
Word2vecの並列実行時の学習速度の改善
Word2vecの並列実行時の学習速度の改善Word2vecの並列実行時の学習速度の改善
Word2vecの並列実行時の学習速度の改善
 
単語・句の分散表現の学習
単語・句の分散表現の学習単語・句の分散表現の学習
単語・句の分散表現の学習
 
単語の分散表現と構成性の計算モデルの発展
単語の分散表現と構成性の計算モデルの発展単語の分散表現と構成性の計算モデルの発展
単語の分散表現と構成性の計算モデルの発展
 
深層ニューラルネットワーク による知識の自動獲得・推論
深層ニューラルネットワークによる知識の自動獲得・推論深層ニューラルネットワークによる知識の自動獲得・推論
深層ニューラルネットワーク による知識の自動獲得・推論
 
深層学習時代の自然言語処理
深層学習時代の自然言語処理深層学習時代の自然言語処理
深層学習時代の自然言語処理
 

Ähnlich wie Visualizing and understanding neural models in NLP

Dynamic Entity Representations in Neural Language Models
Dynamic Entity Representations in Neural Language ModelsDynamic Entity Representations in Neural Language Models
Dynamic Entity Representations in Neural Language Models
Shun Kiyono
 
20111207 勉強会のパターンを書いてみるワークショップ
20111207 勉強会のパターンを書いてみるワークショップ20111207 勉強会のパターンを書いてみるワークショップ
20111207 勉強会のパターンを書いてみるワークショップ
Yasunobu Kawaguchi
 

Ähnlich wie Visualizing and understanding neural models in NLP (16)

Dynamic Entity Representations in Neural Language Models
Dynamic Entity Representations in Neural Language ModelsDynamic Entity Representations in Neural Language Models
Dynamic Entity Representations in Neural Language Models
 
All-but-the-Top: Simple and Effective Postprocessing for Word Representations
All-but-the-Top: Simple and Effective Postprocessing for Word RepresentationsAll-but-the-Top: Simple and Effective Postprocessing for Word Representations
All-but-the-Top: Simple and Effective Postprocessing for Word Representations
 
[DL輪読会]Attention InterpretabilityAcross NLPTasks
[DL輪読会]Attention InterpretabilityAcross NLPTasks[DL輪読会]Attention InterpretabilityAcross NLPTasks
[DL輪読会]Attention InterpretabilityAcross NLPTasks
 
Evaluating Visual Representations for Topic Understanding and Their Effect...
Evaluating Visual Representations for Topic Understanding and Their Effect...Evaluating Visual Representations for Topic Understanding and Their Effect...
Evaluating Visual Representations for Topic Understanding and Their Effect...
 
論文読み会 Enriching Word Vectors with Subword Information
論文読み会 Enriching Word Vectors with Subword Information論文読み会 Enriching Word Vectors with Subword Information
論文読み会 Enriching Word Vectors with Subword Information
 
Acl reading 2nd
Acl reading 2ndAcl reading 2nd
Acl reading 2nd
 
Learning Image Embeddings using Convolutional Neural Networks for Improved Mu...
Learning Image Embeddings using Convolutional Neural Networks for Improved Mu...Learning Image Embeddings using Convolutional Neural Networks for Improved Mu...
Learning Image Embeddings using Convolutional Neural Networks for Improved Mu...
 
日本語文章に対する 述語項構造アノテーション仕様の考察
日本語文章に対する述語項構造アノテーション仕様の考察日本語文章に対する述語項構造アノテーション仕様の考察
日本語文章に対する 述語項構造アノテーション仕様の考察
 
【2016.09】cvpaper.challenge2016
【2016.09】cvpaper.challenge2016【2016.09】cvpaper.challenge2016
【2016.09】cvpaper.challenge2016
 
Natural Language Processing (Almost) from Scratch(第 6 回 Deep Learning 勉強会資料; 榊)
Natural Language Processing (Almost) from Scratch(第 6 回 Deep Learning 勉強会資料; 榊)Natural Language Processing (Almost) from Scratch(第 6 回 Deep Learning 勉強会資料; 榊)
Natural Language Processing (Almost) from Scratch(第 6 回 Deep Learning 勉強会資料; 榊)
 
【DL輪読会】Non-Linguistic Supervision for Contrastive Learning of Sentence Embedd...
【DL輪読会】Non-Linguistic Supervision for Contrastive Learning of Sentence Embedd...【DL輪読会】Non-Linguistic Supervision for Contrastive Learning of Sentence Embedd...
【DL輪読会】Non-Linguistic Supervision for Contrastive Learning of Sentence Embedd...
 
深層学習による自然言語処理の研究動向
深層学習による自然言語処理の研究動向深層学習による自然言語処理の研究動向
深層学習による自然言語処理の研究動向
 
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
[DLHacks 実装]Network Dissection: Quantifying Interpretability of Deep Visual R...
 
2015 08 survey
2015 08 survey2015 08 survey
2015 08 survey
 
20111207 勉強会のパターンを書いてみるワークショップ
20111207 勉強会のパターンを書いてみるワークショップ20111207 勉強会のパターンを書いてみるワークショップ
20111207 勉強会のパターンを書いてみるワークショップ
 
Vision and Language(メタサーベイ )
Vision and Language(メタサーベイ )Vision and Language(メタサーベイ )
Vision and Language(メタサーベイ )
 

Visualizing and understanding neural models in NLP