Knowledge Graph Reasoning Recent Advances William Wang Department

  • Slides: 57
Download presentation
Knowledge Graph Reasoning: Recent Advances William Wang Department of Computer Science CIPS Summer School

Knowledge Graph Reasoning: Recent Advances William Wang Department of Computer Science CIPS Summer School 2018 Beijing, China 1/20

Agenda • Motivation • Path-Based Reasoning • Embedding-Based Reasoning • Bridging Path-Based and Embedding-Based

Agenda • Motivation • Path-Based Reasoning • Embedding-Based Reasoning • Bridging Path-Based and Embedding-Based Reasoning: Deep. Path, MINERVA, and DIVA • Conclusions • Other Research Activities at UCSB NLP 2

Knowledge Graphs are Not Complete written. By Graham Yost tv. Program. Creator HBO Band

Knowledge Graphs are Not Complete written. By Graham Yost tv. Program. Creator HBO Band of Brothers . . . s cast. Actor country. Of. Origin ge United States Neal Mc. Donough a gu -1 nality natio Actor an service. Location-1 e ok p y. S r t un person. Languages co n. L Caesars Entertain… -1 n. In rso s e. La c i v er English pe age u g n profession Tom Hanks award. Work. Winner music Michael Kamen tv. Program. Genre Mini. Series 3

Benefits of Knowledge Graph • Support various applications • • • Structured Search Question

Benefits of Knowledge Graph • Support various applications • • • Structured Search Question Answering Dialogue Systems Relation Extraction Summarization • Knowledge Graphs can be constructed via information extraction from text, but… • There will be a lot of missing links. • Goal: complete the knowledge graph. 4

Reasoning on Knowledge Graph English Query node: Band of brothers ge a u ang

Reasoning on Knowledge Graph English Query node: Band of brothers ge a u ang L e c vi In Query relation: tv. Program. Language ser en k po S y Actor Caesars tr tv. Program. Language(Band of Brothers, ? ) n u person. Languages Entertain… co an n. L rso pe -1 United States Neal Mc. Donough cast. Actor country. Of. Origin written. By Graham Yost tv. Program. Creator HBO Band of Brothers . . . s -1 nality natio ge a gu service. Location-1 profession Tom Hanks award. Work. Winner music Michael Kamen tv. Program. Genre Mini. Series 5

KB Reasoning Tasks • Predicting the missing link. • Given e 1 and e

KB Reasoning Tasks • Predicting the missing link. • Given e 1 and e 2, predict the relation r. • Predicting the missing entity. • Given e 1 and relation r, predict the missing entity e 2. • Fact Prediction. • Given a triple, predict whether it is true or false. 6

Related Work • Path-based methods • • • Path-Ranking Algorithm, Lao et al. 2011

Related Work • Path-based methods • • • Path-Ranking Algorithm, Lao et al. 2011 Pro. PPR, Wang et al, 2013 (My Ph. D thesis) Subgraph Feature Extraction, Gardner et al, 2015 RNN + PRA, Neelakantan et al, 2015 Chains of Reasoning, Das et al, 2017 Why do we need path-based methods? It’s accurate and explainable! 7

Path-Ranking Algorithm (Lao et al. , 2011) • 1. Run random walk with restarts

Path-Ranking Algorithm (Lao et al. , 2011) • 1. Run random walk with restarts to derive many paths. • 2. Use supervised training to rank different paths. 8

Pro. PPR (Wang et al. , 2013; 2015) • Pro. PPR generalizes PRA with

Pro. PPR (Wang et al. , 2013; 2015) • Pro. PPR generalizes PRA with recursive probabilistic logic programs. • You may use other relations to jointly infer this target relation. 9

Chain of Reasoning (Das et al, 2017) • 1. Use PRA to derive the

Chain of Reasoning (Das et al, 2017) • 1. Use PRA to derive the path. • 2. Use RNNs to perform reasoning of the target relation. 10

Related Work • Embedding-based method • • • RESCAL, Nickel et al, 2011 Trans.

Related Work • Embedding-based method • • • RESCAL, Nickel et al, 2011 Trans. E, Bordes et al, 2013 Neural Tensor Network, Socher et al, 2013 Trans. R/CTrans. R, Lin et al, 2015 Complex Embeddings, Trouillon et al, 2016 Embedding methods allow us to compare, and find similar entities in the vector space. 11

Bridging Path-Based and Embedding. Based Reasoning with Deep Reinforcement Learning: Deep. Path (Xiong et

Bridging Path-Based and Embedding. Based Reasoning with Deep Reinforcement Learning: Deep. Path (Xiong et al. , 2017) 12

RL for KB Reasoning: Deep. Path (Xiong et al. , 2017) Ø Learning the

RL for KB Reasoning: Deep. Path (Xiong et al. , 2017) Ø Learning the paths with RL, instead of using random walks with restart Ø Model the path finding as a MDP Ø Train a RL agent to find paths Ø Represent the KG with pretrained KG embeddings Ø Use the learned paths as logical formulas 13

Machine Learning Supervise d Learning Unsupervise d Learning Reinforcement Learning 1 4

Machine Learning Supervise d Learning Unsupervise d Learning Reinforcement Learning 1 4

Supervised v. s. Reinforcement Supervised Learning ◦ Training based on supervisor/label/annotation ◦ Feedback is

Supervised v. s. Reinforcement Supervised Learning ◦ Training based on supervisor/label/annotation ◦ Feedback is instantaneous ◦ Not much temporal aspects Reinforcement Learning ◦ Training only based on reward signal ◦ Feedback is delayed ◦ Time matters ◦ Agent actions affect subsequent exploration 1 5

Reinforcement Learning • RL is a general purpose framework for decision making • •

Reinforcement Learning • RL is a general purpose framework for decision making • • ◦ RL is for an agent with the capacity to act ◦ Each action influences the agent’s future state ◦ Success is measured by a scalar reward signal ◦ Goal: select actions to maximize future reward 1 6

Reinforcement Learning Agent Environment Agent Multi-layer neural nets ѱ(st ) Environment KG modeled as

Reinforcement Learning Agent Environment Agent Multi-layer neural nets ѱ(st ) Environment KG modeled as a MDP 17

Deep. Path: RL for KG Reasoning 18

Deep. Path: RL for KG Reasoning 18

Components of MDP • 19

Components of MDP • 19

Reward Functions • Global Accuracy • Path Efficiency • Path Diversity 20

Reward Functions • Global Accuracy • Path Efficiency • Path Diversity 20

Training with Policy Gradient • Monte-Carlo Policy Gradient (REINFORCE, William, 1992) 21

Training with Policy Gradient • Monte-Carlo Policy Gradient (REINFORCE, William, 1992) 21

Challenge Ø Typical RL problems q Atari games (Mnih et al. , 2015): 4~18

Challenge Ø Typical RL problems q Atari games (Mnih et al. , 2015): 4~18 valid actions q Alpha. Go (Silver et al. 2016): ~250 valid actions q Knowledge Graph reasoning: >= 400 actions Issue: q large action (search) space -> poor convergence properties 22

Supervised (Imitation) Policy Learning § Use randomized BFS to retrieve a few paths §

Supervised (Imitation) Policy Learning § Use randomized BFS to retrieve a few paths § Do imitation learning using the retrieved paths § All the paths are assigned with +1 reward 23

Datasets and Preprocessing Dataset # of Entities # of Relations # of Triples #

Datasets and Preprocessing Dataset # of Entities # of Relations # of Triples # of Tasks FB 15 k-237 14, 505 237 310, 116 20 NELL-995 75, 492 200 154, 213 12 FB 15 k-237: Sampled from FB 15 k (Bordes et al. , 2013), redundant relations removes NELL-995: Sampled from the 995 th iteration of NELL system (Carlson et al. , 2010 b) Ø Dataset processing q Remove useless relations: haswikipediaurl, generalizations, etc q Add inverse relation links to the knowledge graph q Remove the triples with task relations 24

Effect of Supervised Policy Learning • x-axis: number of training epochs • y-axis: success

Effect of Supervised Policy Learning • x-axis: number of training epochs • y-axis: success ratio (probability of reaching the target) on test set -> Re-train the agent using reward functions 25

Inference Using Learned Paths § Path as logical formula § Film. Country: action. Film-1

Inference Using Learned Paths § Path as logical formula § Film. Country: action. Film-1 -> person. Nationality § Person. Nationality: place. Of. Birth -> location. Contains-1 § etc … § Bi-directional path-constrained search § Check whether the formulas hold for entity pairs … … Uni-directional search bi-directional search 26

Link Prediction Result Tasks PRA Ours Trans. E Trans. R works. For 0. 681

Link Prediction Result Tasks PRA Ours Trans. E Trans. R works. For 0. 681 0. 711 0. 677 0. 692 athelet. Plays. For. Tea m 0. 987 0. 955 0. 896 0. 784 athlete. Plays. In. Leag ue 0. 841 0. 960 0. 773 0. 912 athlete. Home. Stadiu m 0. 859 0. 890 0. 718 0. 722 team. Plays. Sports 0. 791 0. 738 0. 761 0. 814 org. Hire. Person 0. 599 0. 742 0. 719 0. 737 person. Leads. Org 0. 700 0. 795 0. 751 0. 772 0. 675 0. 796 0. 737 0. 789 … Overall Mean average precision on NELL-995 27

Qualitative Analysis Path length distributions 28

Qualitative Analysis Path length distributions 28

Qualitative Analysis Example Paths place. Of. Birth -> location. Contains-1 person. Nationality: people. Place.

Qualitative Analysis Example Paths place. Of. Birth -> location. Contains-1 person. Nationality: people. Place. Lived -> location. Contains-1 people. Mariage -> location. Of. Ceremony -> location. Contains-1 tv. Country. Of. Origin -> country. Official. Language tv. Program. Language: tv. Country. Of. Origin -> film. Release. Region-1 -> film. Language tv. Cast. Actor -> person. Language athlete. Home. Stadium -> team. Home. Stadium-1 athlete. Plays. For. Team: athlete. Plays. Sports -> team. Plays. Sports-1 athelete. Led. Sports. Team 29

Bridging Path-Finding and Reasoning w. Variational Inference (teaser): DIVA (Chen et al. , NAACL

Bridging Path-Finding and Reasoning w. Variational Inference (teaser): DIVA (Chen et al. , NAACL 2018) 30

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Inferring latent paths

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Inferring latent paths connecting entity nodes. English country. Speak. Language United States 31

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Inferring latent paths

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Inferring latent paths connecting entity nodes by parameterizing likelihood (path reasoning) and prior (path finding) with neural network modules. English Band of Brothers Condition likelihood prior ? Unobserved Variable L tv. Program Language 32

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • DP Kingma et

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • DP Kingma et al. 013 33

Parameterization – Path-finder • KG 34

Parameterization – Path-finder • KG 34

Parameterization – Path Reasoner • 35

Parameterization – Path Reasoner • 35

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Training KG connected

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Training KG connected Path relation KLdivergence KG connected Path 36

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Testing relation KG

DIVA: Variational KB Reasoning (Chen et al. , NAACL 2018) • Testing relation KG connected Path 37

Conclusions • Embedding-based methods are very scalable and robust. • Path-based methods are more

Conclusions • Embedding-based methods are very scalable and robust. • Path-based methods are more interpretable. • There are some recent efforts in unifying embedding and path-based approaches. • DIVA integrates path-finding and reasoning in a principled variational inference framework. 38

UCSB NLP • Natural Language Processing • Information Extraction: relation extraction, and distant supervision.

UCSB NLP • Natural Language Processing • Information Extraction: relation extraction, and distant supervision. • Summarization: abstractive summarization. • Social Media: non-standard English expressions. • Language & Vision: action/relation detection, and video captioning. • Spoken Language Processing: task-oriented neural dialogue systems. • Machine Learning • Statistical Relational Learning: neural symbolic reasoning. • Deep Learning: sequence-to-sequence models. • Structure Learning: learning the structures for neural models. • Reinforcement Learning: efficient and effective methods for DRL and NLP. • Artificial Intelligence • Knowledge Representation & Reasoning: beyond Freebase/Open. IE. • Knowledge Graphs: construction, completion, and reasoning. 39

Other Research Activities at UCSB’s NLP Group 40

Other Research Activities at UCSB’s NLP Group 40

Natural Language Generation 41

Natural Language Generation 41

Reinforced Conditional Variational Autoencoder for Generating Emotional Sentences (Zhou and Wang, ACL 2018) https:

Reinforced Conditional Variational Autoencoder for Generating Emotional Sentences (Zhou and Wang, ACL 2018) https: //arxiv. org/abs/1711. 04090 42

Controlling Emotions for RC-VAE Generated Sentences User’s Input sorry guys , was gunna stream

Controlling Emotions for RC-VAE Generated Sentences User’s Input sorry guys , was gunna stream tonight but i ’m still feeling sick Designated Emojis Generated by i ’m sorry you ’re i ’m sorry for Seq 2 Seq going to be your loss Baseline missed it Generated By Moji. Talk hope you are okay hun ! hi jason , i ’ll be praying for you 43

Hierarchical Deep Reinforcement Learning for Video Captioning (Wang et al. , CVPR 2018) 44

Hierarchical Deep Reinforcement Learning for Video Captioning (Wang et al. , CVPR 2018) 44

Deep Multimodal Video Captioning (Wang et al. , NAACL 2018) 45

Deep Multimodal Video Captioning (Wang et al. , NAACL 2018) 45

Adversarial Reward Learning for Visual Storytelling (Wang et al. , ACL 2018) 46

Adversarial Reward Learning for Visual Storytelling (Wang et al. , ACL 2018) 46

Computational Social Science 47

Computational Social Science 47

Learning to Generate Slang Explanations (Ke Ni, IJCNLP 2017) 48

Learning to Generate Slang Explanations (Ke Ni, IJCNLP 2017) 48

Automatic Generation of Slang Words (Kulkarni and Wang, NAACL 2018) 49

Automatic Generation of Slang Words (Kulkarni and Wang, NAACL 2018) 49

Leveraging Intra-Speaker and Inter. Speaker Representation Learning for Hate Speech Detection (Qian et al.

Leveraging Intra-Speaker and Inter. Speaker Representation Learning for Hate Speech Detection (Qian et al. , NAACL 2018) 50

Deep Reinforcement Learning 51

Deep Reinforcement Learning 51

Scheduled Policy Optimization (Xiong et al. , IJCAI 2018) 52

Scheduled Policy Optimization (Xiong et al. , IJCAI 2018) 52

Combining Model-Free and Model Based Deep Reinforcement Learning (Wang et al. , ECCV 2018)

Combining Model-Free and Model Based Deep Reinforcement Learning (Wang et al. , ECCV 2018) 53

Structure Learning 54

Structure Learning 54

Learning Activation Functions in Deep Neural Networks (Conner Vercellino, NIPS Meta. Learning) 55

Learning Activation Functions in Deep Neural Networks (Conner Vercellino, NIPS Meta. Learning) 55

Acknowledgment Sponsors: Adobe, Amazon, Byte. Dance, DARPA, Facebook, Google, IBM, Log. Me. In, NVIDIA,

Acknowledgment Sponsors: Adobe, Amazon, Byte. Dance, DARPA, Facebook, Google, IBM, Log. Me. In, NVIDIA, Tencent. 56

Thanks! Questions? nlp. cs. ucsb. edu Deep. Path Source code: https: //github. com/xwhan/Deep. Path

Thanks! Questions? nlp. cs. ucsb. edu Deep. Path Source code: https: //github. com/xwhan/Deep. Path KBGAN Source code: https: //github. com/cai-lw/KBGAN Scheduled Policy Optimization: https: //github. com/xwhan/walk_the_blocks Pro. PPR Source code: https: //github. com/Team. Cohen/Pro. PPR AREL Source code: https: //github. com/littlekobe/AREL 57