SlideShare a Scribd company logo
1 of 26
1
DEEP LEARNING JP
[DL Papers]
http://deeplearning.jp/
Beyond Accuracy: BehavioralTesting of NLP Models
with CheckList (ACL2020)
Kazuki Fujikawa
サマリ
• 書誌情報
– Beyond Accuracy: Behavioral Testing of NLP Models with CheckList
• ACL2020 Best Paper
• Marco Tulio Ribeiro, Tongshuang Wu, Carlos Guestrin, Sameer Singh
• 概要
– NLPモデルの性能確認を行うためのCheckListを提案
• Accuracyでは計測しづらいエラーを評価するテストフレームワーク
• ソフトウェア工学におけるBehavioral Testingを参考にしている
• 大量かつ多様なテストケース生成ツールも同梱したOSSを公開
– ユーザ調査で有効性を検証
• ex1. 商用の感情分析モデルのバグ発見
• ex2. CheckList利用有無で3倍のバグを発見
2
アウトライン
• 背景
• 提案手法
• 実験・結果
3
アウトライン
• 背景
• 提案手法
• 実験・結果
4
背景
• NLPモデルの性能評価の標準: ホールドアウトに対する統計量(e.g. Accuracy)
– ホールドアウトは網羅性がなく、訓練データ同様のバイアスを含んでいる
– 単一統計量としてまとめると、モデルがどういった場面で失敗するのか把握が難しい
• ソフトウェア工学では、複雑なシステムに対するテスト手法が実践されている
– Behavior Test(Blackbox Test)では、内部構造には踏み込まず、入出力を検証する
– ソフトウェア工学からの洞察は、NLPモデルに対して適用されていない
5
NLPモデルに対する包括的な動作テストの作成法を考えたい
アウトライン
• 背景
• 提案手法
• 実験・結果
6
提案手法
• Test types x Capabilities の軸で整理したCheckListを提案
– CheckListのテスト通過率でモデルの性能を評価
• テストケースをスケールするための方法論を提案・ツールをOSSで公開
– テストのテンプレート化
– テンプレートの自動展開
7
提案手法
• Test types x Capabilities の軸で整理したCheckListを提案
– CheckListのテスト通過率でモデルの性能を評価
• テストケースをスケールするための方法論を提案・ツールをOSSで公開
– テストのテンプレート化
– テンプレートの自動展開
8
提案手法
• Test types x Capabilities の軸で整理したCheckListを提案
9
MFT
(Minimum Functionality test)
INV
(Invariance test)
DIR
(Directional Expectation test)
Vocabulary + POS
Taxonomy
Robustness
NER
Fairness
Temporal understanding
Negation
Coreference
Semantic Role Labeling
Logic
Test types
Capabilities
提案手法
• Test types x Capabilities の軸で整理したCheckListを提案
10
MFT
(Minimum Functionality test)
INV
(Invariance test)
DIR
(Directional Expectation test)
Vocabulary + POS
Taxonomy
Robustness
NER
Fairness
Temporal understanding
Negation
Coreference
Semantic Role Labeling
Logic
Test types
Capabilities
MFT (Minimum Functionality test):
• ソフトウェア工学におけるユニットテストにヒントを得ている
• 目的タスクに関する動作確認用のテストケースの集合体
• 例: 感情分析
(Vocabulary + POS) I despised that aircraft. → negative
(Negation) The food is not poor. → positive or neutral
提案手法
• Test types x Capabilities の軸で整理したCheckListを提案
11
MFT
(Minimum Functionality test)
INV
(Invariance test)
DIR
(Directional Expectation test)
Vocabulary + POS
Taxonomy
Robustness
NER
Fairness
Temporal understanding
Negation
Coreference
Semantic Role Labeling
Logic
Test types
Capabilities
INV (Invariance test):
• ソフトウェア工学におけるメタモルフィックテストから
ヒントを得ている
• ラベルに影響の無い摂動に対する出力不変性をテスト
• 例: 感情分析
(Robust) @SouthwestAir no thanksthakns → INV
(NER) I miss the #nerdbird in San JoseDenver → INV
提案手法
• Test types x Capabilities の軸で整理したCheckListを提案
12
MFT
(Minimum Functionality test)
INV
(Invariance test)
DIR
(Directional Expectation test)
Vocabulary + POS
Taxonomy
Robustness
NER
Fairness
Temporal understanding
Negation
Coreference
Semantic Role Labeling
Logic
Test types
Capabilities
DIR (Directional Expectation test):
• ラベルに影響を与える変更が期待通り影響しているか
どうかを確認するテスト
• 例: 感情分析
(Vocabulary+POS) Your service sucks. +You are lame.
→ negative++
• (Vocabulary+POS) Great trip on 2672 yesterday... +You
are extraordinary. → positive++
提案手法
• Test types x Capabilities の軸で整理したCheckListを提案
– CheckListのテスト通過率でモデルの性能を評価
• テストケースをスケールするための方法論を提案・ツールをOSSで公開
– テストのテンプレート化
– テンプレートの自動展開
13
提案手法
• テストケースをスケールするための方法論を提案・ツールをOSSで公開
– テンプレートによる多様な入力セットに対する動作確認
• ex. “I {NEGATION} {POS_VERB} the {THING}.”
– {NEGATION} = {didn't, can't say I, ...}
– {POS_VERB} = {love, like, ...}
– {THING} = {food, flight, service, ...}
– テンプレート展開の自動化(レコメンド)
• RoBERTaのMaskedLMを使い、テンプレートの穴埋めを提案
14
アウトライン
• 背景
• 提案手法
• 実験・結果
15
実験
• 実験1: 商用API / SoTAモデルに対するテスト実施(感情分析)
• 実験2: NLP専門家に対するユーザ調査
16
実験
• 実験1: 商用API / SoTAモデルに対するテスト実施(感情分析)
• 実験2: NLP専門家に対するユーザ調査
17
実験1: 実験設定
• 商用API / SoTAモデルに対するテスト実施(感情分析)
– CheckListによるテストの有効性の確認
18
以下のサービス / モデルに対するテスト結果で比較
• 商用API: Microsoft, Google, Amazonが提供する感情分析API
• SoTAモデル: BERT, RoBERTa のFine-tune
実験1: 実験設定
• 商用API / SoTAモデルに対するテスト実施(感情分析)
– CheckListによるテストの有効性の確認
19
実験1: 実験結果
• 商用API / SoTAモデルに対するテスト実施(感情分析)
– CheckListによるテストの有効性の確認
20
• 明らかにNeutralなデータに対するエラー
• ex. The company is Australian → neutral
• Google: 7.6%, Amazon: 4.8%のエラー率
• 非Neutralの簡単な事例でもエラーが発生
• ex. I like this seat → positive
実験1: 実験結果
• 商用API / SoTAモデルに対するテスト実施(感情分析)
– CheckListによるテストの有効性の確認
21
• 短縮URLやアカウント名などを追加するだけで、
予測が変化してしまう事例も多数存在
実験
• 実験1: 商用API / SoTAモデルに対するテスト実施(感情分析)
• 実験2: NLP専門家に対するユーザ調査
22
実験2: 実験設定
• NLP専門家に対するユーザ調査
– QQP(質問文同定タスク)を学習したBERTモデルを提供し、Jupyter上・2h以内で
モデルのテストをしてもらう
• 不具合の発見に対してCheckListやテストケース生成ツールが有用であるのかを検証
– 被験者: 学術 / 産業界のNLP専門家18名を以下のグループに分割
• Unaided: 特に指示を与えない
• Cap.only: 前述のCapabilitiesのリストを共有
• Cap.+tmpl.: Capabilitiesのリストに加え、template+穴埋めツールを提供
23
実験2: 実験結果
• NLP専門家に対するユーザ調査
– CheckList利用の有効性を確認
24
CheckList + template利用者 vs CheckList利用者
• Capabilityの観点では同等の試験を実施したが、template
利用者は、より多様なテストを実施し、template非利用者
よりも多くのバグを発見
→ template利用の有用性を確認
実験2: 実験結果
• NLP専門家に対するユーザ調査
– CheckList利用の有効性を確認
25
CheckList利用者 vs 非利用者:
• Capabilityの観点で、(template利用有無に関わらず)
多様な観点での試験を実施
• 結果として約3倍のBug(template利用者)を発見
→ CheckList利用の有用性を確認
結論
• NLPモデルの性能確認を行うためのCheckListを提案
– Accuracyでは計測しづらいエラーを評価するテストフレームワーク
– ソフトウェア工学におけるBehavioral Testingを参考にしている
– 大量かつ多様なテストケース生成ツールも同梱したOSSを公開
• ユーザ調査で有効性を検証
– 今回示したフレームワークは汎用的であり、様々なタスクに対する網羅的なテストを
作成することが可能
– Holdoutに対するAccuracyだけでなく、より詳細で実用的なNLPモデルの評価が可能
26

More Related Content

More from Deep Learning JP

More from Deep Learning JP (20)

【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?
 
【DL輪読会】Hopfield network 関連研究について
【DL輪読会】Hopfield network 関連研究について【DL輪読会】Hopfield network 関連研究について
【DL輪読会】Hopfield network 関連研究について
 
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
 
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
 
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
 
【DL輪読会】"Language Instructed Reinforcement Learning for Human-AI Coordination "
【DL輪読会】"Language Instructed Reinforcement Learning  for Human-AI Coordination "【DL輪読会】"Language Instructed Reinforcement Learning  for Human-AI Coordination "
【DL輪読会】"Language Instructed Reinforcement Learning for Human-AI Coordination "
 
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
 
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
 
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
 
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
 
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
 
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
 
【DL輪読会】VIP: Towards Universal Visual Reward and Representation via Value-Impl...
【DL輪読会】VIP: Towards Universal Visual Reward and Representation via Value-Impl...【DL輪読会】VIP: Towards Universal Visual Reward and Representation via Value-Impl...
【DL輪読会】VIP: Towards Universal Visual Reward and Representation via Value-Impl...
 
【DL輪読会】Deep Transformers without Shortcuts: Modifying Self-attention for Fait...
【DL輪読会】Deep Transformers without Shortcuts: Modifying Self-attention for Fait...【DL輪読会】Deep Transformers without Shortcuts: Modifying Self-attention for Fait...
【DL輪読会】Deep Transformers without Shortcuts: Modifying Self-attention for Fait...
 
【DL輪読会】マルチモーダル 基盤モデル
【DL輪読会】マルチモーダル 基盤モデル【DL輪読会】マルチモーダル 基盤モデル
【DL輪読会】マルチモーダル 基盤モデル
 
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
【DL輪読会】TrOCR: Transformer-based Optical Character Recognition with Pre-traine...
 
【DL輪読会】HyperDiffusion: Generating Implicit Neural Fields withWeight-Space Dif...
【DL輪読会】HyperDiffusion: Generating Implicit Neural Fields withWeight-Space Dif...【DL輪読会】HyperDiffusion: Generating Implicit Neural Fields withWeight-Space Dif...
【DL輪読会】HyperDiffusion: Generating Implicit Neural Fields withWeight-Space Dif...
 
【DL輪読会】大量API・ツールの扱いに特化したLLM
【DL輪読会】大量API・ツールの扱いに特化したLLM【DL輪読会】大量API・ツールの扱いに特化したLLM
【DL輪読会】大量API・ツールの扱いに特化したLLM
 
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
 
【DL輪読会】Poisoning Language Models During Instruction Tuning Instruction Tuning...
【DL輪読会】Poisoning Language Models During Instruction Tuning Instruction Tuning...【DL輪読会】Poisoning Language Models During Instruction Tuning Instruction Tuning...
【DL輪読会】Poisoning Language Models During Instruction Tuning Instruction Tuning...
 

[DL輪読会]Beyond Accuracy: Behavioral Testing of NLP Models with CheckList (ACL2020)

  • 1. 1 DEEP LEARNING JP [DL Papers] http://deeplearning.jp/ Beyond Accuracy: BehavioralTesting of NLP Models with CheckList (ACL2020) Kazuki Fujikawa
  • 2. サマリ • 書誌情報 – Beyond Accuracy: Behavioral Testing of NLP Models with CheckList • ACL2020 Best Paper • Marco Tulio Ribeiro, Tongshuang Wu, Carlos Guestrin, Sameer Singh • 概要 – NLPモデルの性能確認を行うためのCheckListを提案 • Accuracyでは計測しづらいエラーを評価するテストフレームワーク • ソフトウェア工学におけるBehavioral Testingを参考にしている • 大量かつ多様なテストケース生成ツールも同梱したOSSを公開 – ユーザ調査で有効性を検証 • ex1. 商用の感情分析モデルのバグ発見 • ex2. CheckList利用有無で3倍のバグを発見 2
  • 5. 背景 • NLPモデルの性能評価の標準: ホールドアウトに対する統計量(e.g. Accuracy) – ホールドアウトは網羅性がなく、訓練データ同様のバイアスを含んでいる – 単一統計量としてまとめると、モデルがどういった場面で失敗するのか把握が難しい • ソフトウェア工学では、複雑なシステムに対するテスト手法が実践されている – Behavior Test(Blackbox Test)では、内部構造には踏み込まず、入出力を検証する – ソフトウェア工学からの洞察は、NLPモデルに対して適用されていない 5 NLPモデルに対する包括的な動作テストの作成法を考えたい
  • 7. 提案手法 • Test types x Capabilities の軸で整理したCheckListを提案 – CheckListのテスト通過率でモデルの性能を評価 • テストケースをスケールするための方法論を提案・ツールをOSSで公開 – テストのテンプレート化 – テンプレートの自動展開 7
  • 8. 提案手法 • Test types x Capabilities の軸で整理したCheckListを提案 – CheckListのテスト通過率でモデルの性能を評価 • テストケースをスケールするための方法論を提案・ツールをOSSで公開 – テストのテンプレート化 – テンプレートの自動展開 8
  • 9. 提案手法 • Test types x Capabilities の軸で整理したCheckListを提案 9 MFT (Minimum Functionality test) INV (Invariance test) DIR (Directional Expectation test) Vocabulary + POS Taxonomy Robustness NER Fairness Temporal understanding Negation Coreference Semantic Role Labeling Logic Test types Capabilities
  • 10. 提案手法 • Test types x Capabilities の軸で整理したCheckListを提案 10 MFT (Minimum Functionality test) INV (Invariance test) DIR (Directional Expectation test) Vocabulary + POS Taxonomy Robustness NER Fairness Temporal understanding Negation Coreference Semantic Role Labeling Logic Test types Capabilities MFT (Minimum Functionality test): • ソフトウェア工学におけるユニットテストにヒントを得ている • 目的タスクに関する動作確認用のテストケースの集合体 • 例: 感情分析 (Vocabulary + POS) I despised that aircraft. → negative (Negation) The food is not poor. → positive or neutral
  • 11. 提案手法 • Test types x Capabilities の軸で整理したCheckListを提案 11 MFT (Minimum Functionality test) INV (Invariance test) DIR (Directional Expectation test) Vocabulary + POS Taxonomy Robustness NER Fairness Temporal understanding Negation Coreference Semantic Role Labeling Logic Test types Capabilities INV (Invariance test): • ソフトウェア工学におけるメタモルフィックテストから ヒントを得ている • ラベルに影響の無い摂動に対する出力不変性をテスト • 例: 感情分析 (Robust) @SouthwestAir no thanksthakns → INV (NER) I miss the #nerdbird in San JoseDenver → INV
  • 12. 提案手法 • Test types x Capabilities の軸で整理したCheckListを提案 12 MFT (Minimum Functionality test) INV (Invariance test) DIR (Directional Expectation test) Vocabulary + POS Taxonomy Robustness NER Fairness Temporal understanding Negation Coreference Semantic Role Labeling Logic Test types Capabilities DIR (Directional Expectation test): • ラベルに影響を与える変更が期待通り影響しているか どうかを確認するテスト • 例: 感情分析 (Vocabulary+POS) Your service sucks. +You are lame. → negative++ • (Vocabulary+POS) Great trip on 2672 yesterday... +You are extraordinary. → positive++
  • 13. 提案手法 • Test types x Capabilities の軸で整理したCheckListを提案 – CheckListのテスト通過率でモデルの性能を評価 • テストケースをスケールするための方法論を提案・ツールをOSSで公開 – テストのテンプレート化 – テンプレートの自動展開 13
  • 14. 提案手法 • テストケースをスケールするための方法論を提案・ツールをOSSで公開 – テンプレートによる多様な入力セットに対する動作確認 • ex. “I {NEGATION} {POS_VERB} the {THING}.” – {NEGATION} = {didn't, can't say I, ...} – {POS_VERB} = {love, like, ...} – {THING} = {food, flight, service, ...} – テンプレート展開の自動化(レコメンド) • RoBERTaのMaskedLMを使い、テンプレートの穴埋めを提案 14
  • 16. 実験 • 実験1: 商用API / SoTAモデルに対するテスト実施(感情分析) • 実験2: NLP専門家に対するユーザ調査 16
  • 17. 実験 • 実験1: 商用API / SoTAモデルに対するテスト実施(感情分析) • 実験2: NLP専門家に対するユーザ調査 17
  • 18. 実験1: 実験設定 • 商用API / SoTAモデルに対するテスト実施(感情分析) – CheckListによるテストの有効性の確認 18 以下のサービス / モデルに対するテスト結果で比較 • 商用API: Microsoft, Google, Amazonが提供する感情分析API • SoTAモデル: BERT, RoBERTa のFine-tune
  • 19. 実験1: 実験設定 • 商用API / SoTAモデルに対するテスト実施(感情分析) – CheckListによるテストの有効性の確認 19
  • 20. 実験1: 実験結果 • 商用API / SoTAモデルに対するテスト実施(感情分析) – CheckListによるテストの有効性の確認 20 • 明らかにNeutralなデータに対するエラー • ex. The company is Australian → neutral • Google: 7.6%, Amazon: 4.8%のエラー率 • 非Neutralの簡単な事例でもエラーが発生 • ex. I like this seat → positive
  • 21. 実験1: 実験結果 • 商用API / SoTAモデルに対するテスト実施(感情分析) – CheckListによるテストの有効性の確認 21 • 短縮URLやアカウント名などを追加するだけで、 予測が変化してしまう事例も多数存在
  • 22. 実験 • 実験1: 商用API / SoTAモデルに対するテスト実施(感情分析) • 実験2: NLP専門家に対するユーザ調査 22
  • 23. 実験2: 実験設定 • NLP専門家に対するユーザ調査 – QQP(質問文同定タスク)を学習したBERTモデルを提供し、Jupyter上・2h以内で モデルのテストをしてもらう • 不具合の発見に対してCheckListやテストケース生成ツールが有用であるのかを検証 – 被験者: 学術 / 産業界のNLP専門家18名を以下のグループに分割 • Unaided: 特に指示を与えない • Cap.only: 前述のCapabilitiesのリストを共有 • Cap.+tmpl.: Capabilitiesのリストに加え、template+穴埋めツールを提供 23
  • 24. 実験2: 実験結果 • NLP専門家に対するユーザ調査 – CheckList利用の有効性を確認 24 CheckList + template利用者 vs CheckList利用者 • Capabilityの観点では同等の試験を実施したが、template 利用者は、より多様なテストを実施し、template非利用者 よりも多くのバグを発見 → template利用の有用性を確認
  • 25. 実験2: 実験結果 • NLP専門家に対するユーザ調査 – CheckList利用の有効性を確認 25 CheckList利用者 vs 非利用者: • Capabilityの観点で、(template利用有無に関わらず) 多様な観点での試験を実施 • 結果として約3倍のBug(template利用者)を発見 → CheckList利用の有用性を確認
  • 26. 結論 • NLPモデルの性能確認を行うためのCheckListを提案 – Accuracyでは計測しづらいエラーを評価するテストフレームワーク – ソフトウェア工学におけるBehavioral Testingを参考にしている – 大量かつ多様なテストケース生成ツールも同梱したOSSを公開 • ユーザ調査で有効性を検証 – 今回示したフレームワークは汎用的であり、様々なタスクに対する網羅的なテストを 作成することが可能 – Holdoutに対するAccuracyだけでなく、より詳細で実用的なNLPモデルの評価が可能 26