SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
MASKGAN: Better Text
Generation via Filling in
the ______
William Fedus, Ian Goodfellow, Andrew M. Dai
自己紹介
 Twitter/Github: ymym3412
 都内のIT企業で自然言語処理の研究開発
 nlpaper.challenge主催
【宣伝】nlpaper.challengeとは?
 自然言語処理の学会「ACL」論文を完全読破する取り組み
 Twitter: @NlpaperChalleng
 cvpaper.challengeの親戚
 NLPとCVの交流のための勉強会を開催中!
 勉強会で会場を提供してくださる企業様を募集中です!
おなじみSequence-to-Sequence
[Sustskever+, 2014]
[Thang+, 2015]
[Nallapati+, 2016]
機械翻訳タスクを例に
入力文: 私は 犬が 好きです
出力文: I like dogs
私は
機械翻訳タスクを例に
入力文: 私は 犬が 好きです
出力文: I like dogs
私は 犬が
機械翻訳タスクを例に
入力文: 私は 犬が 好きです
出力文: I like dogs
私は 犬が 好きです
機械翻訳タスクを例に
入力文: 私は 犬が 好きです
出力文: I like dogs
私は 犬が 好きです <SOS>
I
機械翻訳タスクを例に
入力文: 私は 犬が 好きです
出力文: I like dogs
私は 犬が 好きです <SOS>
I
I
like
機械翻訳タスクを例に
入力文: 私は 犬が 好きです
出力文: I like dogs
私は 犬が 好きです <SOS>
I
I
like
like
dogs
機械翻訳タスクを例に
入力文: 私は 犬が 好きです
出力文: I like dogs
私は 犬が 好きです <SOS>
I
I
like
like
dogs
dogs
<EOS>
Exposure bias
私は 犬が 好きです <SOS>
I
I
train
like
planes
dogs
<EOS>
• 学習時: Teacher forcing
• Decoderへの入力はground truth label
Cross-Entropyを計算
Exposure bias
• 推論時: Free Running
• Decoderへの入力はt-1のDecoderの出力
私は 犬が 好きです <SOS>
I
I
like
like
dogs
dogs
<EOS>
学習時と推論時の差がExposure biasを引き起こす!
Exposure biasの対策その1
Scheduled Sampling [Bengio+, 2015]
ground truth labelを使うかself-generated
tokenを使うかを確率的に決める
少しずつprevious tokenが選ばれるようにしていくことで
学習時と推論時のギャップを埋める
Exposure biasの対策その2
Professor Forcing [Lamb+, 2016]
Teacher Forcing時の隠れ層と
Free running時の隠れ層のとを
識別するDiscriminatorを用意し
Teacher ForcingとFree Running
の差がなくなるように学習
Text生成のGAN: SeqGAN[Yu+, 2016]
 テキスト生成のGと真贋を見極めるD + 強化学習
 単語1つ1つの尤度最大化ではなく文としての最適化
 単語毎のMLEでは文全体の整合性は取れない
 MCサーチ + 方策勾配法でGを学習
SeqGANの派生
 MaliGAN[Che+, 2017]
 真贋判定という2値分類の問題を緩和
 報酬をリスケーリング
 RankGAN[Lin+, 2017]
 こちらも2値分類の問題を緩和
 2値分類ではなくランキング問題として解く
 LeakGAN[Guo+, 2017]
 Mode collapseによる短いテキスト生成を回避
 Dの情報をGにLeakしてテキスト生成をガイドする
MASKGANの構成
I live __ Tokyo I
live
live Tokyo
<EOS>Tokyo
I live in Tokyo
D1 D2 D3 D4
Generator
Discriminator
Critic
I live Tokyo I live Tokyo
V1 V2 V3 V4
I live Tokyo I live Tokyo
MASKGANのポイント
 Generatorをin-fillingタスクで学習させる
 微分不可能な処理を挟むため強化学習で学習を行う
Generator
 本来の文章をランダムにマスクした文章を生成し、マスク部分を復元する
ように学習させる
 マスク部分に適切な語を復元することでDiscriminatorを騙せる
I live __ Tokyo I
live
live Tokyo
<EOS>Tokyo
Discriminator
 GeneratorのDecoderが生成した文章の妥当性をチェックする
 Gの生成文の真贋判定ではなく、正しいContextとの比較を行う
I live in Tokyo
D1 D2 D3 D4
I live Tokyo I live Tokyo
in
rtは時刻tの報酬
正しい単語でfillしないと、
Generatorは高い報酬を受け取れない
Generator/Discriminatorの学習
 Discriminatorはいつも通り真贋判定のLoss
 Generatorがサンプリング処理を挟むため微分不可能→強化学習
 Actor-Critic法を使って学習する
※ɤは割引率
※VはCriticの出力
勾配の分散を抑えるためのベースラインを
モデルで推定するのがActor-Critic法
Critic
 Generatorが得る勾配の分散を抑えるためのベースラインを推定する
V1 V2 V3 V4
I live Tokyo I live Tokyo
GeneratorのLoss関数
 各時刻tで未来の割引報酬も考慮した報酬を計算しているため、各時刻
毎の単語の対数尤度を最大化するMLEと違い、系列全体を通して報酬
の最大化の学習を行う
実験
 Pen Tree Bank(PTB)とIMDBでConditional/Unconditionalのテ
キスト生成実験
 MaskGANとMLEで学習したMaskMLEの比較
 生成されたテキストの定性比較、Perplexityの比較、人手での評価、
mode collapseの解析を実施
PTB/IMDB
PTB Conditional
PTB Unconditional
IMDB Conditional
IMDB Unconditional
IMDB Perplexity
MaskGANではDiscriminatorの対数尤度を
Generatorの報酬として受け取っている=Perplexity
を直接最適化していると言える?
とすればPerplexityの改善はある意味当然
Mode collapse
 Generatorが勾配を得やすい確率分布上の特定の1点にはまってしまう
ことで生成されるデータの多様性が失われる現象
 ユニークなn-gramを測ることでmode collapseを確認する
 Quadgramsの低下が確認できmode collapseが起きている?
人間によるABテスト
 AMTで2つの文章を見せてどちらがより良いか回答してもらう
 SeqGANと比べると改善が見られるが、リアルデータと比べるとまだまだ
まとめ
 Seq2Seqの抱えるExposure biasの問題をin-fillingタスク+強化学
習による系列最適化で解決
 評価方法が定性評価に強く依存している。SeqGANからどんな発展が
あったかが明確には述べられていない
 Blank(___)を完全なランダムではなく連続してblankとすると学習の質
が改善されることが確認されており、句といった単位でblankにすることで
構文なども考慮した学習ができるのではないか
参考文献
 William Fedus, Ian Goodfellow and Andrew M. Dai; MaskGAN: Better Text Generation via Filling in the______, https://arxiv.org/abs/1801.07736
 Ilya Sutskever, Oriol Vinyals, Quoc V. Le, Sequence to Sequence Learning with Neural Networks, https://arxiv.org/abs/1409.3215
 Minh-Thang Luong, Hieu Pham, Christopher D. Manning, Effective Approaches to Attention-based Neural Machine Translation,
https://arxiv.org/abs/1508.04025
 Ramesh Nallapati, Bowen Zhou, Cicero Nogueira dos santos, Caglar Gulcehre, Bing Xiang, Abstractive Text Summarization Using Sequence-to-Sequence RNNs
and Beyond, https://arxiv.org/abs/1602.06023
 Samy Bengio, Oriol Vinyals, Navdeep Jaitly, Noam Shazeer , Scheduled Sampling for Sequence Prediction with Recurrent Neural Networks,
https://arxiv.org/abs/1506.03099
 Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio; Generating sentences from a continuous space,
https://arxiv.org/abs/1511.06349
 Lantao Yu† , Weinan Zhang†∗, Jun Wang‡ , Yong Yu†, SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient, https://arxiv.org/pdf/1609.05473.pdf
 Alex Lamb, Anirudh Goyal, Ying Zhang, Saizheng Zhang, Aaron Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks,
https://arxiv.org/pdf/1801.07736.pdf
 Tong Che * 1 Yanran Li * 2 Ruixiang Zhang * 3 R Devon Hjelm 1 4 Wenjie Li 2 Yangqiu Song 3 Yoshua Bengio 1, Maximum-Likelihood Augmented Discrete Generative
Adversarial Networks, https://arxiv.org/pdf/1702.07983.pdf
 Kevin Lin, Dianqi Li, Xiaodong He, Zhengyou Zhang, and Ming-Ting Sun. Adversarial ranking for language generation, https://arxiv.org/pdf/1705.11001.pdf
 Jiaxian Guo† , Sidi Lu† , Han Cai† , Weinan Zhang†∗, Yong Yu† , Jun Wang‡, Long Text Generation via Adversarial Training with Leaked Information,
https://arxiv.org/pdf/1709.08624.pdf
 Sidi Lu1 , Yaoming Zhu1 , Weinan Zhang1 , Jun Wang2 , Yong Yu1, Neural Text Generation: Past, Present and Beyond, https://arxiv.org/pdf/1803.07133.pdf
 Github: https://github.com/tensorflow/models/tree/master/research/maskgan

Más contenido relacionado

Último

スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000Shota Ito
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxAtomu Hidaka
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 
UPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdfUPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdffurutsuka
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directoryosamut
 

Último (9)

スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
 
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
 
UPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdfUPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdf
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory
 

Destacado

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destacado (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Maskgan better text generation via filling in the ____