62
Towards Understanding the Geometry of Knowledge Graph Embeddings Chandrahas 1 , Aditya Sharma 2 , Partha Talukdar 1,2 1 Computer Science and Automation 2 Computatational and Data Sciences Indian Institute of Science, Bangalore

Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

TowardsUnderstandingtheGeometryofKnowledgeGraph

EmbeddingsChandrahas1,AdityaSharma2,Partha Talukdar1,2

1ComputerScienceandAutomation2ComputatationalandDataSciencesIndianInstituteofScience,Bangalore

Page 2: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KnowledgeGraphs(KG)

HasFootballTeam

LionelMessi

FCBarcelona

ArgentinaNationalFootballTeam

1

Page 3: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KnowledgeGraphs(KG)

HasFootballTeam

LionelMessi

FCBarcelona

ArgentinaNationalFootballTeam

Entities

2

Page 4: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KnowledgeGraphs(KG)

HasFootballTeam

LionelMessi

FCBarcelona

ArgentinaNationalFootballTeam

Entities

Relations

3

Page 5: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KnowledgeGraphs(KG)

4

• ExampleKGs

Page 6: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KnowledgeGraphs(KG)

5

• ExampleKGs • Applications

• Search

Page 7: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KnowledgeGraphs(KG)

6

• ExampleKGs • Applications

• Search

• QuestionAnswering

Page 8: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddings

• Representsentitiesandrelationsasvectorsinavectorspace

ℝ𝑑

7

TransE1

1.TranslatingEmbeddings forModelingMulti-relationalData,Bordes etal.

Page 9: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddings

• Representsentitiesandrelationsasvectorsinavectorspace

ℝ𝑑

𝒅

PlaysFor

...

...

...

8

TransE1

1.TranslatingEmbeddings forModelingMulti-relationalData,Bordes etal.NIPS2013.

Page 10: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

GeometryofEmbeddings

9

• Arrangementofvectorsinthevectorspace.

Page 11: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

GeometryofEmbeddings

10

• Arecentworkby(Mimno andThompson,2017)1 presentedananalysisofthegeometryofwordembeddings andrevealedinterestingresults.

• However,geometricalunderstandingofKGembeddings isverylimited,despitetheirpopularity.

1.Thestrangegeometryofskip-gramwithnegativesampling,Mimno andThompson,EMNLP2017

Page 12: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Problem

• StudythegeometricalbehaviorofKGembeddings learntbydifferentmethods.

• Studytheeffectofvarioushyper-parametersusedduringtrainingonthegeometryofKGembeddings.

• StudythecorrelationbetweenthegeometryandperformanceofKGembeddings.

11

Page 13: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddingMethods

• Learnsd-dimensionalvectorsforentities𝓔 andrelations𝓡 inaKG.

12

Page 14: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddingMethods

• Learnsd-dimensionalvectorsforentities𝓔 andrelations𝓡 inaKG.

• Ascorefunction𝛔 :𝓔⨉𝓡⨉𝓔→ℝ distinguishescorrecttriples𝑇 +

fromincorrecttriples𝑇 −.Forexample,𝛔(Messi,plays-for-team,Barcelona)>𝛔(Messi,plays-for-team,Liverpool)

13

Page 15: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddingMethods

• Learnsd-dimensionalvectorsforentities𝓔 andrelations𝓡 inaKG.

• Ascorefunction𝛔 :𝓔⨉𝓡⨉𝓔→ℝ distinguishescorrecttriples𝑇 +

fromincorrecttriples𝑇 −.Forexample,𝛔(Messi,plays-for-team,Barcelona)>𝛔(Messi,plays-for-team,Liverpool)

• Alossfunction𝐿(𝑇+, 𝑇−) isusedfortrainingtheembeddings (usuallylogisticlossormargin-basedrankingloss).

14

Page 16: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddingMethods

15

Page 17: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddingMethods

• AdditiveMethods

• MultiplicativeMethods

• NeuralMethods

16

Page 18: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

KGEmbeddingMethods

17☉ Entry-wiseproduct ★ Circularcorrelation

Page 19: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

GeometricalMetrics

• AverageVectorLength

18

Page 20: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

GeometricalMetrics

• AverageVectorLength

• AlignmenttoMean

19

Page 21: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

GeometricalMetrics

• Conicity

20

Page 22: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

GeometricalMetrics

• Conicity

• VectorSpread

21

Page 23: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

GeometryofEmbeddings

22

HighConicity LowConicity

Page 24: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Experiments

• WestudytheeffectoffollowingfactorsonthegeometryofKGEmbeddings• Typeofmethod(AdditiveorMultiplicative)• NumberofNegativeSamples• DimensionofVectorSpace

• Wealsostudythecorrelationofperformanceandgeometry.

• Forexperiments,weusedFB15kdataset.

23

Page 25: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

AdditivevsMultiplicative(EntityVectors)

24

Additive

Multip

licative

Page 26: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

AdditivevsMultiplicative(RelationVectors)

25

Additive

Multip

licative

Page 27: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

26

ModelType Conicity VectorSpreadAdditive Low High

Multiplicative High Low

AdditivevsMultiplicative

Page 28: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(EntityVectors)

27

Page 29: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(EntityVectors)

28

Additive

Page 30: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(EntityVectors)

29

Multiplicative

Page 31: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(EntityVectors)

30

AdditiveNochange

Page 32: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(EntityVectors)

31

AdditiveNochange

MultiplicativeConicity Increases

Page 33: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(EntityVectors)

32

AdditiveNochange

Page 34: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(EntityVectors)

33

AdditiveNochange

MultiplicativeAVLdecreases

Page 35: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples

34

ModelType Vector Type Conicity AVL

AdditiveEntity NoChange NoChangeRelation NoChange NoChange

MultiplicativeEntity Increases DecreasesRelation Decreases NoChange

exceptHolE

Page 36: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

SGNS(Word2Vec1)asMultiplicativeModel

• Similarobservationwasmadeby(Mimno andThompson,2017)2 forSGNSbasedwordembeddings wherehigher#negativesresultedinhigherconicity.

• Word2Vec1 maximizeswordandcontextvectordotproductforpositiveword-contextpairs.

• Thisbehaviorisconsistentwiththatofmultiplicativemodels.

351.Distributedrepresentationsofwordsandphrasesandtheircompositionality,Mikolov etal.NIPS20132.Thestrangegeometryofskip-gramwithnegativesampling,Mimno andThompson,EMNLP2017

Page 37: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(EntityVectors)

36

AdditiveNochange

Page 38: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(EntityVectors)

37

AdditiveNochange

MultiplicativeConicity decreases

Page 39: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(EntityVectors)

38

AdditiveNochange

Page 40: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(EntityVectors)

39

AdditiveNochange

MultiplicativeAVLIncreases

Page 41: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions

40

ModelType Vector Type Conicity AVL

AdditiveEntity NoChange NoChangeRelation NoChange NoChange

MultiplicativeEntity Decreases IncreasesRelation Decreases Increases

Page 42: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

41

Page 43: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

42

Additive

Page 44: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

43

HolE performsbadwithhigher

negatives

Page 45: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

44

NegativeSlope-NegativeCorrelation

Page 46: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

45

NegativeSlope-NegativeCorrelation

HigherNegatives-HigherSlopeMagnitude

Page 47: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

46

Page 48: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

47

AdditiveandHolE

Page 49: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

48

PositiveSlope-PositiveCorrelation

Page 50: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

49

PositiveSlope-PositiveCorrelation

HigherNegatives-HigherSlopeMagnitude

Page 51: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Correlationb/wGeometryandPerformance

50

• Additive:Nocorrelationbetweengeometryandperformance.

• Multiplicative:Forfixednumberofnegativesamples,• Conicity hasnegativecorrelationwithperformance• AVLhaspositivecorrelationwithperformance

Page 52: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

ConclusionandFutureWorks

• WeinitiatedthestudyofgeometricalbehaviorofKGembeddings andpresentedvariousinsights.

• Explorewhetherotherentity/relationfeatures(eg entitycategory)haveanycorrelationwithgeometry.

• ExploreothergeometricalmetricswhichhavebettercorrelationwithperformanceanduseitforlearningbetterKGembeddings.

51

Page 53: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Acknowledgements

• WethankGoogleforthetravelgrantforattendingACL2018.

• WethankMHRDIndia,Intel,Intuit,GoogleandAccentureforsupportingourwork.

• Wethankthereviewersfortheirconstructivecomments.

52

Page 54: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Thankyou

53

Page 55: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(RelationVectors)

54

AdditiveNochange

Page 56: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(RelationVectors)

55

AdditiveNochange

MultiplicativeConicity decreases

Page 57: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(RelationVectors)

56

AdditiveNochange

Page 58: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#NegativeSamples(RelationVectors)

57

AdditiveNochange

MultiplicativeNochangeexcept

HolE

Page 59: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(RelationVectors)

58

AdditiveNochange

Page 60: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(RelationVectors)

59

AdditiveNochange

MultiplicativeConicity decreases

Page 61: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(RelationVectors)

60

AdditiveNochange

Page 62: Towards Understanding the Geometry of Knowledge Graph ...€¦ · Lionel Messi FC Barcelona Argentina National Football Team 1. Knowledge Graphs (KG) Has Football Team Lionel Messi

Effectof#Dimensions(RelationVectors)

61

AdditiveNochange

MultiplicativeAVLIncreases