The details: training and valida1ng big models on big data - - PowerPoint PPT Presentation

the details training and valida1ng big models on big data
SMART_READER_LITE
LIVE PREVIEW

The details: training and valida1ng big models on big data - - PowerPoint PPT Presentation

The details: training and valida1ng big models on big data David Mimno Princeton, Computer Science 1 Saturday, November 3, 12 2 Saturday, November 3, 12 George Dyson, Turings


slide-1
SLIDE 1

1

The ¡details: ¡training ¡and ¡ valida1ng ¡big ¡models ¡on ¡big ¡data

David ¡Mimno Princeton, ¡Computer ¡Science

Saturday, November 3, 12

slide-2
SLIDE 2

2

Saturday, November 3, 12

slide-3
SLIDE 3

George ¡Dyson, ¡Turing’s ¡Cathedral

  • “The ¡reac*on ¡of ¡most ¡meteorologists ¡

towards ¡computer-­‑assisted ¡forecas*ng ¡ paralleled ¡that ¡of ¡the ¡Ins*tute ¡ mathema*cians ¡towards ¡computer-­‑assisted ¡ mathema*cs: ¡skep*cism ¡that ¡a ¡machine ¡ could ¡improve ¡upon ¡what ¡they ¡were ¡doing ¡ with ¡brains ¡alone.”

3

Saturday, November 3, 12

slide-4
SLIDE 4

George ¡Dyson, ¡Turing’s ¡Cathedral

  • “The ¡reac*on ¡of ¡most ¡meteorologists ¡

towards ¡computer-­‑assisted ¡forecas*ng ¡ paralleled ¡that ¡of ¡the ¡Ins*tute ¡ mathema*cians ¡towards ¡computer-­‑assisted ¡ mathema*cs: ¡skep*cism ¡that ¡a ¡machine ¡ could ¡improve ¡upon ¡what ¡they ¡were ¡doing ¡ with ¡brains ¡alone.”

4

Saturday, November 3, 12

slide-5
SLIDE 5

5

Outline

  • Training ¡topic ¡models
  • Modeling ¡choices
  • Diagnos*cs

Saturday, November 3, 12

slide-6
SLIDE 6

6

Outline

  • Training ¡topic ¡models
  • Modeling ¡choices
  • Diagnos*cs

Saturday, November 3, 12

slide-7
SLIDE 7

Library-­‑scale ¡topic ¡models

7

Input: ¡1.2M ¡pre-­‑1922 ¡books (33 ¡billion ¡non-­‑stopwords) Output: ¡2000 ¡“topics” (distribu*ons ¡over ¡words) Random ¡examples, ¡each ¡row ¡is ¡a ¡topic

Saturday, November 3, 12

slide-8
SLIDE 8

Latent ¡Dirichlet ¡Alloca1on

8

D Nd K θ w z β α η Book-­‑topic ¡propor*ons

Saturday, November 3, 12

slide-9
SLIDE 9

9

Etruscan trade price temple market

An ¡example ¡document

Saturday, November 3, 12

slide-10
SLIDE 10

10

3 2 1 3 1 Etruscan trade price temple market

Assign ¡topics

w z

Saturday, November 3, 12

slide-11
SLIDE 11

11

3 2 1 3 1 Etruscan trade price temple market

Assign ¡topics

w z

3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 2 3 2 1 1 trade temple ship trade market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 2 3 2 1 1 ship temple ship trade market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 3 2 1 3 1 Etrusca n trade price temple market 2 3 2 1 1 Italy temple ship trade market

Saturday, November 3, 12

slide-12
SLIDE 12

12

1 2 3 Etruscan 1 35 market 50 1 price 42 1 temple 20 trade 10 8 1 ... 3 2 1 3 1 Etruscan trade price temple market

Global ¡sta1s1cs

Total ¡ counts ¡ from ¡all ¡ docs

Saturday, November 3, 12

slide-13
SLIDE 13

Algorithm

  • Ini*alize ¡topic ¡assignments ¡randomly
  • For ¡each ¡itera*on:

– For ¡each ¡document:

  • For ¡each ¡word:

– Resample ¡topic ¡for ¡word, ¡given ¡all ¡other ¡words ¡and ¡their ¡ current ¡topic ¡assignments

  • Produce ¡reports

13

Saturday, November 3, 12

slide-14
SLIDE 14

Algorithm

  • Ini*alize ¡topic ¡assignments ¡randomly
  • For ¡each ¡itera*on:

– For ¡each ¡document:

  • For ¡each ¡word:

– Resample ¡topic ¡for ¡word, ¡given ¡all ¡other ¡words ¡and ¡their ¡ current ¡topic ¡assignments

  • Produce ¡reports

14

Saturday, November 3, 12

slide-15
SLIDE 15

15

1 2 3 Etruscan 1 35 market 50 1 price 42 1 temple 20 trade 10 8 1 ... 3 2 1 3 1 Etruscan trade price temple market

Sample ¡topic ¡for ¡“trade”

Saturday, November 3, 12

slide-16
SLIDE 16

16

1 2 3 Etruscan 1 35 market 50 1 price 42 1 temple 20 trade 10 8 1 ... 3 2 1 3 1 Etruscan trade price temple market

Remove ¡current ¡assignment

Saturday, November 3, 12

slide-17
SLIDE 17

17

1 2 3 Etruscan 1 35 market 50 1 price 42 1 temple 20 trade 10 7 1 ... 3 ? 1 3 1 Etruscan trade price temple market

Remove ¡current ¡assignment

Saturday, November 3, 12

slide-18
SLIDE 18

18

3 ? 1 3 1 Etruscan trade price temple market

Pick ¡a ¡topic ¡for ¡“trade”

Saturday, November 3, 12

slide-19
SLIDE 19

19

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Which ¡topics ¡occur ¡in ¡this ¡doc?

Saturday, November 3, 12

slide-20
SLIDE 20

20

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market 1 2 3 trade 10 7 1

Which ¡topics ¡like ¡the ¡word ¡“trade”?

Saturday, November 3, 12

slide-21
SLIDE 21

Which ¡topics ¡like ¡the ¡word ¡“trade”?

21

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-22
SLIDE 22

Pick ¡a ¡topic ¡for ¡“trade”

22

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-23
SLIDE 23

Pick ¡a ¡topic ¡for ¡“trade”

23

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-24
SLIDE 24

Pick ¡a ¡topic ¡for ¡“trade”

24

1 2 3 Etruscan 1 35 market 50 1 price 42 1 temple 20 trade 10 7 1 ... 3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-25
SLIDE 25

Pick ¡a ¡topic ¡for ¡“trade”

25

1 2 3 Etruscan 1 35 market 50 1 price 42 1 temple 20 trade 11 7 1 ... 3 1 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-26
SLIDE 26

Increase ¡counts ¡for ¡1 ¡and ¡“trade”|1

26

Topic 1 Topic 2 Topic 3

3 1 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-27
SLIDE 27

Varia1onal ¡inference

27

Etruscan trade price temple market

Topic 1 Topic 2 Topic 3

Saturday, November 3, 12

slide-28
SLIDE 28

28

Outline

  • Training ¡topic ¡models
  • Modeling ¡choices
  • Diagnos*cs

Saturday, November 3, 12

slide-29
SLIDE 29

Things ¡people ¡didn’t ¡know ¡they ¡ had ¡to ¡think ¡about

  • What ¡is ¡a ¡document?
  • Which ¡words ¡are ¡interes*ng?
  • What ¡is ¡a ¡word, ¡anyway?
  • Knobs:

– Number ¡of ¡topics – Hyper-­‑parameters

29

Saturday, November 3, 12

slide-30
SLIDE 30

Pick ¡a ¡topic ¡for ¡“trade”

30

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-31
SLIDE 31

Which ¡topics ¡like ¡the ¡word ¡“trade”?

31

Topic 1

Saturday, November 3, 12

slide-32
SLIDE 32

Which ¡topics ¡like ¡the ¡word ¡“trade”?

32

Topic 1 price α market

Saturday, November 3, 12

slide-33
SLIDE 33

Pick ¡a ¡topic ¡for ¡“trade”

33

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-34
SLIDE 34

Pick ¡a ¡topic ¡for ¡“trade”

34

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-35
SLIDE 35

Pick ¡a ¡topic ¡for ¡“trade”

35

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-36
SLIDE 36

Pick ¡a ¡topic ¡for ¡“trade”

36

Topic 1 Topic 2 Topic 3

3 ? 1 3 1 Etruscan trade price temple market

Saturday, November 3, 12

slide-37
SLIDE 37

Hyper-­‑parameters: ¡learn ¡or ¡fix?

37

Pros Cons Fixed ¡ All ¡topics ¡ similar ¡size, ¡ quality Duplicate ¡ topics, ¡frequent ¡ words ¡repeated Learned Some ¡topics ¡ big, ¡others ¡ small Small ¡topics ¡ may ¡be ¡low ¡ quality

Saturday, November 3, 12

slide-38
SLIDE 38

38

Outline

  • Training ¡topic ¡models
  • Modeling ¡choices
  • Diagnos8cs

Saturday, November 3, 12

slide-39
SLIDE 39

What ¡makes ¡topics ¡bad?

  • Random, ¡unrelated ¡words
  • One ¡or ¡two ¡“intruder” ¡words
  • Boring, ¡overly ¡general ¡words
  • Two ¡or ¡more ¡good ¡topics ¡combined, ¡

some*mes ¡with ¡a ¡general ¡word ¡in ¡common ¡ (chimaeras)

39

Saturday, November 3, 12

slide-40
SLIDE 40

40

Example ¡topic

  • aging, ¡lifespan, ¡globin, ¡age ¡related, ¡

longevity, ¡human, ¡age, ¡erythroid, ¡sickle ¡ cell, ¡beta ¡globin, ¡hb, ¡senescence, ¡ adult, ¡older, ¡lcr

Saturday, November 3, 12

slide-41
SLIDE 41

41

Example ¡topic

  • aging, ¡lifespan, ¡globin, ¡age ¡related, ¡

longevity, ¡human, ¡age, ¡erythroid, ¡ sickle ¡cell, ¡beta ¡globin, ¡hb, ¡senescence, ¡ adult, ¡older, ¡lcr

Saturday, November 3, 12

slide-42
SLIDE 42

42

@benschmidt

Saturday, November 3, 12

slide-43
SLIDE 43

43

Evalua1ons ¡of ¡topic ¡quality

  • 1. Size ¡(# ¡of ¡tokens ¡assigned)
  • 2. Within-­‑doc ¡rank
  • 3. Similarity ¡to ¡corpus-­‑wide ¡distribu*on
  • 4. Locally-­‑frequent ¡words
  • 5. Co-­‑doc ¡Coherence

All ¡of ¡these ¡are ¡in ¡ Mallet ¡2.0.7!

Saturday, November 3, 12

slide-44
SLIDE 44

Topic ¡size

  • How ¡many ¡words ¡in ¡the ¡corpus ¡are ¡

assigned ¡to ¡this ¡topic?

  • Fewer ¡words, ¡lower ¡quality ¡topics.

44

Saturday, November 3, 12

slide-45
SLIDE 45

Within-­‑doc ¡rank

  • For ¡every ¡doc, ¡rank ¡topics ¡by ¡frequency.
  • In ¡what ¡propor*on ¡of ¡documents ¡is ¡a ¡topic ¡

the ¡most ¡prominent ¡topic?

  • General ¡topics: ¡small ¡propor*on ¡of ¡many ¡

documents.

  • Focused ¡topics: ¡large ¡propor*on ¡of ¡few ¡
  • documents. ¡

45

Saturday, November 3, 12

slide-46
SLIDE 46

Similarity ¡to ¡corpus ¡dist’n

  • Rank ¡all ¡words ¡in ¡corpus ¡in ¡order.
  • Measure ¡similarity ¡of ¡each ¡topic ¡to ¡this ¡

global ¡ranking.

  • Topics ¡with ¡high ¡similarity ¡to ¡the ¡whole ¡

corpus ¡are ¡usually ¡uninteres*ng.

46

Saturday, November 3, 12

slide-47
SLIDE 47

Locally ¡frequent ¡words

  • If ¡a ¡rare ¡word ¡occurs ¡in ¡a ¡document, ¡it ¡will ¡
  • ccur ¡ojen.
  • In ¡long ¡documents ¡unusual ¡words ¡can ¡have ¡

high ¡frequency.

  • Compare ¡“topics” ¡generated ¡by ¡word ¡token ¡

count ¡to ¡“topics” ¡generated ¡by ¡document ¡ count.

47

Saturday, November 3, 12

slide-48
SLIDE 48

48

Co-­‑doc ¡“coherence”

  • Use ¡the ¡training ¡document ¡set
  • Create ¡binarized ¡co-­‑document ¡frequencies
  • Compare ¡condi*onal ¡probability ¡of ¡each ¡

word ¡to ¡all ¡higher-­‑ranked ¡words

log P(‘erythroid’ ¡| ¡‘aging’)

Saturday, November 3, 12

slide-49
SLIDE 49

49

Co-­‑document ¡frequencies

aging lifespan erythroid aging 100 25 lifespan 25 50 erythroid 25

Saturday, November 3, 12

slide-50
SLIDE 50

40 30 20 10

  • convent

abbess nun hermit monastery nuns monks confessor veil cell

  • rder

walls chapel hermitage heaven cloister vows novice sisterhood recluse sisters nunnery community habit prioress penance seclusion retreat brotherhood prayers cloisters refuge hour solitude cowl abode protection religion convents sanctuary

50

Saturday, November 3, 12