Adversarial network for natural language systhesis Speaker - - PowerPoint PPT Presentation

adversarial network for natural language systhesis
SMART_READER_LITE
LIVE PREVIEW

Adversarial network for natural language systhesis Speaker - - PowerPoint PPT Presentation

Adversarial network for natural language systhesis Speaker introduction Rajib Biswas Area of interest Lead Data Scientist in Ericsson, Bangalore. NLP - Virtual Assistant, Knowledge Graphs Working with a global AI team for AI


slide-1
SLIDE 1

Adversarial network for natural language systhesis

slide-2
SLIDE 2

Speaker introduction

Rajib Biswas Area of interest

  • Lead Data Scientist in Ericsson,

Bangalore.

  • Working with a global AI team for AI

driven network design and optimization.

  • Have worked with Intel, Samsung,

Fidelity Investments earlier.

  • Have filed few patents related to AI.
  • NLP - Virtual Assistant, Knowledge Graphs
  • Computer Vision - Image classification.
  • Time series and forecasting.
  • Recommendation system.

2

slide-3
SLIDE 3

Agenda

  • 1. Language generation : now and future.
  • 2. Introduction to GAN.
  • 3. Challenges with generative model for text
  • 4. GAN models for text.
  • 5. Task specific Language Generation
  • 6. Evaluation

3

slide-4
SLIDE 4

Language generation: now & future

4

slide-5
SLIDE 5

Language generation: now & future

Language Generation Language understanding Language processing

5

slide-6
SLIDE 6

Language generation: now & future

Applications:

  • Auto content curation for editors.

6

slide-7
SLIDE 7

Language generation: now & future

Applications:

  • Auto report generation from BI apps

7

slide-8
SLIDE 8

Language generation: now & future

Applications:

  • Virtual Assistant /chatbots

8

slide-9
SLIDE 9

Introduction to GAN

9 Synthetic fake images by GAN . https://thispersondoesnotexist.com/ Real image of Ian Goodfellow

slide-10
SLIDE 10

Introduction to GAN

GAN(Generative Adversarial Network)

  • generator network(G) trained to produce

realistic samples by introducing “adversary" [a discriminator network(D) ]

10

slide-11
SLIDE 11

Introduction to GAN

GAN(Generative Adversarial Network)

  • generator network(G) trained to produce

realistic samples by introducing “adversary" [a discriminator network(D) ]

  • D detects if a given sample is ‘real’ or ‘fake’.
  • D dynamically update evaluation metric for

tuning the generator.

  • until D will output with probability 0.5 for

both classes ; obtain ‘Nash Equilibrium’.

11

slide-12
SLIDE 12

Introduction to GAN

12

Objective:
 Distinguish between real and fake Objective:
 Generate image close to real

slide-13
SLIDE 13

Introduction to GAN

Min-max game played by two network, whose Value function is given

13

Output for real image Output for fake image D(x) = Probability that, x is real according to D. G(z) = sample generated by G, given latent vector Z. Correct identification Getting caught by D

slide-14
SLIDE 14

Challenges with GAN for text

GAN is not natural fit for discrete data such as text. Training of generator is difficult due to discreteness of text data.

14

slide-15
SLIDE 15

Challenges with GAN for text

GAN is not natural fit for discrete data such as text. Training of generator is difficult due to discreteness of text data. Non-Differentiability at output of generator.

15

Generator Discriminator

argmax :
 P(softmax(h))

Non-differentiable for discrete data

min: 1- D(G(z))

Back-propagation

X

slide-16
SLIDE 16

GAN models for text

Gumbel-softmax trick

ht = hidden state of RNN generator at step t gt = sample from Gumbel distribution.

𝜐 = parameter to control how close the continuous approx distribution to the

discrete one. 𝜐 → 0, y is close approximation to one-hot vector.

yt = softmax( (h+g)/𝜐)

16

Kusner et al: GANs for sequence of discrete elements with Gumbel-Softmax Distribution

slide-17
SLIDE 17

GAN models for text

Problem so far: Sampling of tokens from discrete spaces. Solution proposed: Sample single token ‘sentence vector’ from discrete continuous space of all sentence vectors.

17

slide-18
SLIDE 18

GAN models for text: AutoEncoder

Problem so far: Sampling of tokens from discrete spaces. Solution proposed: Sample single token ‘sentence vector’ from discrete continuous space of all sentence vectors.

Get sentence vector of real sentences by training a Auto-Encoder.

18

Latent space GAN

David et al. “Adversarial Text Generation Without Reinforcement Learning”.

slide-19
SLIDE 19

GAN models for text

Let’s play a game. Today , the sky is ______ in London.I _____ this weather. What are the possible words coming to your mind?

19

slide-20
SLIDE 20

GAN models for text

Let’s play a game. Today , the sky is ______ in London.I _____ this weather. What are the possible words coming to your mind?

20

cloudy
 sunny
 clear love
 hate

slide-21
SLIDE 21

GAN models for text : SeqGAN

Text Generation is a sequential decision-making process : RL

Agent: Generator State: text generated so far Action: predicting next word, based on context (previous state). Reward: Prediction score(real/fake) from Discriminator Policy(𝜌): Which action to pick at any state? policy function: 𝜌(a | s, 𝜄) Objective: Find optimal policy 𝜌* => optimal 𝜄

21 SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient.(Lantao You et al)

slide-22
SLIDE 22

GAN models for text : SeqGAN

SeqGAN

  • D: input: sentence
  • output :reward score of realness of this

sentence.

  • Provided back to G to update policy at end of

episode.

  • G:Input:sequence of words,
  • output: probability distribution over next word.
  • ht = RNN(ht-1, xt)
  • p(at | x1,…,xt) = z(ht)= softmax(b+W*ht)

22

slide-23
SLIDE 23

GAN models for text : SeqGAN

Objective: Find optimal policy 𝜌* => optimal 𝜄 Policy gradient 𝛼𝜌(At | St, 𝜄t) = Vector indicates direction of max increase of prob of action At, when state St is encountered. Gt: Cumulative reward , while following Policy 𝜌. Indicates amount of movement.

23

REINFORCE update

SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient.(Lantao You et al)

slide-24
SLIDE 24

GAN models for text : SeqGAN

How to determine reward before sentences are completed?

  • SeqGAN applies Monte-Carlo search to roll-out current policy to

estimate the reward.

  • Generator uses current learned policy network to roll-out iteratively till

end of sentences to get estimated reward.

24 SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient.(Lantao You et al)

slide-25
SLIDE 25

GAN models for text : LeakGAN

LeakGAN

  • Long sentence generation is hard, as

intermediate reward estimation is noisy.

  • LeakGan solves that by introducing

Worker(Criminal) and Manager(Spy).

  • Worker : creates fake sample
  • Discriminator(Police): detects fake/real
  • Manager: act as spy and leaks features

used to identify fake sample by Discriminator.

25

slide-26
SLIDE 26

GAN models for text

Leveraging more information from discriminator , to generate Better quality text , may cause another critical issue !!

Mode Collapse: exhibit poor diversity amongst generated samples

26

UnrollGAN, Luke te.al. ICRL 2017

slide-27
SLIDE 27

GAN models for text : MaskGAN

Leveraging more information from discriminator to generate Better quality text , may cause another critical issue !! Mode Collapse: exhibit poor diversity amongst generated samples

MaskGAN claims to reduce mode collapse and help with training stability. This method shows evidence that it produces more realistic text samples compared to a maximum likelihood trained model.

27

slide-28
SLIDE 28

GAN models for text : MaskGAN

Encoder encodes masked text input,
 Generator learns to fill in the blank by reward score Provided by the Discriminator.

28 MaskGAN: Better Text Generation via Filling in the______. (William Fedus et al, ICRL 2018)

Discriminator also uses 
 same architecture

slide-29
SLIDE 29

GAN models for text

Challenges with RL based methods 1.Unstable training process due High variance . Because few samples to estimate gradient of policy. 2.Policy gradient methods tend to converge to local maxima, when state- action space is huge. Action choices= |V| , vocabulary size.

29

slide-30
SLIDE 30

Evaluation

How to measure performance of metrics? GANs are not optimised for traditional cross-entropy loss (unlike MLE), so usually ‘loss’ is not used as performance metrics. BLEU(Bilingual Evaluation Understudy Score): Counting matching n-grams between generated and target sentence. BLEU doesn’t cover all aspect of language correctness.

30

slide-31
SLIDE 31

Evaluation

LeakGAN performs well with BLEU score. MaskGAN performs well with self-BLEU score(detects mode collapse.)

31

Left: BLEU score on EMNLP 2017 WMT, Right: self-BLEU score

slide-32
SLIDE 32

Evaluation

Benchmark on standard datasets

32

Human preference score of paired comparison on IMDB and PTB datasets

slide-33
SLIDE 33

Evaluation: results

33

Dataset Epoch Output from SeqGAN PTB 5 Employees may cure they were considering the agency that’s two congress cases ms. Jhonson clearly noted that began growth PTB 10 Can end of its criminal office charges to remove the pacific law which is all the <unk> response to PTB 20 Capital offers flat the debt carrier to imports from <unk> mr. George said it expects net sales to reduce

slide-34
SLIDE 34

Evaluation: results

Conditional samples from PTB for both MaskGAN and MaskMLE

34

slide-35
SLIDE 35

Task specific Language generation

Dialogue Generation

35

Input That’s our wake up call Vanilla-MLE We ‘re gonna be late for the meeting Reinforce I ‘ll be right back REGS MC We ‘re gonna have to get to the station Adversarial Learning for Neural Dialogue Generation, Jiwei et al

slide-36
SLIDE 36

Task specific Language generation

Style Transfer

36

“Evaluating Style Transfer for Text”, Remi et al. Input

would n’t recommend until management works on friendliness and communication with residents .

ARAE

highly recommend this place while living in tempe and management .

CAAE

would highly recommend management on duty and staff on business .

DAR

until management works on friendliness and is a great place for communication with residents .

Negative to positive sentiment style transfer task

slide-37
SLIDE 37

Task specific Language generation

Style Transfer Lack of established metrics to measure performance.
 Evaluate performance in terms of : 1.Style transfer intensity - quantify difference in style 2.Context preservation - similarity in content 3.Naturalness - degree at which it’s close to human written text.

37

“Evaluating Style Transfer for Text”, Remi et al.

slide-38
SLIDE 38

Summary

Recent advancement in Language generation research. GAN based approaches have made significant progress. However, current these methods doesn’t capture nuances and semantics of natural

  • language. Specially, for longer sentences.

Automated language language generation, may be misused for malicious purposes Like - generating fake news, ClickBait etc. #Ethics #ResponsibleAI

38

slide-39
SLIDE 39

Q&A

39

slide-40
SLIDE 40

Rate this session

`

40

slide-41
SLIDE 41

END

41