MINERVA
Meandering In Networks of Entities to Reach Verisimilar Answers Edit Add topics
view repo
Knowledge bases (KB), both automatically and manually constructed, are often incomplete --- many valid facts can be inferred from the KB by synthesizing existing information. A popular approach to KB completion is to infer new relations by combinatory reasoning over the information found along other paths connecting a pair of entities. Given the enormous size of KBs and the exponential number of paths, previous path-based models have considered only the problem of predicting a missing relation given two entities or evaluating the truth of a proposed triple. Additionally, these methods have traditionally used random paths between fixed entity pairs or more recently learned to pick paths between them. We propose a new algorithm MINERVA, which addresses the much more difficult and practical task of answering questions where the relation is known, but only one entity. Since random walks are impractical in a setting with combinatorially many destinations from a start node, we present a neural reinforcement learning approach which learns how to navigate the graph conditioned on the input query to find predictive paths. Empirically, this approach obtains state-of-the-art results on several datasets, significantly outperforming prior methods.
READ FULL TEXT VIEW PDFMeandering In Networks of Entities to Reach Verisimilar Answers Edit Add topics
Automated reasoning, the ability of computing systems to make new inferences from observed evidence, has been a long standing goal of artificial intelligence. We are interested in automated reasoning on large knowledge bases (KB) with rich and diverse semantics (Suchanek et al., 2007; Bollacker et al., 2008; Carlson et al., 2010). KBs are highly incomplete (Min et al., 2013)
, and facts not directly stored in a KB can often be inferred from those that are, creating exciting opportunities and challenges for automated reasoning. For example, consider the small knowledge graph in figure
1. We can infer the (unobserved fact) home stadium of Colin Kaepernick from the following reasoning path: . Our goal is to automatically learn such reasoning paths in KBs. We frame the learning problem as one of query answering, that is to say, answering questions of the form (Colin Kaepernick, PlaysInLeague, ).From its early days, the focus of automated reasoning approaches has been to build systems which can learn crisp symbolic logical rules (McCarthy, 1960; Nilsson, 1991)
. Symbolic representations have also been integrated with machine learning especially in statistical relational learning
(Muggleton et al., 1992; Getoor & Taskar, 2007; Kok & Domingos, 2007; Lao et al., 2011), but due to poor generalization performance, these approaches have largely been superceded by distributed vector representations. Learning embedding of entities and relations using tensor factorization or neural methods has been a popular approach (Nickel et al., 2011; Bordes et al., 2013; Socher et al., 2013; inter alia), but these methods cannot capture chains of reasoning expressed by KB paths. Neural multi-hop models
(Neelakantan et al., 2015; Guu et al., 2015; Toutanova et al., 2016) address the aforementioned problems to some extent by operating on KB paths in vector space. However, these models take as input a set of paths which are gathered by performing random walks independent of the query relation. Additionally, models such as Neelakantan et al. (2015); Das et al. (2017) use the same set of initially collected paths to answer a diverse set of query types (e.g. MarriedTo, Nationality, WorksIn etc.).This paper presents a method for efficiently searching the graph for answer-providing paths using reinforcement learning (RL) conditioned on the input question, eliminating any need for precomputed paths. Given a massive knowledge graph, we learn a policy, which, given the query , starts from and learns to walk to the answer node by choosing to take a labeled relation edge at each step, conditioning on the query relation and entire path history. This formulates the query-answering task as a reinforcement learning (RL) problem where the goal is to take an optimal sequence of decisions (choices of relation edges) to maximize the expected reward (reaching the correct answer node). We call the RL agent minerva for ”Meandering In Networks of Entities to Reach Verisimilar Answers.”
Our RL-based formulation has many desirable properties. First, minerva has the built-in flexibility to take paths of variable length, which is important for answering harder questions that require complex chains of reasoning (Shen et al., 2017). Secondly, minerva needs no pretraining and trains on the knowledge graph from scratch with reinforcement learning; no other supervision or fine-tuning is required representing a significant advance over prior applications of RL in NLP. Third, our path-based approach is computationally efficient, since by searching in a small neighborhood around the query entity it avoids ranking all entities in the KB as in prior work. Finally, the reasoning paths found by our agent automatically form an interpretable provenance for its predictions.
figuret
The main contributions of the paper are: (a) We present agent minerva, which learns to do query answering by walking on a knowledge graph conditioned on an input query, stopping when it reaches the answer node. The agent is trained using reinforcement learning, specifically policy gradients (§ 2). (b) We evaluate minerva on several benchmark datasets and compare favorably to Neural Theorem Provers (NTP) (Rocktäschel & Riedel, 2017) and Neural LP (Yang et al., 2017), which do logical rule learning in KBs, and also state-of-the-art embedding based methods such as DistMult (Yang et al., 2015) and ComplEx (Trouillon et al., 2016). (c) We also extend minerva to handle partially structured natural language queries and test it on the WikiMovies dataset (§ 4.3) (Miller et al., 2016).
We also compare to DeepPath (Xiong et al., 2017) which uses reinforcement learning to pick paths between entity pairs. The main difference is that the state of their RL agent includes the answer entity since it is designed for the simpler task of predicting if a fact is true or not. As such their method cannot be applied directly to our more challenging query answering task where the second entity is unknown and must be inferred. Nevertheless, minerva outperforms DeepPath on their benchmark nell-995 dataset when compared in their experimental setting (§ 4.1).
We formally define the task of query answering in a KB. Let denote the set of entities and be the set of binary relations. Then a KB is a collection of facts stored as triplets where and . Query answering seeks to answer questions of the form , e.g. Toronto, locatedIn, . We would also like to clearly point out the difference between query answering and the task of fact prediction. Fact prediction involves predicting if a fact is true or not, e.g. (Toronto, locatedIn, Canada)?. This task is easier than predicting the correct entity as the answer in query answering since the latter require finding the answer entity among many possible entities.
Next we describe how we reduce the problem of query answering in a KB to a finite horizon sequential decision making problem and solve it using reinforcement learning. We begin by representing the environment as a deterministic Markov decision process on a knowledge graph
derived from the KB (§2.1). Our RL agent is given an input query of the form . Starting from vertex corresponding to in the knowledge graph , the agent learns to traverse the environment/graph to mine the answer and stop when it determines the answer (§ 2.2). The agent is trained using policy gradient more specifically by reinforce (Williams, 1992) with control variates (§ 2.3). Let us begin by describing the environment.Our environment is a finite horizon, deterministic and partially observed Markov decision process that lies on a knowledge graph derived from the KB. Recall that a KB is collection of facts stored as triplets where and . From the KB, a knowledge graph can be constructed where the entities are represented as the nodes and relation as labeled edge between them. Formally, a knowledge graph is a directed labeled multigraph , where and denote the vertices and edges of the graph respectively. Note that and . Also, following previous approaches (Bordes et al., 2013; Neelakantan et al., 2015; Xiong et al., 2017), we add the inverse relation of every edge, i.e. for an edge , we add the edge to the graph. (If the set of binary relations does not contain the inverse relation , it is added to as well.) On this graph we will now specify a deterministic partially observable Markov decision process, which is a 5-tuple , each of which we elaborate below.
States. The state space consists of all possible query-answers cartesian product with the set of entities. Intuitively, we want a state to encode the query (), the answer (), and a location of exploration (current node of the entity). Thus overall a state is represented by and the state space consists of all valid combinations.
Observations. The complete state of the environment is not observable, but only its current location of exploration and query can be observed but not the answer, i.e. only is observed. Formally the observation function is defined as .
Actions. The set of possible actions from a state consists of all outgoing edges of the vertex in . Formally . Basically, this means an agent at each state has option to select which outgoing edge it wishes to take having the knowledge of the label of the edge and destination vertex .
During implementation, we unroll the computation graph up to a fixed number of time steps . We augment each node with a special action called ‘no_op’ which goes from a node to itself. Some questions are easier to answer and needs lesser steps of reasoning than others. This design decision allows the agent to remain at a node for any number of time steps. This is especially helpful when the agent has managed to reach a correct answer at a time step and can continue to stay at the ‘answer node’ for the rest of the time steps. Alternatively, we could have allowed the agent to take a special ‘stop’ action, but we found the current setup to work sufficiently well. As mentioned before, we also add the inverse relation of a triple, i.e. for the triple , we add the triple to the graph. We found this important because this actually equips our agent to undo a potentially wrong decision as it can retract back to the current node in the next step.
Transition. The environment evolves deterministically by just updating the state to the new vertex pointed by the edge selected by the agent through its action. The query and answer remains the same. Formally, the transition function is defined by , where and .
Rewards. We only have a terminal reward of +1 if the current location is the correct answer at the end and 0 otherwise. To elaborate, if is the final state, then we receive a reward of +1 if else 0.=, i.e. .
To solve the finite horizon deterministic partially observable Markov decision process described above, we aim to design a randomized history-dependent policy , where and history
is just the sequence of observations and actions taken. We restrict ourselves to the function class expressed by long short-term memory network (LSTM)
(Hochreiter & Schmidhuber, 1997) for learning the randomized history-dependent policy.An agent based on LSTM encodes the history as a continuous vector . We also have embedding matrix and for the binary relations and entities respectively. The history embedding for is updated according to LSTM dynamics:
(1) |
where and denote the vector representation for action/relation at time and observation/entity at time respectively and denote vector concatenation. To elucidate, , i.e. the embedding of the relation corresponding to label of the edge the agent chose at time and if i.e. the embedding of the entity corresponding to vertex the agent is at time .
Based on the history embedding , the policy network makes the decision to choose an action from all available actions conditioned on the query relation. Recall that each possible action represents an outgoing edge with information of the edge relation label and destination vertex/entity . So embedding for each is , and stacking embeddings for all the outgoing edges we obtain the matrix
. The network taking these as inputs is parameterized as a two-layer feed-forward network with ReLU nonlinearity which takes in the current history representation
and the embedding for the query relationand outputs a probability distribution over the possible actions from which a discrete action is sampled. In other words,
Note that the nodes in do not have a fixed ordering or number of edges coming out from them. The size of matrix is , so the decision probabilities lies on simplex of size
. Also the procedure above is invariant to order in which edges are presented as desired and falls in purview of neural networks designed to be permutation invariant
Zaheer et al. (2017). Finally, to summarise, the parameters of the LSTM, the weights , , the corresponding biases (not shown above for brevity), and the embedding matrices form the parameters of the policy network.For the policy network () described above, we want to find parameters that maximizes the expected reward:
where we assume there is a true underlying distribution . To solve this optimization problem, we employ REINFORCE (Williams, 1992) as follows:
[leftmargin=9mm, itemsep=2pt]
The first expectation is replaced with empirical average over the training dataset.
For the second expectation, we approximate by running multiple rollouts for each training example. The number of rollouts is fixed and for all our experiments we set this number to 20.
For variance reduction, a common strategy is to use an additive control variate baseline
(Hammersley, 2013; Fishman, 2013; Evans & Swartz, 2000). We use a moving average of the cumulative discounted reward as the baseline. We tune the weight of this moving average as a hyperparameter. Note that in our experiments we found that learnt baseline performed similarly, but we finally settled for cumulative discounted reward as the baseline owing to its simplicity.
To encourage the policy to sample more diverse paths rather than sticking with a few, we add an entropy regularization term to our cost function after multiplying it by a constant . We treat as a hyperparameter to control the exploration exploitation trade-off.
Experimental Details We choose the relation and embedding dimension size as 200. The action embedding is formed by concatenating the entity and relation embedding. We use a 3 layer LSTM with dimension size of 400. The hidden layer size of MLP (weights and ) is set to 400. We use Adam (Kingma & Ba, 2014) with the default parameters in REINFORCE for the update. The best hyperparameter values can be found in appendix.
Dataset | #entities | #relations | #facts | #queries |
countries | 272 | 2 | 1158 | 24 |
umls | 135 | 49 | 5,216 | 661 |
kinship | 104 | 26 | 10686 | 1074 |
wn18rr | 40,945 | 15 | 86,835 | 3134 |
nell-995 | 75,492 | 200 | 154,213 | 3992 |
fb15k-237 | 14,505 | 237 | 272,115 | 20,466 |
WikiMovies | 43,230 | 9 | 196,453 | 9952 |
Task | Metric | Model | |||
---|---|---|---|---|---|
ComplEx | NTP | NTP- | minerva | ||
S1 | 99.370.4 | 90.8315.4 | 100.00.0 | 100.00.0 | |
S2 | AUC-PR | 87.952.8 | 87.411.7 | 93.040.4 | 910.01 |
S3 | 48.446.3 | 56.6817.6 | 77.2617.0 | 930.01 |
We test our model on the following query answering datasets. (a) countries (Bouchard et al., 2015), (b) Alyawarra kinship (kinship), (c) Unified Medical Language Systems (umls) (Kok & Domingos, 2007) (d) wn18rr (Dettmers et al., 2017), (e) nell-995, (f) fb15k-237 (g) WikiMovies (Miller et al., 2016). We also test on a synthetic grid world dataset released by Yang et al. (2017) to test the ability of the model to learn rules of long length.
The countries dataset is carefully designed to explicitly test the logical rule learning and reasoning capabilities of link prediction models. The dataset has 3 tasks (S1-3 in table 2) each requiring reasoning steps of increasing length and difficulty (see Rocktäschel & Riedel (2017) for more details about the tasks). We also test our model on existing large and challenging KG datasets ((d) - (f)). wn18rr is created from the original wordnet18 dataset by removing test triples which can be answered trivially, making the datasets more realistic and challenging. Additionally, we test our model on a question answering dataset - WikiMovies (Miller et al., 2016) where the query is in natural language but the answers can be found in an accompanying KB. Table 1 report the various statistics of the datasets.
This section describes the experimental results on the various knowledge graph query answering datasets. During inference, we do beam search with a beam width of 40 and rank entities by the probability of the trajectory the model took to reach the entity.
Model | umls | kinship |
---|---|---|
NeuralLP | 0.70 | 0.73 |
minerva | 0.91 | 0.93 |
countries, kinship, umls. We first test minerva on the countries dataset which is explicitly designed to test the ability of models to learn logical rules. It contains countries, regions and subregions as entities. The queries are of the form LocatedIn(c, ?) and the answer is a region. For example, LocatedIn(Egypt, ?) with the answer as Africa. Our experimental settings and scores are directly comparable to NTP and ComplEx (Trouillon et al., 2016). NTP- is a NTP model trained with an additional objective function of ComplEx. We also compare minerva against Neural LP (Yang et al., 2017) on the umls and kinship datasets.
The evaluation metric we report is
hits@k - which is the percentage of correct entities ranked in top-k. For the countries dataset, we report the area under the precision-recall curve for comparing with the baselines. Following the design of the countries dataset, for task S1 and S2, we set the maximum path length and for S3, we set .Table 2 shows that minerva outperforms all the baseline models except on the task S2 of countries, where the ensemble model ntp- outperforms it, albeit with a higher variance across runs. Our gains are much more prominent in task S3, which is the hardest among all the tasks. We similarly outperform NeuralLP on the umls and kinship datasets.
Nell-995 We also compare minerva to DeepPath. For a fair comparison, we only rank the answer entities against the negative examples in the dataset used in their experiments^{2}^{2}2We are grateful to Xiong et al. (2017) for releasing the negative examples used in their experiments. and report the mean average precision (MAP) scores for each query relation. DeepPath feeds the paths its agent gathers as input features to the path ranking algorithm (PRA) (Lao et al., 2011)
, which trains a per-relation classifier. But unlike them, we train one model which learns for all query relations. If our agent is not able to reach the correct entity or one of the negative entities, the corresponding query gets a score of negative infinity. As show in table
4.1, we outperform them or achieve comparable performance for all the query relations For this experiment, we set the maximum length .Model | hits@1 | hits@3 | hits@10 |
---|---|---|---|
ConvE | 0.306 | 0.360 | 0.411 |
DistMult | 0.389 | 0.439 | 0.491 |
ComplEx | 0.411 | 0.458 | 0.507 |
minerva | 0.413 | 0.456 | 0.513 |
wn18rr Next we test minerva on another large KB dataset – wn18rr. On this dataset, we compare with three recently proposed latent factorization model – (a) ConvE (Dettmers et al., 2017), (b) DistMult (Yang et al., 2015), (c) ComplEx (Trouillon et al., 2016). We report hits at various and we compare favorably with the state-of-the-art results of ComplEx in all settings (table 4). For this experiment, we also set the maximum length .
Model | hits@10 |
---|---|
ConvE | 0.458 |
DistMult | 0.568 |
ComplEx | 0.419 |
minerva | 0.456 |
tablePerformance on fb15k-237
FB15k-237 We test minerva on yet another popular KB dataset – FB15K-237. The baselines are the same as before, however our implementation of DistMult gave a score of 56.8 hits@10 which, to our knowledge, is the highest score reported on this dataset^{3}^{3}3We are aware of the high variance of DistMult scores reported on FB15k-237 by several papers, but to ensure fairness we report the high scores our in-house implementation achieved..The performance of ConvE and ComplEx are taken from Dettmers et al. (2017). Even though minerva performs comparably to ConvE and ComplEx, the results are significantly behind the performance of DistMult.
Upon delving more into the structure of knowledge graph derived from FB15K-237, we found few interesting characteristics of the dataset. As a prelude, we would like to describe a long existing concept in graph theory – clustering coefficient (Holland & Leinhardt, 1971; Watts & Strogatz, 1998). Clustering coefficient () of a graph measures whether groups of nodes form ‘tightly knit’ communities - i.e. whether groups of nodes tend to cluster together. A high implies the presence of higher number of densely connected groups of nodes. For instance, if we consider three nodes and , a high means with high probability whenever three nodes are connected as — — , it implies nodes — are also connected forming a triangle. Intuitively, minerva can use such closed shapes to learn paths such as ( — — ) to predict the answer of the query, i.e. the third node (). The clustering coefficient also extends from triangles to cliques of arbitrary size (Watts & Strogatz, 1998). Figure 4.1 plots for various datasets. We find that FB15k-237 has the least clustering coefficient (0.19) among all datasets. This means that the dataset has sparse neighborhoods and hence minerva finds it difficult to learn logical rules. We also check the frequency of occurrence of various unique paths (types). We define a path type as the sequence of relations (ignoring the entities) in a path. Intuitively, a predictive path which generalizes across queries will occur many number of times in the graph. Figure 4.1 shows the plot. As we can see, the characteristics of FB15k-237 is quite different from other datasets. Path types do not repeat that often, making it hard for minerva to learn paths which generalizes. We also provide further analysis of the types of various query relation in FB15k-237 in the appendix.
As we empirically find and also noted by previous work (Rocktäschel & Riedel, 2017; Das et al., 2017; Yang et al., 2017), often the reasoning chains required to answer queries in KB is not too long (restricted to 3 or 4 hops). To test if our model can learn long reasoning paths, we test our model on a synthetic 16-by-16 grid world dataset created by Yang et al. (2017), where the task is to navigate to a particular cell (answer entity) starting from a random cell (start entity) by following a set of directions (query relation). The KB consists of atomic triples of the form ((2,1), North, (1,1)) – entity (1,1) is north of entity (2,1). The queries consists of a sequence of directions (e.g. North, SouthWest, East). The queries are classified into classes based on the path lengths. Figure 2 shows the accuracy on varying path lengths. Compared to Neural LP, minerva is much more robust for queries which require longer path lengths showing a very little degrade in performance for even the longest path length in the dataset.
Model | Accuracy |
---|---|
Memory Network | 78.5 |
QA system | 93.5 |
Key-Value Memory Network | 93.9 |
Neural LP | 94.6 |
minerva | 96.7 |
Queries in KB datasets are structured in the form of triples. However, this is unsatisfactory since for most real applications, the queries appear in natural language. As a first step in this direction, we extend minerva to take in “partially structured” queries. We use the WikiMovies dataset (Miller et al., 2016) which contains questions in natural language albeit generated by templates created by human annotators. An example question from the dataset is “Which is a film written by Herb Freed?”. WikiMovies also has an accompanying KB which can be used to answer all the questions.
We link the entity occurring in the question to the KB via simple string matching. To form the vector representation of the query relation, we design a simple question encoder which computes the average of the embeddings of the question words. The word embeddings are learned from scratch and we do not use any pretrained embeddings. We compare our results with those reported in Yang et al. (2017) (table 5). We got the best result using , suggesting that WikiMovies is not the best testbed for multihop reasoning, but this experiment is a promising first step towards the realistic setup of having textual queries and knowledge bases.
Effectiveness of Remembering Path History. minerva encodes the history of decisions it has taken in the past using LSTMs. To test the importance of remembering the sequence of decisions, we did an ablation study in which the agent chose the next action based on only local information i.e. current entity and query and did not have access to the history . For the kinship dataset, we observe a 27% points decrease in hits@1 (0.184 v/s 0.46) and 13% decrease in hits@10 (0.63 v/s 0.76). For grid-world, it is also not surprising that we see a big drop in performance. The final accuracy is 0.23 for path lengths 2-4 and 0.04 for lengths 8-10. For nell, the performance dropped from 0.576 to 0.564 and for FB15k-237 the hits@10 performance dropped from 0.456 to 0.408.
NO-OP and Inverse Relations. At each step, minerva can choose to take a no-op edge and remain at the same node. This gives the agent the flexibility of taking paths of variable lengths. Some questions are easier to answer than others and require lesser steps of reasoning and if the agent reaches the answer early, it can choose to remain there. Example (i) in table 6 shows such an example. Similarly inverse relation gives the agent the ability to recover from a potentially wrong decision it has taken before. Example (ii) shows such an example, where the agent took a incorrect decision at the first step but was able to revert the decision because of the presence of inverted edges.
Query based Decision Making. At each step before making a decision, our agent conditions on the query relation. Figure 2 shows examples, where based on the query relation, the probabilities are peaked on different actions. For example, when the query relation is WorksFor, minerva assigns a much higher probability of taking the edge CoachesTeam than AthletePlaysInLeague. We also see similar behavior on the WikiMovies dataset where the query consists of words instead of fixed schema relation.
Inference Time. minerva is efficient at inference time since it has to essentially search for answer entities in its local neighborhood, whereas previous methods rank all the entities in the dataset. For instance, on the test dataset of wn18rr, the wall clock running time of minerva is 63 seconds whereas that of a GPU implementation of DistMult is 211 seconds (with the maximum batch size).
(i) Can learn general rules: |
(S1) LocatedInX, Y LocatedInX, Z & LocatedInZ, Y |
(S2) LocatedInX, Y NeighborOfX, Z & LocatedInZ, Y |
(S3) LocatedInX, Y NeighborOfX, Z & NeighborOfZ, W & LocatedInW, Y |
(ii) Can learn shorter path: Richard F. Velky ? |
Richard F. Velky Schaghticokes Schaghticokes Schaghticokes |
(iii) Can recover from mistakes: Donald Graham ? |
Donald Graham TNT Post Donald Graham Wash Post |
.
Learning vector representations of entities and relations using tensor factorization (Nickel et al., 2011, 2012; Bordes et al., 2013; Riedel et al., 2013; Nickel et al., 2014; Yang et al., 2015) or neural methods (Socher et al., 2013; Toutanova et al., 2015; Verga et al., 2016) has been a popular approach to reasoning with a knowledge base. However, these methods cannot capture more complex reasoning patterns such as those found by following inference paths in KBs. Multi-hop link prediction approaches (Lao et al., 2011; Neelakantan et al., 2015; Guu et al., 2015; Toutanova et al., 2016; Das et al., 2017) address the problems above, but the reasoning paths that they operate on are gathered by performing random walks independent of the type of query relation. Lao et al. (2011)
further filters paths from the set of sampled paths based on the restriction that the path must end at one of the target entities in the training set and are within a maximum length. These constraints make them query dependent but they are heuristic in nature. Our approach eliminates any necessity to pre-compute paths and learns to efficiently search the graph conditioned on the input query relation.
Inductive Logic Programming (ILP)
(Muggleton et al., 1992) aims to learn general purpose predicate rules from examples and background knowledge. Early work in ILP such as FOIL (Quinlan, 1990), PROGOL (Muggleton, 1995) are either rule-based or require negative examples which is often hard to find in KBs (by design, KBs store true facts). Statistical relational learning methods (Getoor & Taskar, 2007; Kok & Domingos, 2007; Schoenmackers et al., 2010) along with probabilistic logic (Richardson & Domingos, 2006; Broecheler et al., 2010; Wang et al., 2013) combine machine learning and logic but these approaches operate on symbols rather than vectors and hence do not enjoy the generalization properties of embedding based approaches.Neural Theorem Provers (NTP) (Rocktäschel & Riedel, 2017) and Neural LP (Yang et al., 2017) are two recent methods in learning logical rules that can be trained end-to-end with gradient based learning. NTPs are constructed by Prolog’s backward chaining inference method. It operates on vectors rather than symbols, thereby providing a success score for each proof path. However, since a score can be computed between any two vectors, the computation graph becomes quite large because of such soft-matching during substitution step of backward chaining. For tractability, it resides to heuristics such as only keeping the top-K scoring proof paths, but it loses any guarantee of computing exact gradients. Also the efficacy of NTPs has yet to be shown on large KBs. Neural LP introduces a differential rule learning system using operators defined in TensorLog (Cohen, 2016) and has a LSTM based controller and a differentiable memory component (Graves et al., 2014; Sukhbaatar et al., 2015) and the rule scores are calculated via attention. Even though, differentiable memory allows the network to be trained end to end, it necessitates accessing the entire memory which can be computationally expensive. RL approaches which can make hard selection of memory (Zaremba & Sutskever, 2015) are computationally attractive. minerva uses a similar hard selection of relation edges to walk on the graph. More importantly, minerva outperforms both these methods on their respective benchmark datasets.
DeepPath (Xiong et al., 2017) uses RL based approaches to find paths in KBs. However, the state of their MDP requires the target entity to be known in advance and hence their path finding strategy is dependent on knowing the answer entity. minerva does not need any knowledge of the target entity and instead learns to find the answer entity among all entities. DeepPath, additionally feeds its gathered paths to Path Ranking Algorithm (Lao et al., 2011), whereas minerva is a complete system trained to do query answering. DeepPath also uses fixed pretrained embeddings for its entity and relations. Lastly, on comparing minerva with DeepPath in their experimental setting on the NELL dataset, we match their performance or outperform them.
minerva is also similar to methods for learning to search for structured prediction (Collins & Roark, 2004; Daumé III & Marcu, 2005; Daumé III et al., 2009; Ross et al., 2011; Chang et al., 2015). These methods are based on imitating a reference policy (oracle) which make near-optimal decision at every step. In our problem setting, it is unclear what a good reference policy would be. For example, a shortest path oracle between two entities would be bad, since the answer providing path should depend on the query relation.
We explored a new way of automated reasoning on large knowledge bases in which we use the knowledge graphs representation of the knowledge base and train an agent to walk to the answer node conditioned on the input query. We achieve state-of-the-art results on multiple benchmark knowledge base completion tasks and we also show that our model is robust and can learn long chains-of-reasoning. Moreover it needs no pretraining or initial supervision. Future research directions include applying more sophisticated RL techniques and working directly on textual queries and documents.
This work was supported in part by the Center for Data Science and the Center for Intelligent Information Retrieval, in part by DARPA under agreement number FA8750-13-2-0020, in part by Defense Advanced Research Agency (DARPA) contract number HR0011-15-2-0036, in part by the National Science Foundation (NSF) grant numbers DMR-1534431 and IIS-1514053 and in part by the Chan Zuckerberg Initiative under the project “Scientific Knowledge Base Construction. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of the sponsor.
Incremental parsing with the perceptron algorithm.
In ACL, 2004.Chains of reasoning over entities, relations, and text using recurrent neural networks.
In EACL, 2017.A reduction of imitation learning and structured prediction to no-regret online learning.
In AISTATS, 2011.(i) M to 1 |
Los Angeles Rams American Football |
The Walking Dead USA |
(ii) 1 to M |
CEO Merck & Co. |
Traffic collision Albert Camus |
Harmonica Greg Graffin |
.
Relation | tail/head |
---|---|
/people/marriage_union_type/unions_of_this_type./people/marriage/location_of_ceremony | 129.75 |
/organization/role/leaders./organization/leadership/organization | 65.15 |
/location/country/second_level_divisions | 49.18 |
/user/ktrueman/default_domain/international_organization/member_states | 36.5 |
/base/marchmadness/ncaa_basketball_tournament/seeds./base/marchmadness/ncaa_tournament_seed/team | 33.6 |
We further did some query analysis on the FB15k-237 dataset. Following Bordes et al. (2013), we categorized the query relations into (M)any to 1, 1 to M and 1 to 1 relations. An example of a M to 1 relation would be ‘/people/profession’ (What is the profession of ‘X’?). An example of 1 to M relation would be ‘/people/cause_of_death/people’. An example query of that relation would be (Traffic collision, /people/cause_of_death/people, ?) ‘Who were killed in traffic collision accidents?’. Another example would be /music/instrument/instrumentalists (Who plays the music instrument ‘X’?). From a query answering point of view, the answers to this question is a list of entities. However, during evaluation time, the model is evaluated based on whether it is able to predict the one target entity which is in the query triple. Also since minerva outputs the end points of the paths as target entities, it is sometimes possible that the particular target entity of the triple does not have a path from the source entity (however there are paths to other ‘correct’ answer entities). Table 7 shows few other examples of relations belonging to different classes.
Following Bordes et al. (2013), we classify a relation as 1-to-M if the ratio of cardinality of tail to head entities is greater than 1.5 and as M-to-1 if it is lesser than 0.67. In the validation set of FB15k-237, 54% of the queries are 1-to-M, whereas only 26% are M-to-1. Contrasting it with nell-995, 27% are 1-to-M and 36% are M-to-1 or umls or kinship where only 18% and 32% of the relations are 1-to-M. Table 8 shows relations from FB15k-237 dataset which have tail-to-head ratio. The average ratio for 1-to-M relations in FB15k-237 is 13.39 (substantially higher than 1.5). As explained before, the current evaluation scheme is unfair when it comes to 1-to-M relations and the high percentage of 1-to-M relations in FB15k-237 also explains the sub optimal performance of minerva.
In our experiments, we tune our model over two hyper parameters, viz., which is the entropy regularization constant and which is the moving average constant for the REINFORCE baseline. The table 9 lists the best hyper parameters for all the datasets.
Dataset | Path Length | ||
UMLS | 0.05 | 0 | 2 |
KINSHIP | 0.05 | 0.05 | 2 |
Countries S1 | 0.01 | 0.1 | 2 |
Countries S2 | 0.02 | 0.02 | 2 |
Countries S3 | 0.01 | 0.01 | 3 |
WN18RR | 0.05 | 0.05 | 3 |
NELL-995 | 0.05 | 0.02 | 3 |
FB15K-237 | 0.02 | 0.05 | 3 |
WIKIMOVIES | 0.15 | 0 | 1 |