SlideShare une entreprise Scribd logo
1  sur  23
1
DEEP LEARNING JP
[DL Papers]
http://deeplearning.jp/
Are Sixteen Heads Really Better than One?
MasakiTashiro, Keio University
書誌情報
• Are Sixteen Heads Really Better than One?
• https://arxiv.org/abs/1905.10650
• Paul Michel, Omer Levy, Graham Neubig.
2
選んだ理由
• BERT等のattentionの挙動について興味があったから
*断りのない限り, 図は論文より引用
概要
背景・課題
• 近年のNLPで流行のmulti-head attention(MHA)を用いたモデル
はメモリを大量に消費し時間もかかる
提案
• Multi-headで訓練したモデルの中のheadの多くは精度を落とさず
に取り去ることができる
結論
• MHAは学習初期段階の相互作用のために重要であるが、一度学
習できたら推論時にはいらないことがある
3
背景
• BERT (Bidirectional Encoder Representations from
Transformers)
• 汎用的な言語表現モデルで総合的な言語理解能力を試すGLUE
において飛躍的なスコアの向上を達成
詳しくはこちらを参考
• https://qiita.com/Kosuke-Szk/items/4b74b5cce84f423b7125
4
出典 : https://arxiv.org/abs/1810.04805
背景
Transformer
• 2017年にAttention Is All You Need にて
提案されたモデル
• 機械翻訳において主流であった
RNNやLSTMを用いずにSOTAを達成した
5
出典 : https://arxiv.org/abs/1706.03762
背景
• Single-Headed Attention
6
出典 : https://arxiv.org/abs/1706.03762
背景
• Multi-headed Attention
• Masking Attention Heads
7
出典 : https://arxiv.org/abs/1706.03762
課題
• MHAが具体的にどのような役割を果たしているかわかってない
• MHAによってモデルのパラメータは大きく増大する。それに伴って
メモリを大量に消費し推論に時間がかかる
8
関連研究
• Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, Ivan
Titov. Analyzing multi-head self-attention: Specialized heads do
the heavy lifting, the rest can be pruned. In ACL, 2019.
• Kevin Clark, Urvashi Khandelwal, Omer Levy, Christopher D.
Manning. What Does BERT Look At? An Analysis of BERT's
Attention. In BlackBoxNLP, 2019
9
実験
基本的には二つのタスク
• WMT2014 English to French corpusで訓練したlarge transformer
のnewstest2013 test setでの評価
• MultiNLIデータにおいてfinetuningをしたBERTの”base-uncased”
モデルの”matched” validation setにおける評価
10
実験1 : 一つの層からheadを削除する
条件1 : 削除したheadは一つ
結果 : ほとんどのheadは削除しても
統計的に優位な差を見せなかった
11
実験1 : 一つの層からheadを削除する
条件2 : 一つのhead以外を削除
結果 : 多くの層で一つのheadは十分なスコアを出せる
ただ、層によっての複数のheadが必要な層もある
12
実験1 : 一つの層からheadを削除する
条件3 : 違うデータセットでheadを削除したモデルを試す
結果 : データセット間でスコアには正の相関が見られ、
重要であると考えられたheadはデータセットに
関わらず重要であると考えられる
13
実験2 : 複数の層からheadを削除する
目的
• 複数の層のheadによる複合効果があるかを検証する
方向性
• Importance scoreによって全てのattention head をソートし重要で
ないものから貪欲的に枝刈りしていく
14
実験2 : 複数の層からheadを削除する
Head Importance score for Pruning
• 勾配ベースで重要度を決定
• 重要度は層別にnormalizeする
15
実験2 : 複数の層からheadを削除する
Pruningと精度(BLEU/Accuracy)の関係
• 実験1で求めたaccuracyベースのもの(緑)と勾配ベース(青)のもの
を比較
• 勾配ベースの方が良い
• 一定までは精度の低下が小さいが一定以上で大きく減少
16
実験2 : 複数の層からheadを削除する
Pruningと推論効率の関係
• 約3分の1のパラメータがMHAに使われている
• 時間に関してはsingle exampleの推論において大きな速度向上を
もたらした
17
層の種類によるhead削減の効果
• 実験1で層によって必要なheadの数が異なることがわかった
• Enc-Dec間ではmulti-headsがより重要であると考えられる
18
Headの重要性の変化
• 各epochでのheadの削減率とscoreの減少度を比較した
• 初期段階ではheadの削減が与える影響が大きいが学習が進むに
つれて影響が小さくなる
• 初期段階で重要なheadは決定される
19
結論
• MHAは常にモデルの表現力を上げるという訳ではない
• 層によって削除できるheadの割合は変わっている
• 学習の初期段階で重要なheadは決まってくる
20
Appendix
著者のTwitterより
• Lottery ticket hypothesisとの関係について
• 重要なheadは単に初期値が良かった訳ではないことを主張
21
Appendix
重要であると考えられたheadについて
• 同様の研究がAnalyzing multi-head self-attention: Specialized
heads do the heavy lifting, the rest can be pruned. でも行われて
いて具体的に重要なheadがどのような役割をしているのかを調べ
た
• Syntax的な役割, positionalな役割, rare wordへの対処に関する
役割などが観察された
22
Appendix
Headの役割に関して
• より具体的なheadの役割(文法的)についてはWhat Does BERT
Look At? An Analysis of BERT‘s Attention で研究されていた
23

Contenu connexe

Tendances

0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)
MasanoriSuganuma
 

Tendances (20)

[DL輪読会]Inverse Constrained Reinforcement Learning
[DL輪読会]Inverse Constrained Reinforcement Learning[DL輪読会]Inverse Constrained Reinforcement Learning
[DL輪読会]Inverse Constrained Reinforcement Learning
 
【DL輪読会】DayDreamer: World Models for Physical Robot Learning
【DL輪読会】DayDreamer: World Models for Physical Robot Learning【DL輪読会】DayDreamer: World Models for Physical Robot Learning
【DL輪読会】DayDreamer: World Models for Physical Robot Learning
 
Transformer メタサーベイ
Transformer メタサーベイTransformer メタサーベイ
Transformer メタサーベイ
 
機械学習モデルのハイパパラメータ最適化
機械学習モデルのハイパパラメータ最適化機械学習モデルのハイパパラメータ最適化
機械学習モデルのハイパパラメータ最適化
 
Efficient Lifelong Learning with A-GEM ( ICLR 2019 読み会 in 京都 20190602)
Efficient Lifelong Learning with A-GEM ( ICLR 2019 読み会 in 京都 20190602)Efficient Lifelong Learning with A-GEM ( ICLR 2019 読み会 in 京都 20190602)
Efficient Lifelong Learning with A-GEM ( ICLR 2019 読み会 in 京都 20190602)
 
畳み込みニューラルネットワークの研究動向
畳み込みニューラルネットワークの研究動向畳み込みニューラルネットワークの研究動向
畳み込みニューラルネットワークの研究動向
 
近年のHierarchical Vision Transformer
近年のHierarchical Vision Transformer近年のHierarchical Vision Transformer
近年のHierarchical Vision Transformer
 
[DL輪読会]StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
[DL輪読会]StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators[DL輪読会]StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
[DL輪読会]StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
 
[DL輪読会]Libra R-CNN: Towards Balanced Learning for Object Detection
[DL輪読会]Libra R-CNN: Towards Balanced Learning for Object Detection[DL輪読会]Libra R-CNN: Towards Balanced Learning for Object Detection
[DL輪読会]Libra R-CNN: Towards Balanced Learning for Object Detection
 
【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輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...
[DL輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...[DL輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...
[DL輪読会]Life-Long Disentangled Representation Learning with Cross-Domain Laten...
 
0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)
 
ゼロから始める転移学習
ゼロから始める転移学習ゼロから始める転移学習
ゼロから始める転移学習
 
[DL輪読会]World Models
[DL輪読会]World Models[DL輪読会]World Models
[DL輪読会]World Models
 
[DL輪読会]Relational inductive biases, deep learning, and graph networks
[DL輪読会]Relational inductive biases, deep learning, and graph networks[DL輪読会]Relational inductive biases, deep learning, and graph networks
[DL輪読会]Relational inductive biases, deep learning, and graph networks
 
SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜
SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜
SSII2022 [SS2] 少ないデータやラベルを効率的に活用する機械学習技術 〜 足りない情報をどのように補うか?〜
 
第6回WBAシンポジウム:脳参照アーキテクチャ 駆動開発からの AGI構築ロードマップ
第6回WBAシンポジウム:脳参照アーキテクチャ 駆動開発からの AGI構築ロードマップ第6回WBAシンポジウム:脳参照アーキテクチャ 駆動開発からの AGI構築ロードマップ
第6回WBAシンポジウム:脳参照アーキテクチャ 駆動開発からの AGI構築ロードマップ
 
【宝くじ仮説】The Lottery Ticket Hypothesis: Finding Small, Trainable Neural Networks
【宝くじ仮説】The Lottery Ticket Hypothesis: Finding Small, Trainable Neural Networks【宝くじ仮説】The Lottery Ticket Hypothesis: Finding Small, Trainable Neural Networks
【宝くじ仮説】The Lottery Ticket Hypothesis: Finding Small, Trainable Neural Networks
 
【基調講演】『深層学習の原理の理解に向けた理論の試み』 今泉 允聡(東大)
【基調講演】『深層学習の原理の理解に向けた理論の試み』 今泉 允聡(東大)【基調講演】『深層学習の原理の理解に向けた理論の試み』 今泉 允聡(東大)
【基調講演】『深層学習の原理の理解に向けた理論の試み』 今泉 允聡(東大)
 
【DL輪読会】ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders
【DL輪読会】ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders【DL輪読会】ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders
【DL輪読会】ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders
 

Plus de Deep Learning JP

Plus de Deep Learning JP (20)

【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
 
【DL輪読会】事前学習用データセットについて
【DL輪読会】事前学習用データセットについて【DL輪読会】事前学習用データセットについて
【DL輪読会】事前学習用データセットについて
 
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
 
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
 
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
 
【DL輪読会】マルチモーダル LLM
【DL輪読会】マルチモーダル LLM【DL輪読会】マルチモーダル LLM
【DL輪読会】マルチモーダル LLM
 
【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
 【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo... 【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
 
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
 
【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輪読会】"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...
 

Dernier

Dernier (12)

論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 

[DL輪読会]Are Sixteen Heads Really Better than One?