SlideShare a Scribd company logo
文献紹介
SeqGAN: Sequence Generative
Adversarial Nets with Policy Gradient
author: Lantao Yu, Weinan Zhang, Jun Wang, Yong Yu
AAAI 2017 accepted
1
Abstruct
- task: text (discrete sequence) generation
- 主流のRNNとMLE(maximum likelihood estimation)を用いた手法は exposure
bias という問題を抱えていた
- GAN と Reinforcement Learning を用いて、生成した text 全体を評価することで
対処
- text generation と music generation の task で既存手法を上回った
2
Table of Contents
- Introduction
- Method
- Experiments
- Conclusion
3
Introduction - Text Generation
- task: text (discrete sequence) generation
- RNNとMLE(maximum likelihood estimation)を用いることが主流
4
LSTM
cell
true word
LSTM
cell
Word
Embed
... LSTM
cell
Word
Embed
true word true word true word
Cross
Entropy
Cross
Entropy
Cross
Entropy +
loss
ピ ザ だ !
This is pizza!
CNN
RNN
image caption
machine
translation
text
generation
Introduction - Exposure Bias
- text generation の従来手法が抱える問題
- training 時には真の word を入力し、次の word を予測する
- inference 時は真の word が使えないため、生成結果が悪くなる
5
LSTM
cell
LSTM
cell
... LSTM
cell
LSTM
cell
LSTM
cell
... LSTM
cell
true word true word
Introduction - Related Work
- Scheduled Sampling [Bengio, et al. 2015]
- schedule learning を用いて、exposure bias に対処した手法
- schedule learning:簡単な問題を学習させてから、難しい問題を学習させる手法
- 初めは真の word を入力して学習し、次は自身の予測 word を入力とする学習に切り替える
6
LSTM
cell
LSTM
cell
... LSTM
cell
LSTM
cell
LSTM
cell
... LSTM
cell
true word true word
Introduction
- exposure bias への他の解決策として、 生成した文全体の評価を行う
- MLE では次の単語を予測できているかしか評価してないため exposure bias が起こるとも考えら
れるため
- Reinforce Learning と BLUE を使って文全体を評価
- BLUE は machine translation の指標なので、 poem genelation などに最適とは限らない
- → GANを使おう!
7
Introduction - GANs: Generative Adversarial Networks
- 設計の難しい loss 関数に対し、その loss 関数すら Neural Network で学習させて
しまおうという手法
- image generation, text generation などの多くの応用先
- 生成モデル(generative model) ≒ 教師なし (unsupervised)
- P(X) をモデリング (X: 画像など)
Generator
c.f. ProgressinGAN
gaussian noise
generated image
OR Discriminator
real image
True 1
/
False 0
Introduction - Reinforcement Learning
- return が最大になるように value/policy を学習
- return:最終的な reward の合計
- value:ある状態において、こう行動すると最終的にどれくらいの return が得られるかの見積もり
- policy:この状態なら、こういう行動をするという方針
- value/policy どちらかを学習する( value-based/policy-based)
9
Method - SeqGAN
- generator G
- discriminator D
10
SeqGAN - Generator
11
LSTM
cell
〜
〜
word
LSTM
cell
〜
word
Word
Embed
... LSTM
cell
〜
word
Word
Embed
word
〜
SeqGAN - Discriminator
12
Word
Embed
Twords
k dim
Conv
k dim
lwords
Linear,
Highway,
sigmoid
〜 Generator
real text
or
SeqGAN - Policy Gradient
- 初期状態における return の見積もり(value)が最大になるように、 agent の policy を gradient ascent で
学習する方法
- generator を agent の policy とみなして強化学習
- state:今まで生成した sequence
- action:次の word
- return:生成した sequence に対する discriminator による評価(2)
- 以下の式(1)を最大にする policy (generator) を学習する
- 自然な文ができるような wordの選び方(policy)を学習 13
y1=
食
s0
y1=
ザ
y1=
ピ
G=0.6
G=0.3
G=0.1
Q高い
Q低い
SeqGAN - Policy Gradient
- Gradient Ascent には目的関数の勾配(6)が必要だが、生成途中の sequence に
対する value が必要
- しかし、 discriminator は完結した sequence しか評価できない
14
SeqGAN - Monte Carlo Search
- Monte Carlo search で生成途中の sequence の続きを N本 sample して、完結させる
- generator を使って続きを生成する
- Monte Carlo search:たくさんサンプルして、確率分布を推定する方法
- 今回は sequence の続きを確率変数とみなしている
- 無理矢理完結させた N本の sequence に対する discriminator の評価の平均を生成途中の sequence
の value とする
- つまり生成途中の sequence からどんな sequence が最終的に得られるかをシミュレーションして、 途中
の sequence の価値を決める
15
SeqGAN - 学習の流れ
- generator と discriminator の学習を
交互に繰り返す
- 各 d-step で、 negative samples
(generator が生成した sequence)の
セットは異なる
- 各 epoch k では、 negative samples
は同じセットが使われる
16
Experiments
- synthetic data
- real data
- text generation
- music generation
17
Experiments - Synthetic Data Exp.
- 目的
- 従来手法との性能比較のため
- SeqGANへの理解を深めるため
- task
- input: なし
- output: synthetic sequence generated by oracle (random initialised LSTM Goracle)
- training/test data: synthetic sequence generated by oracle
- synthetic data を用いるメリット
- training data が簡単に多く手に入る
- oracle を用いて正確に評価できる
18
Experiments - Synthetic Data Exp.
- eval metric: NNLoracle(LSTMのlossみたいなもの→小さいほど良い)
- baselines
- random
- MLE
- SS (Scheduled Sampling)
- PG-BLEU (policy gradient BLEU)
19
Synthetic Data Exp. - Results
- 従来手法に比べ、大幅に良い
- generator 部分はどの手法も同じ
- seqGANで評価する方法が
generator の限界を向上させた
20
Synthetic Data Exp. - Results
- discriminator を generator よりも先にちゃんと学習させたほうが早く収束する
- discriminator の epoch 数を増やすより、 d-step を増やしてさまざまな negative sample を使った方が
早く収束する
- d-step のたびに generator から毎回異なる negative sample を生成する
21
- task
- input: なし
- output: text
- training/test data
- Chinese Poems
- Barack Obama political speeches
Real Data Exp. - Text Generation
22
- eval. metric
- Human score: すべての比較手法による text 1つずつを同時に見せ、どれが本物かに票を入れて
もらう質問を繰り返し、全質問の平均をとる
- BLEU-2
- baselines
- MLE
- Real data (human created)
Text Generation - Chinese Poem Generation
23
- eval. metric
- BLEU-3, 4
- baselines
- MLE
Text Generation - Obama Speeches Generation
24
- task
- input: なし
- output: text
- training/test data: Nottingham (music of folk tunes in midi file format)
- eval. metric
- BLEU-4
- MSE (mean squared error)
- 音階は連続値なので MSE でも評価できる
Real Data Exp. - Music Generation
25
Real Data Exp. - Result
- どの data においても MLE を上回っ
た
26
Conclusion
- sequence generation の task において主流であるRNNとMLE(maximum
likelihood estimation)を用いた手法は exposure bias という問題を抱えていた
- GAN と Reinforcement Learning を用いて、生成した text 全体を評価することで
対処
- synthetic/real どちらにおいても sequence generation の既存手法を上回った
27

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
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
Pixeldarts
 
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
ThinkNow
 
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
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
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
Neil 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 2024
Albert 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 Insights
Kurio // 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 2024
Search 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 summary
SpeakerHub
 
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 Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit 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 management
MindGenius
 
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
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
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...
 

20181123 seq gan_ sequence generative adversarial nets with policy gradient

  • 1. 文献紹介 SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient author: Lantao Yu, Weinan Zhang, Jun Wang, Yong Yu AAAI 2017 accepted 1
  • 2. Abstruct - task: text (discrete sequence) generation - 主流のRNNとMLE(maximum likelihood estimation)を用いた手法は exposure bias という問題を抱えていた - GAN と Reinforcement Learning を用いて、生成した text 全体を評価することで 対処 - text generation と music generation の task で既存手法を上回った 2
  • 3. Table of Contents - Introduction - Method - Experiments - Conclusion 3
  • 4. Introduction - Text Generation - task: text (discrete sequence) generation - RNNとMLE(maximum likelihood estimation)を用いることが主流 4 LSTM cell true word LSTM cell Word Embed ... LSTM cell Word Embed true word true word true word Cross Entropy Cross Entropy Cross Entropy + loss ピ ザ だ ! This is pizza! CNN RNN image caption machine translation text generation
  • 5. Introduction - Exposure Bias - text generation の従来手法が抱える問題 - training 時には真の word を入力し、次の word を予測する - inference 時は真の word が使えないため、生成結果が悪くなる 5 LSTM cell LSTM cell ... LSTM cell LSTM cell LSTM cell ... LSTM cell true word true word
  • 6. Introduction - Related Work - Scheduled Sampling [Bengio, et al. 2015] - schedule learning を用いて、exposure bias に対処した手法 - schedule learning:簡単な問題を学習させてから、難しい問題を学習させる手法 - 初めは真の word を入力して学習し、次は自身の予測 word を入力とする学習に切り替える 6 LSTM cell LSTM cell ... LSTM cell LSTM cell LSTM cell ... LSTM cell true word true word
  • 7. Introduction - exposure bias への他の解決策として、 生成した文全体の評価を行う - MLE では次の単語を予測できているかしか評価してないため exposure bias が起こるとも考えら れるため - Reinforce Learning と BLUE を使って文全体を評価 - BLUE は machine translation の指標なので、 poem genelation などに最適とは限らない - → GANを使おう! 7
  • 8. Introduction - GANs: Generative Adversarial Networks - 設計の難しい loss 関数に対し、その loss 関数すら Neural Network で学習させて しまおうという手法 - image generation, text generation などの多くの応用先 - 生成モデル(generative model) ≒ 教師なし (unsupervised) - P(X) をモデリング (X: 画像など) Generator c.f. ProgressinGAN gaussian noise generated image OR Discriminator real image True 1 / False 0
  • 9. Introduction - Reinforcement Learning - return が最大になるように value/policy を学習 - return:最終的な reward の合計 - value:ある状態において、こう行動すると最終的にどれくらいの return が得られるかの見積もり - policy:この状態なら、こういう行動をするという方針 - value/policy どちらかを学習する( value-based/policy-based) 9
  • 10. Method - SeqGAN - generator G - discriminator D 10
  • 12. SeqGAN - Discriminator 12 Word Embed Twords k dim Conv k dim lwords Linear, Highway, sigmoid 〜 Generator real text or
  • 13. SeqGAN - Policy Gradient - 初期状態における return の見積もり(value)が最大になるように、 agent の policy を gradient ascent で 学習する方法 - generator を agent の policy とみなして強化学習 - state:今まで生成した sequence - action:次の word - return:生成した sequence に対する discriminator による評価(2) - 以下の式(1)を最大にする policy (generator) を学習する - 自然な文ができるような wordの選び方(policy)を学習 13 y1= 食 s0 y1= ザ y1= ピ G=0.6 G=0.3 G=0.1 Q高い Q低い
  • 14. SeqGAN - Policy Gradient - Gradient Ascent には目的関数の勾配(6)が必要だが、生成途中の sequence に 対する value が必要 - しかし、 discriminator は完結した sequence しか評価できない 14
  • 15. SeqGAN - Monte Carlo Search - Monte Carlo search で生成途中の sequence の続きを N本 sample して、完結させる - generator を使って続きを生成する - Monte Carlo search:たくさんサンプルして、確率分布を推定する方法 - 今回は sequence の続きを確率変数とみなしている - 無理矢理完結させた N本の sequence に対する discriminator の評価の平均を生成途中の sequence の value とする - つまり生成途中の sequence からどんな sequence が最終的に得られるかをシミュレーションして、 途中 の sequence の価値を決める 15
  • 16. SeqGAN - 学習の流れ - generator と discriminator の学習を 交互に繰り返す - 各 d-step で、 negative samples (generator が生成した sequence)の セットは異なる - 各 epoch k では、 negative samples は同じセットが使われる 16
  • 17. Experiments - synthetic data - real data - text generation - music generation 17
  • 18. Experiments - Synthetic Data Exp. - 目的 - 従来手法との性能比較のため - SeqGANへの理解を深めるため - task - input: なし - output: synthetic sequence generated by oracle (random initialised LSTM Goracle) - training/test data: synthetic sequence generated by oracle - synthetic data を用いるメリット - training data が簡単に多く手に入る - oracle を用いて正確に評価できる 18
  • 19. Experiments - Synthetic Data Exp. - eval metric: NNLoracle(LSTMのlossみたいなもの→小さいほど良い) - baselines - random - MLE - SS (Scheduled Sampling) - PG-BLEU (policy gradient BLEU) 19
  • 20. Synthetic Data Exp. - Results - 従来手法に比べ、大幅に良い - generator 部分はどの手法も同じ - seqGANで評価する方法が generator の限界を向上させた 20
  • 21. Synthetic Data Exp. - Results - discriminator を generator よりも先にちゃんと学習させたほうが早く収束する - discriminator の epoch 数を増やすより、 d-step を増やしてさまざまな negative sample を使った方が 早く収束する - d-step のたびに generator から毎回異なる negative sample を生成する 21
  • 22. - task - input: なし - output: text - training/test data - Chinese Poems - Barack Obama political speeches Real Data Exp. - Text Generation 22
  • 23. - eval. metric - Human score: すべての比較手法による text 1つずつを同時に見せ、どれが本物かに票を入れて もらう質問を繰り返し、全質問の平均をとる - BLEU-2 - baselines - MLE - Real data (human created) Text Generation - Chinese Poem Generation 23
  • 24. - eval. metric - BLEU-3, 4 - baselines - MLE Text Generation - Obama Speeches Generation 24
  • 25. - task - input: なし - output: text - training/test data: Nottingham (music of folk tunes in midi file format) - eval. metric - BLEU-4 - MSE (mean squared error) - 音階は連続値なので MSE でも評価できる Real Data Exp. - Music Generation 25
  • 26. Real Data Exp. - Result - どの data においても MLE を上回っ た 26
  • 27. Conclusion - sequence generation の task において主流であるRNNとMLE(maximum likelihood estimation)を用いた手法は exposure bias という問題を抱えていた - GAN と Reinforcement Learning を用いて、生成した text 全体を評価することで 対処 - synthetic/real どちらにおいても sequence generation の既存手法を上回った 27