Transductive versus Inductive Link Prediction on Rule-Generated Family Trees: TransE, Entity Fold-in and 2-Hop Relational Message Passing Plover-64D Stemma seed corpus https://github.com/mihir-chauhan/research-harness-papers/tree/main/papers/rule-structured-synthetic-knowledge-graph-transd Abstract—We ask how much of a knowledge-graph comple- asking the model to rank the missing answers. Embedding tion model’s accuracy survives a move from held-out triples of models such as TransE [1], DistMult [2], ComplEx [3], its training graph to a freshly generated graph with entirely new RotatE [4] and ConvE [5] assign one free vector to entities, in a world where the relations are derived by length- two rules. The main transfer result is expected by construction every training entity and are therefore transductive: an and we do not present it as new: the new graph comes from entity that appears only after training has no learned the same generator, a model without per-entity parameters representation. When tuned carefully they are strong on has nothing to lose, and random vectors for new entities carry this protocol [6]. Subgraph and path-based networks, in no information; it is the motivating observation of GraIL and contrast, compute a representation of a candidate answer NBFNet. We generate family-tree graphs of 500 people with four relations (parent, sibling, grandparent, uncle/aunt) and from the relations on the paths that reach it from the compare, over 5 seeds that each use a different graph pair, query entity [7]–[10]. They have no per-entity parameters, a tuned TransE and a tuned ComplEx (each with frozen so they can be applied to a graph with new entities, random vectors for new entities and with fold-in), a 2-layer and the same is true for rule learners such as Neural- query-conditioned relational message-passing model (Path-MP, LP and DRUM [11], [12]. The inductive setting has been a reduced NBFNet-style network), a hand-written one-step rule oracle, and a learner that enumerates every rule of length at studied on splits derived from existing benchmarks [7], most two. Each model is trained once per seed and evaluated in [13], and recent work trains one model to transfer to both settings. Path-MP reaches filtered MRR 0.988 on held-out unseen graphs [14]. triples and 0.988 on the new graph, with no measurable drop; TransE falls from 0.659 to 0.011 and ComplEx from 0.809 to On those benchmarks the rules that generate the test 0.015. Fold-in is test-time retraining of the new entities’ vectors triples are unknown, so it is hard to say why a model on the observed new graph: it restores TransE to 0.645 and succeeds or fails and what the ceiling is. We therefore use ComplEx to 0.813, still below Path-MP, and it loses much of a deliberately simple world where everything is known: a its MRR when less of the new graph is observed. The exhaustive family tree with parent facts and relations derived from rule learner reaches 0.982 and 0.978, so Path-MP adds about one point of MRR over enumerating two-hop rules in this world. them by Horn rules (sibling, grandparent, uncle/aunt). We The part of the study that those works do not already imply, to ask three questions. (i) On held-out triples of the training our knowledge, is a descriptive analysis of sparse observation: graph, does a 2-hop path model beat tuned embedding when a quarter of the new graph is observed, only 30.0% of test models, and by how much? (ii) When the test graph is a queries have an answer within two hops of the query entity, freshly generated one with new entities, how large is the training Path-MP at the matched density recovers only a small part of its loss, and Path-MP is not distinguishable from fold- loss for each model, and is it relation-specific? (iii) How in TransE or ComplEx. The study is small and synthetic, has much of the embedding models’ loss does fold-in recover, a high ceiling for the path model, and covers two embedding given that fold-in is test-time retraining of the new entities’ models only. vectors on the observed new graph? We add ablations on Index Terms—knowledge graph completion, inductive link depth, on the removal of the query edge during training, prediction, TransE, relational message passing, synthetic benchmark, rule-derived relations and on the density of the observed part of the new graph, with a control that trains the path model at the matched I. Introduction density and a count of the test queries that have any Knowledge-graph completion models are usually evalu- two-hop support. ated by hiding a fraction of the triples of one graph and What is expected by construction. The answers to (i) and Plover-64D is the codename of an autonomous study, not a person. (ii) for the path model and for the frozen embeddings Produced by the Stemma autonomous AI research pipeline; the topic are largely implied by the set-up and by GraIL [7] and was chosen to cover the field. Every reported result is traced to logged runs in the linked repository and every reference was checked against NBFNet [8]: the new graph is drawn from the same arXiv, Crossref, DataCite or OpenAlex. generator, so a model with no per-entity parameters has no reason to lose accuracy; a frozen embedding table has What is missing. The inductive benchmarks above are no information about new entities; with the query edge derived from existing graphs whose generative rules are removed every answer is two hops away, so a one-layer unknown; the mix of rule-inferable and non-inferable network cannot work; and fold-in is transductive training test triples is unknown as well. Our contribution is the on the new graph. We report these results as confirma- opposite trade: a toy world in which each relation is tions. The measurements that go beyond what those works exactly rule-derived, so that differences between models, imply, to our knowledge, are the comparison with an and between the two settings, can be attributed to model exhaustive rule learner, the split of the density sweep by properties and observed-graph density rather than to two-hop support, and the matched-density control; they unknown benchmark structure. This comes at the cost are descriptive and limited to this synthetic world. of realism, which we discuss in Section VII. Contributions. (1) A small, fully reproducible generator III. Method of rule-derived family-tree knowledge graphs with a split A. Data: rule-derived family graphs that cannot leak through the symmetry of the sibling relation. (2) A paired comparison, over 5 seeds, each with A graph has n = 500 people and four base relations its own pair of graphs, of tuned TransE and ComplEx R = {parent, sibling, grandparent, uncle}. Parent facts (each with fold-in), a 2-layer relational message-passing come from a random multi-generation family forest (Sec- model, a one-step rule oracle and an exhaustive length-two tion IV). The other relations are derived by the rules rule learner, in both settings, with one trained model per sibling(x, y) ← parent(p, x) ∧ parent(p, y) ∧ x ̸= y, system and seed evaluated in both. (3) Ablations showing (1) which parts of the path model matter, and an analysis of sparse observation of the new graph that counts the test grandparent(x, y) ← parent(x, z) ∧ parent(z, y), (2) queries with two-hop support and trains the path model uncle(x, y) ← sibling(x, z) ∧ parent(z, y), (3) at matched density. This is a controlled CPU study on a where uncle is gender-neutral (a sibling of a parent: an synthetic world, not a new method and not a benchmark uncle or an aunt), so that every relation follows from result; Section VII lists what it does not show. the parent facts alone. Every triple (h, r, t) also induces an inverse edge (t, r−1 , h), giving 2|R| = 8 edge types. II. Related Work Tail prediction for (h, r, ?) and head prediction for (?, r, t) (asked as (t, r−1 , ?)) are both evaluated. Embedding models. TransE [1] models a relation as a translation in embedding space; DistMult [2], ComplEx [3] B. TransE (reimplemented) (complex bilinear scoring), RotatE [4] (rotations, able Each entity e and relation r has a vector e, r ∈ Rd . The to represent symmetric and compositional patterns) and score of a triple is f (h, r, t) = ∥h+r−t∥1 (lower is better). ConvE [5] improve on it. A large re-evaluation found that Training minimises the margin ranking loss classic models are competitive once their hyperparameters and training are tuned [6], which motivates our tuning 1 ∑ ∑ k ( ) L= max 0, γ + f (h, r, t) − f (h′j , r, t′j ) , of the embedding baselines. PyKEEN [15] provides such |B|k (h,r,t)∈B j=1 baselines and small rule-rich datasets; we reimplement (4) TransE and ComplEx instead, to control the splits, the where (h′j , r, t′j ) replaces the head or the tail (with prob- fold-in procedure and the tie policy. ability 21 each) by a uniformly random entity, and entity Rules and paths. Neural-LP [11] and DRUM [12] learn soft vectors are projected to ∥e∥2 ≤ 1 after every step. Ranking chains of relations and are inductive. GraIL [7] classifies a head query uses f (c, r, t) over all candidates c. A new the subgraph enclosing a candidate triple and introduced entity has no trained vector, so in the inductive setting inductive splits in which training and test graphs share no TransE (frozen) gives every new entity a fresh random entities. NBFNet [8] generalises path-based reasoning to a vector drawn from the initialisation law; the relation Bellman-Ford style message-passing network conditioned vectors are those learned on graph 1. on the query; our Path-MP is a reduced version of this idea (fixed depth, sum aggregation, no learned path pruning). C. ComplEx (reimplemented) Relational message passing [9] and its fully inductive vari- ComplEx [3] gives each entity and each of the 8 edge ant [10] pass messages over relations rather than entities. types (the four relations and their inverses, i.e. reciprocal R-GCN [16] mixes message passing with entity-specific relations) a complex vector e, r ∈ Cd and scores a triple by parameters and is thus still transductive. ULTRA [14] Re ⟨h, r, t̄⟩. Unlike a translation, this score can represent pre-trains one model that transfers to unseen graphs and symmetric and one-to-many relations. Training uses 1-vs- relation vocabularies. Open problems for the inductive all cross-entropy over all n entities for both directions of setting, including benchmark design, are discussed by every training triple, plus an N 3 penalty with weight λ on Galkin et al. [13]. the vectors of the query and the answer. As for TransE, a new entity has no trained vector, so ComplEx (frozen) ← As Ap + Au As , where subscripts p, s, g, u abbreviate the gives every new entity a fresh random vector from the four relations. It is not trained, and it is not a ceiling: it initialisation law and keeps the relation vectors learned applies each rule once to observed facts, while the learned on graph 1. model may combine several rule paths. D. Fold-in for TransE and ComplEx G. Rule learner: all rules of length at most two To give the embedding baselines a fair chance on new To ask whether Path-MP adds anything beyond enu- entities, we keep the relation vectors fixed and fit only merating two-hop rules, we enumerate every rule h(x, y) ← the new entity table on the observed triples of the new b1 (x, y) and h(x, y) ← b1 (x, z) ∧ b2 (z, y) whose head h graph, with the same loss and optimiser as in training. and body atoms bi range over the 8 edge types (the No held-out test triple is used. This is a standard way trivial rule h ← h excluded). The confidence of a rule to embed out-of-sample entities, but it is transductive is estimated on the observed graph 1 as support divided training on the new graph performed at test time: it needs by the number of body groundings plus a pseudo-count of gradient steps over the observed new graph, and its quality 1 (pairs (x, y) with x ̸= y; support counts those pairs for depends on how much of that graph is observed. The which the head holds). It is not trained by gradient descent number of fold-in epochs is chosen on validation graph and has no entity parameters. To answer a query (h, r, ?) pairs (Section IV). on the observed graph of a setting, each candidate y is scored by the largest confidence among the rules whose E. Path-MP: 2-hop relational message passing body is grounded for (h, y), ties broken by the sum of Path-MP scores every entity v as an answer to a query those confidences. The rule set and confidences come from (h, q, ?) with q one of the 8 edge types. Let q ∈ Rd be a graph 1 only and are applied unchanged in both settings. learned embedding of the query relation and x0v = ⊮[v = h] q. For layers ℓ = 1, . . . , L, H. Evaluation For each held-out triple we rank the true answer among weℓ = reshape(W ℓ q)e ∈ Rd , (5) ∑ all n entities after filtering every other entity that forms a aℓv = xℓ−1 u ⊙ weℓ , (6) true triple (in the whole generated graph) with the query. (u,e,v)∈E A tie between the true answer and other candidates is ( ( )) xℓv = ReLU LN U ℓ [xℓ−1 ℓ 0 v ; av ] + x v , (7) resolved by counting half of the tied candidates, rank = 1+|{s > st }|+ 12 |{s = st }|, so constant scores cannot score where E is the set of (forward and inverse) edges of the well. We report MRR over head and tail queries, Hits@1, message graph, e indexes edge types, ⊙ is the element-wise Hits@10 and the MRR per relation. For the analysis of product, W ℓ ∈ R8d×d makes the per-edge-type weights sparse observation, a query is supported if its true answer depend on the query relation, U ℓ is linear, LN is layer is joined to the query entity by a path of at most two edges normalisation, and the initial state x0 is added at every (any edge types, forward or inverse) in the observed graph layer, before the layer normalisation, as a boundary condi- of the setting; we report the share of supported queries tion. The score is s(v) = MLP(xL v ). Training uses 1-vs-all and the MRR on supported and on unsupported queries. A cross-entropy over all n entities, L = − log softmax(s)t , two-hop model cannot distinguish an unsupported answer where other training-known answers of the same query are from the other unreachable entities. masked out. Both directions of every training triple are used as queries. Crucially, while training on query (h, r, t) IV. Experimental Setup the edge (h, r, t) and its inverse (and, for the symmetric Data generation. A graph is grown from 6 founding sibling relation, the mirror triple) are removed from the couples. Each couple has between one and four children message graph of that query; otherwise the model could (probabilities 20, 35, 30 and 15 percent for one to four read the answer off the graph. At test time the message children), each child marries a newly created outsider with graph is the full observed graph of the setting. The model probability 80 percent, and the new couple is queued, has no entity-specific parameters, hence the same weights up to 6 generations of couples, until exactly 500 people apply to any graph. Depth L is 2 in the main experiments: exist. Entity ids are randomly permuted so that ids carry each rule above has a body of length two, so two hops no information. A graph has about 2028 triples (mean suffice to reach the answer. over seeds) spread almost evenly over the four relations F. Rule oracle (hand-written) (relation shares between 22.5% and 27.2% on average). As a reference we score each candidate by the number of Splits and the two settings. Triples are split at the groundings of a one-step rule set applied to the observed level of units (80/10/10 percent for train, validation and graph (with Ar the adjacency matrix of relation r): parent test); both directions of a sibling pair form one unit, so ← Ap As (a parent of my sibling is my parent); sibling ← a held-out sibling triple has no mirror in the training (A⊤ p Ap ) with zeroed diagonal, plus symmetry, transitivity data. For each system and seed there is one trained and Au A⊤p ; grandparent ← Ap Ap + Ap Au + Ag As ; uncle model, trained on the train+validation units of graph 1 (1601 units on average, 1821 triples; recorded per run as epochs was tuned separately for TransE and ComplEx on n_train_units); the transductive run trains and stores validation graph pairs: the base model is trained on the it, and the inductive, fold-in and density runs load that training units of graph 1, the new entity table is fitted same checkpoint. Transductive test: the held-out units on the training units of a second graph, and the score is of graph 1 (on average 206.4 triples per seed), message MRR on that graph’s validation units (24 runs in group graph = train+validation units of graph 1. Inductive test: tune_foldin, 6 epoch values from 10 to 400, 2 graph pairs). a second graph with 500 entities that were never seen, The first launch of the ComplEx fold-in tuning ran on generated independently, split in the same proportions; the untuned default ComplEx and is superseded in the message graph and fold-in data = its train+validation registry; it was rerun with the tuned ComplEx. Path-MP units (on average 1607.6 units); test = its held-out units received a 2 × 2 grid (epochs 3 or 6, learning rate 0.003 (on average 203.0 triples per seed). The two settings or 0.01); 3 and 6 epochs were tied on validation and the therefore use the same fraction of the graph as the message cheaper 3 epochs were used. Path-MP therefore received graph; the number of test triples differs between the a smaller tuning budget than the embedding baselines, settings and between seeds (graph 1 and graph 2 are which, if anything, favours the baselines (Section VII). different random graphs). A seed fixes both graphs, both Statistics and runs. 5 seeds (0–4). Tables report mean splits, the initialisation and the minibatch order, so each ± standard deviation over seeds; tests are paired t-tests seed is an independent graph pair and comparisons are over seeds from rh compare or from the analysis script paired by seed. (method/analyze.py, logged as a run). With five seeds Systems and hyperparameters. All learning systems are these tests have little power for small effects and we reimplemented in PyTorch (CPU, 1 thread) in one script do not interpret non-significant results as equivalence; p- (method/run.py) with one evaluation function. TransE: values are not corrected for the number of comparisons. dimension 64, L1 distance, margin γ = 8, k = 10 negatives, Every run was executed with the rh run wrapper on a Adam with learning rate 0.01, batch size 512, 200 epochs; shared CPU machine. Training is single-threaded because fold-in uses the same optimiser for 100 epochs on the with two torch threads the same command gave differ- new graph. ComplEx: complex dimension 256, Adam with ent metrics on repeated execution (parallel floating-point learning rate 0.03, N 3 weight 0.003, batches of 512 queries, reductions, amplified by training; repeats of one TransE 200 epochs; fold-in uses the same optimiser for 25 epochs. command gave MRR 0.673 and 0.681 with two threads Path-MP: width d = 32, L = 2, Adam with learning and 0.678 both times with one). This explains why, in the rate 0.003, batches of 32 queries, 3 epochs, gradient-norm earlier version of this paper, TransE and a second row that clipping at 5. In the matched-density control, Path-MP is ran the same code branch differed by seed; that second trained on the same fraction of graph 1’s training units as row, a fold-in row in the transductive setting, is dropped the observed fraction of the new graph, with 12, 6 and 4 because fold-in applies only to new entities. The registry epochs at the three sparser levels, which keeps the number also contains 31 failed rows that we did not hide: launches of gradient steps unchanged. The rule oracle and the rule of the sweep_density baselines corrupted by a variable learner are described in Section III; the learner enumerates clash in the launcher script (re-run with the corrected rules of at most 2 body atoms. script) and one analysis-script launch that failed on a registry control row before the script was fixed. Rows Tuning. Hyperparameters were chosen on the validation of the first submission that were replaced by the runs units of graph 1 for two separate graph seeds (2 seeds reported here are marked superseded in the registry. distinct from the evaluation seeds); the test units were never used. TransE received three rounds of search (mar- V. Results gin in {1,2,4,6,8,12,16}, L1 versus L2 distance, dimension 64 versus 128, 200 versus 400 epochs), because the best Tables I and II give the main results; Fig. 1 plots margin was at the edge of the first grid; the optimum MRR per system and setting. All numbers are means over (margin 8, L1 , dimension 64, 200 epochs) lies inside 5 seeds; differences quoted below are paired over seeds. the grid, and larger margins, the larger dimension (tried Every learned system was trained once per seed, on the at margin 4 only) and more epochs (tried at margins same graph-1 observations (on average 1601 units, 1821 4, 8 and 12) did not improve validation MRR (all 28 triples), and that one trained model is evaluated in both tuning runs are logged in group tune_transe). ComplEx settings. Fold-in rows exist only for the inductive setting, received three rounds of search of a comparable size since fold-in has nothing to fit on graph 1. (learning rate, N 3 weight, dimension and epochs; 32 runs What is expected by construction. The new graph is in group tune_complex, the same two graph seeds); the drawn from the same generator as the training graph, configuration with the highest mean validation MRR was every relation is exactly derived by a rule with a body of used. Its dimension is at the upper edge of the grid, length two, Path-MP has no per-entity parameters, and with the nearest smaller dimension within the seed-to- the frozen embedding models give new entities random seed spread of the validation scores. The number of fold-in vectors. A near-zero transfer loss for Path-MP, a collapse TABLE I Main results: filtered MRR, Hits@1 and Hits@10 (mean ± std over seeds) on held-out triples of the training graph (transductive) and on a fresh graph with new entities (inductive). Bold: best per column and setting; underline: second best. The “+fold-in” rows fit new entity vectors on the observed new graph. Method Task mrr ↑ hits1 ↑ hits10 ↑ n TransE (reimplemented) transductive 0.659 ± 0.029 0.429 ± 0.053 0.982 ± 0.005 5 ComplEx (reimplemented) transductive 0.809 ± 0.029 0.690 ± 0.039 0.993 ± 0.002 5 Rule oracle (hand-written) transductive 0.937 ± 0.026 0.931 ± 0.026 0.940 ± 0.026 5 Rule learner (all length-<=2 rules) transductive 0.982 ± 0.005 0.973 ± 0.009 0.990 ± 0.004 5 Path-MP (2-hop) transductive 0.988 ± 0.004 0.985 ± 0.003 0.990 ± 0.005 5 TransE (reimplemented) inductive 0.011 ± 0.001 0.000 ± 0.000 0.017 ± 0.005 5 TransE+fold-in (reimplemented) inductive 0.645 ± 0.017 0.422 ± 0.031 0.977 ± 0.011 5 ComplEx (reimplemented) inductive 0.015 ± 0.004 0.002 ± 0.002 0.024 ± 0.010 5 ComplEx+fold-in (reimplemented) inductive 0.813 ± 0.015 0.691 ± 0.028 0.990 ± 0.009 5 Rule oracle (hand-written) inductive 0.950 ± 0.020 0.946 ± 0.019 0.952 ± 0.020 5 Rule learner (all length-<=2 rules) inductive 0.978 ± 0.011 0.968 ± 0.014 0.987 ± 0.008 5 Path-MP (2-hop) inductive 0.988 ± 0.008 0.986 ± 0.008 0.992 ± 0.006 5 TABLE II Filtered MRR per relation (mean ± std over seeds). Method Task mrr_parent ↑ mrr_sibling ↑ mrr_grandparent ↑ mrr_uncle ↑ n TransE (reimplemented) transductive 0.734 ± 0.044 0.485 ± 0.010 0.866 ± 0.053 0.506 ± 0.060 5 ComplEx (reimplemented) transductive 0.911 ± 0.015 0.579 ± 0.056 0.955 ± 0.020 0.797 ± 0.037 5 Rule oracle (hand-written) transductive 0.828 ± 0.035 0.976 ± 0.020 0.996 ± 0.009 0.958 ± 0.036 5 Rule learner (all length-<=2 rules) transductive 0.951 ± 0.016 0.999 ± 0.003 0.996 ± 0.009 0.981 ± 0.018 5 Path-MP (2-hop) transductive 0.964 ± 0.019 0.999 ± 0.002 0.996 ± 0.009 0.994 ± 0.007 5 TransE (reimplemented) inductive 0.011 ± 0.003 0.009 ± 0.005 0.011 ± 0.002 0.012 ± 0.003 5 TransE+fold-in (reimplemented) inductive 0.696 ± 0.036 0.483 ± 0.012 0.874 ± 0.049 0.495 ± 0.019 5 ComplEx (reimplemented) inductive 0.012 ± 0.005 0.013 ± 0.010 0.022 ± 0.011 0.012 ± 0.006 5 ComplEx+fold-in (reimplemented) inductive 0.899 ± 0.022 0.528 ± 0.048 0.974 ± 0.020 0.812 ± 0.031 5 Rule oracle (hand-written) inductive 0.851 ± 0.065 0.990 ± 0.002 1.000 ± 0.000 0.967 ± 0.033 5 Rule learner (all length-<=2 rules) inductive 0.926 ± 0.038 1.000 ± 0.000 1.000 ± 0.000 0.990 ± 0.012 5 Path-MP (2-hop) inductive 0.961 ± 0.023 0.999 ± 0.003 0.997 ± 0.005 0.998 ± 0.003 5 1.0 both; we ran no other embedding model, so statements 0.8 about embeddings here are statements about TransE and 0.6 mrr 0.4 ComplEx. On Hits@10 the systems are close: TransE 0.2 0.982, ComplEx 0.993 and Path-MP 0.990, with ComplEx 0.0 transductive inductive the highest of the three; Hits@1 separates them more Path-MP (2-hop) TransE (reimplemented) TransE+fold-in (reimplemented) ComplEx (reimplemented) ComplEx+fold-in (reimplemented) Rule oracle (hand-written) Rule learner (all length-<=2 rules) (0.429, 0.690 and 0.985). Under a 500-entity candidate set, Hits@10 is a weak criterion; MRR and Hits@1 expose Fig. 1. Filtered MRR per system, in the two settings (mean and the difference. spread over seeds, as drawn by rh fig bars). Rule baselines. The hand-written one-step oracle reaches MRR 0.937 (Path-MP above it by 0.051, paired p = 9.62× 10−3 ), but it is incomplete. The learner that enumerates of frozen TransE and ComplEx, and a chance-level score every rule of length at most two over the eight edge for a one-layer network are therefore what these set-ups types (568 rules with a grounding on graph 1, confidences imply; the results below confirm them and we do not estimated on graph 1) reaches 0.982 transductively and present them as discoveries. 0.978 inductively. Path-MP is above it by 0.006 (p = 0.02) H1: Path-MP beats TransE on held-out triples (sup- and 0.010 (p = 0.01): the difference is about one point of ported). Path-MP reaches MRR 0.988 against 0.659 for MRR, so in this world a learned message-passing model tuned TransE, a paired difference of 0.329 (paired p = adds at most that much over exhaustive enumeration of 1.55 × 10−5 over 5 seeds, the test registered in the pro- two-hop rules. The learner’s inductive MRR differs from posal). Tuned ComplEx, which can represent symmetric its transductive MRR by −0.004 (p = 0.45). As an upper and one-to-many relations, reaches 0.809, above TransE bound for any two-hop model, 99.0% of the transductive by 0.150 (p = 1.78 × 10−4 ) and below Path-MP by 0.178 and 98.7% of the inductive test queries have an answer (p = 2.31 × 10−4 ). The gap to Path-MP is therefore joined to the query entity by a path of at most two edges smaller for ComplEx than for TransE but present for in the observed graph (any edge types); the rest cannot be told apart from other unreachable entities by a two- hop model. The learner scores such unsupported queries at 1.0 chance (MRR 0.004), Path-MP at 0.260 inductively (0.103 inductive filtered MRR transductively); on supported queries Path-MP reaches 0.8 0.998 (inductive) and the learner 0.991. Per relation (Table II). TransE is best on grandparent 0.6 (MRR 0.866) and worst on sibling and uncle (0.485 and 0.506). ComplEx is higher than TransE on every relation but is also weakest on sibling (0.579), followed by uncle 0.4 Path-MP Path-MP, matched training (0.797). Why sibling stays hard for ComplEx, and why TransE+fold-in it is hard for TransE, is not isolated by a run here; a 0.2 ComplEx+fold-in Rule learner plausible reading for TransE is that a translation model Rule oracle can represent a symmetric relation only with a near- 0.0 zero relation vector. Path-MP is nearly perfect on sibling, 40 60 80 100 grandparent and uncle but weakest on parent (0.964 transductive, 0.961 inductive); the exhaustive learner is observed fraction of the new graph (%) also weakest on parent (0.951 transductive) and the one- step oracle even more so (0.828), which is consistent with Fig. 2. Inductive MRR against the observed fraction of the new the oracle’s weakness on parent coming from rules it graph (mean ± std over seeds), from the same runs as Table IV. omits rather than from missing supporting facts, since the fraction of queries with a two-hop path is close to one 0.343 MRR (paired p = 3.18 × 10−6 ) and above ComplEx (we did not test this further). Path-MP’s parent MRR is with fold-in by 0.176 (p = 2.44 × 10−5 ). Fold-in therefore the clearest remaining failure of the model in this world. shows that an embedding model can be used on new H2: frozen embeddings collapse on new entities, Path-MP entities when most of the new graph is observed and does not (supported; expected by construction). Frozen a training pass over it is affordable; it does not show TransE gets MRR 0.011 on the new graph and Hits@1 that frozen TransE or ComplEx handle new entities, and 0.000, a change of −0.648 relative to its transductive MRR Section VI shows that fold-in loses much of its MRR as (paired p = 9.45 × 10−7 ); frozen ComplEx gets 0.015, a less of the new graph is observed. Path-MP, in contrast, change of −0.795 (p = 4.58×10−7 ). Both are the reference needs only a forward pass over the observed new graph. points for the fold-in baselines, since the vectors of the new entities are random. Path-MP’s change from transductive VI. Ablations and Analysis to inductive is 0.001 MRR (paired p = 0.90), within the H4: depth and edge removal (supported; the depth re- 0.05 tolerance stated in H2 and not distinguishable from sult is expected by construction). With one layer the zero with five seeds. The same checkpoint is used in both model scores at chance (MRR 0.004 transductive, 0.004 settings, so this change is not mixed with a change of inductive; a constant scorer under the even tie-splitting training data. The new graph is generated by the same rule gets about 2/n with n the number of entities), a process as the training graph, so this tests transfer to new paired difference of −0.984 in the inductive setting. This entities, not to a different distribution of graphs. is expected: with the query edge removed, no answer is H3: fold-in recovers the loss of frozen embeddings, at the within one hop of the query entity for any of the four price of test-time retraining, and stays below Path-MP relations, so the one-layer scores carry no information (supported). Fold-in keeps the relation vectors fixed and about the candidates; we did not run a probe that fits the whole entity table of the new graph on its observed isolates this, so it is the likely, not a demonstrated, units, with the same loss and optimiser as training, reason. A third layer changes nothing we could detect: the for a number of epochs chosen on separate validation paired difference to two layers is 0.003 (paired p = 0.05) graph pairs; it is transductive training on the new graph, transductively and −0.009 (p = 0.48) inductively; with five performed at test time. TransE with fold-in reaches 0.645, seeds this means “no difference detected”, not equivalence, 0.634 above frozen TransE (paired p = 1.23 × 10−7 ). Its and the model is at the ceiling so a deeper model has inductive MRR differs from the transductive MRR of plain little room to help (the inductive three-layer model has TransE (the same TransE checkpoint, evaluated on held- a larger spread over seeds, std 0.034). Training without out triples of graph 1) by −0.014 (paired p = 0.47); with removing the query edge is the most damaging change five seeds this is a difference we could not detect, which is after removing a layer: MRR falls to 0.507 (transductive) not evidence that it is zero. ComplEx with fold-in reaches and 0.541 (inductive), differences of −0.480 and −0.448 0.813, 0.798 above frozen ComplEx (p = 4.81 × 10−8 ), to the main model (paired p below 0.001). With the edge and differs from plain transductive ComplEx by 0.003 present at training time the model can score the answer (p = 0.79). Path-MP stays above TransE with fold-in by from the edge itself; at test time that edge is absent by TABLE III Path-MP ablations: MRR (mean ± std over seeds) and paired difference to the 2-layer model of Table I, in both settings. Each variant is one checkpoint per seed, evaluated in both settings. “No edge removal” trains with the query edge present in the message graph. Variant MRR trans. MRR induct. ∆ vs L=2 (trans.) ∆ vs L=2 (induct.) 1 layer 0.004±0.000 0.004±0.000 −0.984 −0.984 2 layers (main) 0.988±0.004 0.988±0.008 – – 3 layers 0.991±0.003 0.979±0.034 0.003 −0.009 2 layers, no edge removal 0.507±0.073 0.541±0.072 −0.480 −0.448 TABLE IV is 98.7% at full observation and falls to 93.9%, 73.0% and Inductive MRR (mean ± std over seeds) when only a fraction of 30.0% (Table IV). Queries without such a path are at the new graph’s train+validation units (a sibling pair is one unit) forms the message graph (or fold-in data); the test triples are chance for the exhaustive rule learner and nearly so for unchanged. The last column is the main result. “Matched density” Path-MP (Table V). On queries that do have a path, Path- trains Path-MP on the same fraction of graph 1’s training units MP’s MRR is 0.878 at the sparsest level and the learner’s (epochs scaled so that the number of gradient steps is unchanged); all other models are the main checkpoints. The last row is the 0.940, so at that level the learner is higher on supported share of test queries whose answer is joined to the query entity by queries and Path-MP does not make up the difference a path of at most two edges in the observed graph. elsewhere. The exhaustive rule learner, whose confidences System 25% 50% 75% 100% were estimated on the denser graph 1, falls from 0.978 to Path-MP (2-hop) 0.274±0.049 0.661±0.055 0.917±0.030 0.988±0.008 0.909, 0.689 and 0.284, a step of 0.069 from full to 75% Path-MP, trained at matched density 0.290±0.050 0.724±0.046 0.937±0.011 0.988±0.008 TransE+fold-in 0.295±0.015 0.532±0.030 0.614±0.032 0.645±0.017 against 0.071 for Path-MP; the one-step oracle’s step is ComplEx+fold-in 0.288±0.030 0.603±0.049 0.755±0.025 0.813±0.015 Rule learner (length ≤ 2) 0.284±0.053 0.689±0.051 0.909±0.017 0.978±0.011 larger (0.147), so the oracle does not track Path-MP’s fall. Rule oracle (one step) 0.175±0.043 0.515±0.048 0.803±0.027 0.950±0.020 Test queries with a path of ≤ 2 hops 0.300±0.059 0.730±0.046 0.939±0.017 0.987±0.008 Matched density. Training Path-MP on graph 1 subsam- pled to the same fraction of units (the matched-density TABLE V row) raises its inductive MRR by 0.020 (p = 9.80 × 10−2 ), Inductive MRR (mean ± std over seeds) split by whether the 0.063 (p = 4.16 × 10−3 ) and 0.016 (p = 7.11 × 10−3 ) at answer is within two hops of the query entity in the observed new 75%, 50% and 25% observed, to 0.937, 0.724 and 0.290. graph (“with”) or not (“without”), at each observed fraction. So part of the drop of the main model is a mismatch MRR on queries 25% 50% 75% 100% between training and test density. Matched training does with a ≤ 2-hop path: Path-MP with a ≤ 2-hop path: matched-density Path-MP 0.878±0.038 0.890±0.024 0.896±0.027 0.975±0.013 0.973±0.017 0.990±0.008 0.998±0.001 0.998±0.001 not remove the drop: at the sparsest level the matched with a ≤ 2-hop path: rule learner without: Path-MP 0.940±0.030 0.016±0.002 0.942±0.012 0.025±0.009 0.967±0.008 0.056±0.018 0.991±0.005 0.260±0.154 model is still far below full observation (the main model’s without: matched-density Path-MP 0.034±0.005 0.045±0.015 0.106±0.022 0.260±0.154 without: rule learner 0.004±0.000 0.004±0.000 0.004±0.000 0.004±0.000 fall from full observation is 0.714), and the remaining fall comes with the matching fall in the share of queries that have a two-hop path. We did not separate the effect construction. This is the likely mechanism; we did not of fewer training units from that of a different degree measure which input the model relies on. The variance distribution within the matched-density control. across seeds is high for this variant (std 0.072 inductive). Against fold-in. Fold-in TransE degrades more gently in In the no-removal variant sibling is hurt most (MRR 0.369 absolute terms (0.645 to 0.295) and fold-in ComplEx from inductive), whereas uncle is hurt least (0.724); we have no 0.813 to 0.288, and the ranking of the systems changes isolating run for this ordering. with density. Path-MP is ahead of TransE fold-in at H5: sparser new graphs (supported for Path-MP; fold-in 75% and 50% (paired differences 0.303 and 0.129) and degrades too). Table IV and Fig. 2 vary the observed of ComplEx fold-in by 0.162 and 0.058. At 25% both fold- fraction of the new graph, sampling units of the new in models have the higher mean (Path-MP minus TransE graph’s train+validation part. Path-MP’s inductive MRR fold-in −0.021, p = 0.34; minus ComplEx fold-in −0.014, falls monotonically at the four grid points, from 0.988 with p = 0.36) and the matched-density model is also not everything observed to 0.917, 0.661 and 0.274 at the three distinguishable from them (differences −0.005 and 0.002, sparser levels (75%, 50% and 25% of the units); the step p = 0.82 and 0.89), which with five seeds is inconclusive. from the full to the 75% graph is itself significant (paired Table V shows where the two kinds of model differ at difference 0.071, p = 8.73 × 10−3 ). Two things change that level: on queries with a two-hop path TransE fold-in with sparsity: the observed graph contains less evidence reaches 0.612 against Path-MP’s 0.878, whereas on queries for the rule bodies, and the model, trained with the full without one it reaches 0.162 against Path-MP’s 0.016. The train+validation part of graph 1 observed, is applied to fitted embeddings thus rank some answers that no two- graphs with a different degree distribution. We separate hop path reaches, while the message-passing models are them in two ways. limited to the two-hop evidence; this split is descriptive, Evidence. The share of test queries whose answer is and we did not test why the embeddings succeed on those within two hops of the query entity in the observed graph queries. VII. Limitations of a two-hop model; we count them (Section VI) but we did not study which relations they belong to. • Synthetic, easy, high ceiling. Four relations are de- • Matched-density control. The control trains Path- rived exactly by two-hop rules from facts that are MP on a subsample of graph 1 with the number of present with high probability in the observed graph, gradient steps held fixed; it changes the amount of and the rules are redundant. The path model is near training data and the degree distribution together, the ceiling, so the study cannot rank path models, say and we did not separate the two. The embedding anything about longer rules, noisy or non-rule facts, or and rule models were not retrained at the matched realistic benchmarks, and the depth ablation cannot density. show an advantage of deeper models. • Same-distribution new graph. The “fresh” graph is VIII. Conclusion generated by the same process with the same relation vocabulary; the inductive setting here is new entities On rule-derived family trees, a 2-layer relational only, not new relations and not a distribution shift in message-passing model reached filtered MRR 0.988 on graph structure or size. held-out triples and 0.988 on a fresh graph with new • Scale and statistics. 5 seeds, graphs of 500 people, a entities, with no measurable transfer loss, while a tuned few hundred test triples per seed; paired tests with TransE reached 0.659 and a tuned ComplEx 0.809 on held- five seeds detect only large effects, and we never out triples and both were at chance on new entities when interpret non-significance as equivalence (for example their vectors were random. These results are expected by the third layer, or Path-MP versus fold-in TransE at construction in a same-generator world and are known 25% observed). from GraIL and NBFNet. Fold-in, which fits the new • Reimplemented, reduced baselines. TransE and Com- entities’ vectors on the observed new graph, restores plEx are our own implementations (TransE with a TransE to 0.645 and ComplEx to 0.813; it is test-time custom, modest negative-sampling and normalisation retraining on a mostly observed new graph, it loses much scheme); claims about embedding models in this of its MRR when less of the graph is observed, and it paper are claims about these two. We did not run remains below the path model. An exhaustive learner of RotatE, DistMult, GraIL, NBFNet, DRUM, an ex- length-two rules reaches 0.978 inductively, about one point isting rule learner such as AnyBURL, or ULTRA; of MRR below Path-MP. The path model’s advantage Path-MP is a reduced NBFNet-style model and the is not unconditional: it needs two layers and training rule learner is our own enumeration with a simple with the query edge removed, and when only a quarter confidence estimate and aggregation rule, neither of of the new graph is observed, most test queries have no which was tuned. Tuning effort was larger for the answer within two hops and Path-MP, also when trained embedding baselines than for Path-MP. at the matched density, is not distinguishable from fold-in • Fold-in uses the observed new graph. The fold-in base- TransE or ComplEx. These conclusions hold for a small lines need gradient steps over the observed new graph synthetic world with one generative process, five seeds and (their number of epochs was tuned on two validation two embedding models; testing them on benchmarks with graph pairs, and only that); we did not compare unknown rules, with tuned RotatE/DistMult baselines against a cheaper inductive embedding scheme, and and with distribution shift between graphs is the natural fold-in at sparser densities used the epochs tuned at next step. full observation. • Oracle is not a ceiling. The one-step rule oracle applies References a hand-written rule set once and is incomplete; the [1] A. Bordes, N. Usunier, A. García-Durán, J. Weston, and learned model and the exhaustive rule learner exceed O. Yakhnenko, “Translating embeddings for modeling multi- it. The share of test queries with a two-hop path relational data,” pp. 2787–2795, 2013. [2] B. Yang, W. tau Yih, X. He, J. Gao, and L. Deng, bounds what a two-hop model can reach, but it is “Embedding Entities and Relations for Learning and Inference not a bound on MRR for the embedding models. in Knowledge Bases,” arXiv preprint arXiv:1412.6575, 2014. • Mechanisms are hypotheses. Explanations for the one- [Online]. Available: https://arxiv.org/abs/1412.6575 layer failure, the no-edge-removal failure and TransE’s [3] T. Trouillon, J. Welbl, S. Riedel, Éric Gaussier, and G. Bouchard, “Complex Embeddings for Simple Link weakness on symmetric relations are plausible read- Prediction,” arXiv preprint arXiv:1606.06357, 2016. [Online]. ings of the numbers, not isolated by dedicated runs. Available: https://arxiv.org/abs/1606.06357 The advisory verdict tool of the pipeline compares [4] Z. Sun, Z.-H. Deng, J.-Y. Nie, and J. Tang, “RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space,” the method with the rule oracle only and is not arXiv preprint arXiv:1902.10197, 2019. [Online]. Available: informative here. https://arxiv.org/abs/1902.10197 • Split design. Units are held out at random; test [5] T. Dettmers, P. Minervini, P. Stenetorp, and S. Riedel, “Convolutional 2D Knowledge Graph Embeddings,” arXiv queries whose answer has no two-hop path in the preprint arXiv:1707.01476, 2017. [Online]. Available: https: observed graph exist and bound the achievable MRR //arxiv.org/abs/1707.01476 [6] A. Rossi, D. Firmani, A. Matinata, P. Merialdo, and D. Barbosa, “Knowledge Graph Embedding for Link Prediction: A Comparative Analysis,” arXiv preprint arXiv:2002.00819, 2020. [Online]. Available: https://arxiv.org/abs/2002.00819 [7] K. K. Teru, E. Denis, and W. L. Hamilton, “Inductive Relation Prediction by Subgraph Reasoning,” arXiv preprint arXiv:1911.06962, 2019. [Online]. Available: https://arxiv.org/ abs/1911.06962 [8] Z. Zhu, Z. Zhang, L.-P. Xhonneux, and J. Tang, “Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction,” arXiv preprint arXiv:2106.06935, 2021. [Online]. Available: https://arxiv.org/abs/2106.06935 [9] H. Wang, H. Ren, and J. Leskovec, “Relational Message Passing for Knowledge Graph Completion,” arXiv preprint arXiv:2002.06757, 2020. [Online]. Available: https://arxiv.org/ abs/2002.06757 [10] Y. Geng, J. Chen, J. Z. Pan, M. Chen, S. Jiang, W. Zhang, and H. Chen, “Relational Message Passing for Fully Inductive Knowledge Graph Completion,” arXiv preprint arXiv:2210.03994, 2022. [Online]. Available: https: //arxiv.org/abs/2210.03994 [11] F. Yang, Z. Yang, and W. W. Cohen, “Differentiable Learning of Logical Rules for Knowledge Base Reasoning,” arXiv preprint arXiv:1702.08367, 2017. [Online]. Available: https://arxiv.org/abs/1702.08367 [12] A. Sadeghian, M. Armandpour, P. Ding, and D. Z. Wang, “DRUM: End-To-End Differentiable Rule Mining On Knowledge Graphs,” arXiv preprint arXiv:1911.00055, 2019. [Online]. Available: https://arxiv.org/abs/1911.00055 [13] M. Galkin, M. Berrendorf, and C. T. Hoyt, “An Open Challenge for Inductive Link Prediction on Knowledge Graphs,” arXiv preprint arXiv:2203.01520, 2022. [Online]. Available: https://arxiv.org/abs/2203.01520 [14] M. Galkin, X. Yuan, H. Mostafa, J. Tang, and Z. Zhu, “Towards Foundation Models for Knowledge Graph Reasoning,” arXiv preprint arXiv:2310.04562, 2023. [Online]. Available: https://arxiv.org/abs/2310.04562 [15] M. Ali, M. Berrendorf, C. T. Hoyt, L. Vermue, S. Sharifzadeh, V. Tresp, and J. Lehmann, “PyKEEN 1.0: A Python Library for Training and Evaluating Knowledge Graph Embeddings,” arXiv preprint arXiv:2007.14175, 2020. [Online]. Available: https://arxiv.org/abs/2007.14175 [16] M. Schlichtkrull, T. N. Kipf, P. Bloem, R. van den Berg, I. Titov, and M. Welling, “Modeling Relational Data with Graph Convolutional Networks,” arXiv preprint arXiv:1703.06103, 2017. [Online]. Available: https://arxiv.org/abs/1703.06103