May the Neural Networks be with you

ニューラルネットワークと共にあらんことを

【外部発表】Learning to Faithfully Rationalize by Construction

こんにちは。@shunk031です。論文読み会で登壇したので、そのときの発表資料と概要、及び頂いた質問への回答*1を載せます。

イベント: ACL 2020 オンライン読み会

exawizards.connpass.com

登壇概要

タイトル:Learning to Faithfully Rationalize by Construction

Learning to Faithfully Rationalize by Construction

  • Sarthak Jain1, Sarah Wiegreffe2, Yuval Pinter2, Byron C. Wallace1
    • 1Khoury College of Computer Sciences, Northeastern University
    • 2School of Interactive Computing, Georgia Institute of Technology

自己紹介

  • 北田 俊輔 法政大学大学院 理工学研究科 D1 彌冨研 所属
    • 深層学習を元にした基礎・応用研究
      • 自然言語処理: 文字形状に着目・解釈性のあるモデル
        • YANS2019にて 奨励賞 を受賞
        • ACL2020 SRWにて共著の論文採択
      • 医用画像処理: 悪性黒色腫自動診断システムの構築
        • IPSJ2019にて 学生奨励賞 受賞
      • 計算機広告: 広告クリエイティブの評価・作成支援
        • KDD2019(データマイニングの最難関国際会議)にて論文採択
          • Attention可視化によるクリエイティブ作成支援

本論文を選択した理由

“Attention is not Explanation” と “Attention is not not Explanation” の著者らによる夢のコラボレーション

Attentionに説明性があるかを解析した論文[Jain+Wallace NAACL19; Wiegreffe+Pinter EMNLP19] の著者による深層学習モデルの予測に対する根拠を学習する手法を提案

本文から根拠を抽出してその根拠を元にタスクを解く新たな枠組みの提案

  • 予測の根拠をどのように抽出するかが気になった
  • 根拠抽出により短くなったテキストでどれくらいの精度でタスクを解くことができるのか

本研究の貢献

入力文から根拠を抽出し、その根拠を元に予測可能なニューラルテキスト分類の枠組みを提案

  • 先行研究のモデルは強化学習ベースのため学習が難しい
    • 強化学習を使わない枠組みでモデルを学習

      これまでの学習方法固有の複雑さを回避するために新たな学習手法を提案

  • 新たな学習手法 Faithful Rationale Extractionale from Saliency tHresholding (FRESH) を提案
    • 根拠を抽出する部分と根拠から予測する部分を別々に訓練可能にする (後述)

提案手法 FRESH に対して人手による評価を実施

導入: 深層学習モデルの予測に対する説明性

予測の説明性における”Faithfulness”と”Rationle”

Faithfulness (忠実)

“予測モデルによって示される根拠は、そのモデルが最終的にその予測に至るために使った情報を反映していれば 忠実 である” [Lipton Queue18] 入力文から取り出した一部分を根拠とし、それだけで正しく予測できるのなら、faithful な根拠と言える

Rationale (根拠)

“アノテータがテキストを分類する際にその判断に影響を与えた文字列を強調して表示するように求められる。このような手がかりを 根拠 と呼ぶ” [Zaidan+ NAACL07] 入力文から一部分を抽出して予測根拠としその根拠のみでどれくらい予測できるかを評価すべき

関連研究 | モデル説明手法における現状の問題点

  • 近年ではheatmapによる可視化が頻繁に利用されている
    • しかしこれらの手法は一般的に頑健ではなく忠実な説明を与えているとは言えない場合がある[Feng+ EMNLP18; Zhong+ 18; Jain+ NAACL19; Wiegreffe+ ACL19; Serrano+ EMNLP19; Brunner+ ICLR20; Pruthi+ ACL20]
  • 解釈可能性の文脈で分類・根拠提示モデルに求められるもの[Wiegreffe+ ACL19; Lei+ EMNLP16]
    • 分類モデル: 忠実さ (faltuful) & 尤もらしさ (plausibility)
    • 根拠提示モデル: 簡潔さ (short) & 一貫性 (coherent)
      • 加えて 包括性 (comprehensiveness) [Yu+ EMNLP19]
  • 忠実な根拠を示すようなモデルの提案 [Lei+ EMNLP16; Yu+ EMNLP19; Bastings+ ACL19]
    • 根拠を生成するgeneratorと根拠から予測するencoderをEnd-to-endで学習されるモデル➜ REINFORCEやRepara. trickを使う複雑なものばかり

関連研究 | 解釈可能性と説明可能性

  • “解釈可能性” の定義と特性に関する概要[Lipton Queue18; Doshi-Velez+ 17; Rudin NatureMI19]
  • モデルの予測に対する根拠の提示は次の3つに分けられる:[Lertvittayakumjorn+ EMNLP19]
    • 挙動を明らかにすること
    • 予測を正当化すること
    • 人間が不確実な予測を調査する際に支援すること
  • 人間に受け入れてもらえるような説明や解釈を与える手法
    • 非常にチャレンジングだが有益 [Rudin NatureMI19]
      • 忠実な説明は予測モデルモデルの根底にある意思決定プロセスを明らかにする手段を提供する

関連研究 | 人間による説明性の評価

  • 人間による評価
    • “ユーザーがある手法の結果を正しく予測できる場合、その手法は 解釈可能である と言える” [Kim+ NIPS16]
      • 人手による評価を実施している
    • 人間が根拠提示による合理性を好むかを検証 [Ehsan+ AIES18; Ehsan+ IUI19]

本研究ではこうした先行研究に倣って、根拠の解釈性や合理性について人手による評価を実施

Faithfulness through Discrete Rationale Selection

End-to-Endで予測根拠を抽出 [Lei+ EMNLP16]

先行研究: Rationalizing Neural Predictions [Lei+ EMNLP16]

  • GeneratorとEncoderによる予測根拠の抽出
    • Generator gen(xi): 入力テキスト xi から根拠 zi を抽出
    • Encoder enc(xi , zi): 入力テキストと根拠から予測
  • モデルの学習: REINFORCE [Williams ML92] で最適化
    • 考慮できる根拠の状態空間が大きいため分散が 大➜ 効率的に探索することは困難

提案手法: Faithful Rationale Extraction from Saliency tHresholding (FRESH)

End-to-Endで予測根拠を抽出しない枠組み

本研究: FRESH (Faithful Rationale Extraction from Saliency tHresholding)

  • REINFORCEによる学習の難しさを克服
    • あえてEnd-to-Endな枠組みにしないことで、一般的に困難な強化学習を元にした学習を回避する
  • 3つの独立したモデルから構成される枠組み
    • Supportモデル・Extractorモデル・Classifierモデル

End-to-Endで予測根拠を抽出しない枠組み

  • Supportモデル: supp(xi , yi)入力 xi と正解 yi から学習する。得られる重要度 si を取得
    • 様々な重要度算出手法が利用可能e.g., Attention, 勾配ベースの手法, LIME [Ribeiro+ KDD16]
  • Extractorモデル: ext(xi, si)
    • suppから得られた重要度を2値化しsnippet を取得➜ このsnippetを予測の根拠として扱う
      • 2値化はルールベースや学習モデルベースなどが適用可能
  • Classifierモデル: pred( )extから得られたsnippet を元に正解 yi を予測する➜ 本来の入力よりも短いテキストで予測可能

FRESHの実装

  • Supportモデル supp
    • ベースモデル: BERT, RoBERTa, SciBERT
    • 重要度算出手法: Attention, Gradient
  • Extractorモデル ext
    • 重要度を元に2つの根拠の取り出し方を考慮 (連続/非連続):
      • Contiguous (連続な根拠)
        • 重要度が最大になるよう連続したスパンを抽出
      • Top-k (非連続な根拠)
        • 重要度上位 k 個の単語を連続性関係なく抽出
  • Classifierモデル pred
    • すべてのモデルに共通して、BERT表現を使って分類

実験設定

  • 評価用データセット (5種)
    • Stanford Sentiment Treebank (SST): NLPer好きなやつ
    • AgNews: ニュース記事 (Science, Sports, Bussiness, World)
    • Evidence Inference (人手根拠有): 生体医療の科学記事
    • Movies (人手根拠有): 映画のレビュー
    • MultiRC (人手根拠有): 複数の正解があるデータセット
  • 学習方法の詳細
    • 比較手法はすべてBERTベースのモデルに変更
    • 異なるシード値で5回実験
      • 強化学習ベースのモデル (e.g., Lei+ EMNLP16) は性能の分散が大きいため

定量的評価 | 評価方法

  • 予測性能の評価
    • 比較手法
      • テキスト全文: 性能上限の目安。根拠を示す機構なし。
      • 提案手法: [CLS] のattentionを元に根拠部分を抽出
      • 強化学習モデルベース: [Lei+ EMNLP16]
      • 微分可能モデルベース: [Bastings+ ACL19]
    • 抽出する根拠の長さ
      • テキストから抽出する根拠部分が長くなるほど性能 大➜ 根拠の長さを k に固定して評価実験を実施
  • 性能変化: 根拠の長さ・人手による根拠の使用
    • 根拠の長さを変化させたときの性能評価
    • 人手による根拠を学習に使用したときの性能評価
      • 根拠を考慮した学習法 [Zhang+ EMNLP16; Strout+ BlackboxNLP19]

予測性能の評価

  • FRESHは入力文の10-30%程度でFull textに迫る予測精度
  • 抽出された根拠には予測を説明できる情報が含まれている
  • FRESHは先行研究 [Lei+ EMNLP16; Bastings+ ACL19] を超える予測精度
    • 性能の分散が小さく安定したパフォーマンス
  • Attentionベースの重要度スコアを用いたほうが精度は高い
  • 重要度スコアのtop-kを抽出するほうが精度は高い

根拠の長さを変化させたときの性能変化

  • FRESH と [Lei+ EMNLP16] を比較
    • 抽出する根拠の長さに関わらずFRESHが良い性能
    • 強化学習ベースの [Lei+ EMNLP16] は性能にばらつき有
      • 根拠の長さを長くすると提案手法と同程度
      • Evidence. Inv. においては性能悪化

人手による根拠を使用したときの性能変化

  • 人手による根拠の使用
    • Evidence InferenceとMultiRCは人手の根拠データが存在
      • ➜ この根拠を0%-100%使ったときの予測精度を比較
  • FRESH と [Lei+ EMNLP16] を比較
    • 人手根拠を多く使えば予測性能向上に多少寄与する可能性
    • 先行研究のモデルにおいても人手根拠は良い影響を与える

人手・Lei et al.・FRESHによる根拠抽出 in MultiRC

  • Query: What is the only difference between a reflection in a mirror and the actual image?
    • Answer: It is exactly the same.
    • Label: False
  • Human: You have seen your own reflection in a mirror. The person looking back at you looks just like you. Where does that reflected person appear to be standing ? Yes, they appear to be on the other side of the mirror. That is really strange to think about, but very cool. Have you ever waved at your reflection in a mirror? The reflected image will wave back at you. Here is something to try next time you stand in front of a mirror. Wave to your reflection with your right hand. What hand do you think the reflection will wave back with? The same hand? A different hand? You will notice something interesting. The reflection waves back with the hand on the same side as you, but it is their left hand. The image in a reflection is reversed. This is just like the image of the sign above. Light rays strike flat shiny surfaces and are reflected. The reflections are reversed.
  • Lei et al.: You have seen your own reflection in a mirror. The person looking back at you looks just like you. Where does that reflected person appear to be standing ? Yes, they appear to be on the other side of the mirror. That is really strange to think about, but very cool. Have you ever waved at your reflection in a mirror? The reflected image will wave back at you. Here is something to try next time you stand in front of a mirror. Wave to your reflection with your right hand. What hand do you think the reflection will wave back with? The same hand? A different hand? You will notice something interesting. The reflection waves back with the hand on the same side as you, but it is their left hand. The image in a reflection is reversed. This is just like the image of the sign above. Light rays strike flat shiny surfaces and are reflected. The reflections are reversed.
  • FRESH: You have seen your own reflection in a mirror. The person looking back at you looks just like you. Where does that reflected person appear to be standing ? Yes, they appear to be on the other side of the mirror. That is really strange to think about, but very cool. Have you ever waved at your reflection in a mirror? The reflected image will wave back at you. Here is something to try next time you stand in front of a mirror. Wave to your reflection with your right hand. What hand do you think the reflection will wave back with? The same hand? A different hand? You will notice something interesting. The reflection waves back with the hand on the same side as you, but it is their left hand. The image in a reflection is reversed. This is just like the image of the sign above. Light rays strike flat shiny surfaces and are reflected. The reflections are reversed.

人手評価

人手評価 | 評価視点と評価設定

人手評価の評価視点

  • Sufficiency
    • FRESHによる根拠を使って人間が予測できるか
  • Readability & Understandability
    • 仮定: 人間は単語レベルのばらばらな根拠よりも文レベルのまとまった根拠を好むのではないか
    • 一貫しているか・理解しやすいか

人手評価の設定

  • 評価データ
    • 人手根拠が予め付与されている Movies と MultiRC
    • 抽出した根拠に対して以下の質問をアノテータに示す:
      • 予測: Pos or Neg (Movie), True or False (MultiRC)
      • 確信度: 1 (not confident) ~ 4 (very confident)
      • 可読性: 1 (very difficult) ~ 5 (very easy)

人手評価 | 詳細

根拠の抽出方法

  • テストデータから100件ランダムに取得し根拠を抽出:
    • あらかじめ付与されている人手の根拠とする
    • 長さがkになるようランダムに選択して根拠とする
    • [Lei+ EMNLP16] で得られたものを根拠とする
    • FRESHで得られたものを根拠とする
  • アノテータによる人手評価の実施方法
    • Amazon Mechanical Turkを使用
    • アノテータ間のagreement
      • Movies: 84%, MultiRC: 89%
    • 1HITあたり0.24ドルでアノテータに依頼
      • 平均完了時間2分 (予備実験より) と時給7.20ドルに基づいて計算している
        • アノテータの英語力をテストして確認しているわけではない

人手評価 | Amazon Mechanical Turk上での評価

人手評価 | 評価結果

  • 人手根拠とモデルによる根拠が同等の精度を達成
  • 非連続な根拠 (non-contiguous) より、連続した根拠 (contiguous) を人間に見せたときに予測精度が高い➜ 人間は連続した根拠 (文) を強く好む傾向がある
  • FRESHのベストな結果は確信度や可読性が高い
  • FRESHは合理的な根拠 (faithful rationales) を示している

結論と所感

  • 予測モデルを説明可能にするFRESHを提案
    • さまざまな重要度算出手法が適用可能
    • シンプルな枠組みで先行研究の複雑なモデルを凌駕
    • FRESHによる根拠は人間にとっても良いものであった
  • 入力テキストのどの部分が重要かを示すことが可能
    • 根拠として抽出したテキストがタスクを解く上で重要であることを示せる
      • しかしなぜその部分が根拠として選ばれたかを解釈することはまだできていない

所感: Attentionに説明性はない (なくはない) の作者がattentionを重要度と見なして使っているのは筋が通っていない気がした タイトルでは “by Construction” だが 根拠を構築している感はなかった ➜ human in the loop 的なものを想像していた

参考文献

  • [Williams ML92] Williams, Ronald J. "Simple statistical gradient-following algorithms for connectionist reinforcement learning." Machine learning 8.3-4 (1992): 229-256.
  • [Zaidan+ NAACL07] Zaidan et al. "Using “Annotator Rationales” to Improve Machine Learning for Text Categorization." Proc. of NAACL-HLT 2007.
  • [Ribeiro+ KDD16] Ribeiro et al. "" Why should I trust you?" Explaining the predictions of any classifier." Proc. of KDD 2016.
  • [Zhang+ EMNLP16] Zhang et al. "Rationale-Augmented Convolutional Neural Networks for Text Classification." Proc. of EMNLP 2016.
  • [Lei+ EMNLP16] Lei et al. "Rationalizing Neural Predictions." Proc. of EMNLP 2016.
  • [Kim+ NIPS16] Kim, Been, Rajiv Khanna, and Oluwasanmi O. Koyejo. "Examples are not enough, learn to criticize! criticism for interpretability." Proc. of NIPS 2016.
  • [Doshi-Velez+ 17] Doshi-Velez et al. "Towards a rigorous science of interpretable machine learning." CoRR preprint arXiv:1702.08608 (2017).
  • [Lipton+ Queue18] Lipton, Zachary C. "The mythos of model interpretability." Queue 16.3 (2018): 31-57.
  • [Feng+ EMNLP18] Feng et al. "Pathologies of Neural Models Make Interpretations Difficult." Proc. of EMNLP 2018.
  • [Ehsan+ AIES18] Ehsan, Upol, et al. "Rationalization: A neural machine translation approach to generating natural language explanations." Proc. of AIES 2018.
  • [Strout+ BlackboxNLP19] Strout et al "Do Human Rationales Improve Machine Explanations?." Proc. of ACL Workshop BlackboxNLP2019.
  • [Ehsan+ IUI19] Ehsan et al. "Automated rationale generation: a technique for explainable AI and its effects on human perceptions." Proc. of IUI2019.
  • [Zhong+ 19] Zhong et al. "Fine-grained sentiment analysis with faithful attention." CoRR preprint arXiv:1908.06870 (2019).
  • [Rudin NatureMI19] Rudin, Cynthia. "Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead." Nature Machine Intelligence 1.5 (2019): 206-215.
  • [Liu+ 19] Liu et al. "Roberta: A robustly optimized bert pretraining approach." arXiv preprint arXiv:1907.11692 (2019).
  • [Devlin+ NAACL19] Devlin, Jacob, et al. "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding." Proc. of NAACL-HLT2019.
  • [Jain+ NAACL19] Jain et al. "Attention is not Explanation." Proc. of NAACL-HLT 2019.
  • [Lertvittayakumjorn+ EMNLP19] Lertvittayakumjorn et al. "Human-grounded Evaluations of Explanation Methods for Text Classification." Proc. of EMNLP-IJCNLP2019.
  • [Yu+ EMNLP19] Yu, Mo, et al. "Rethinking Cooperative Rationalization: Introspective Extraction and Complement Control." Proc. of EMNLP-IJCNLP19.
  • [Serrano+ ACL19] Serrano et al. "Is Attention Interpretable?." Proc. of ACL 2019.
  • [Bastings+ ACL19] Bastings et al. "Interpretable Neural Predictions with Differentiable Binary Variables." Proc. of ACL 2019.
  • [Wiegreffe+ EMNLP19] Wiegreffe et al. "Attention is not not Explanation." Proc. of EMNLP 2019.
  • [Brunner+ ICLR20] Brunner, Gino, et al. "On identifiability in transformers." Proc. of ICLR 2020.
  • [Pruthi+ ACL20] Pruthi et al. "Learning to deceive with attention-based explanations." Proc. of ACL 2020.

*1:論文を読んで理解した範囲であり、個人的な経験や主観が含まれている可能性があります。