Relation-Clock ODEs for Zero-Shot Temporal Knowledge Graph Reasoning

A temporal knowledge graph is a stream of timestamped facts such as "country A threatened country B on 3 March." Forecasting the next facts in such a stream splits the literature into two camps. Models that transfer to entirely new graphs, with unseen entities, unseen relation types, and different time units, obtain that transfer by throwing away real time and keeping only the order of discrete snapshots. Models that respect real, irregular time do so by fitting a neural ordinary differential equation (ODE), a network that defines how a hidden state changes continuously so it can be read out at any moment. Those models attach the ODE to a lookup table with one learned vector per entity, so they cannot transfer at all. We propose a single model that removes this trade-off. It places the continuous-time state on the relation types rather than the entities, lets that state evolve under an ODE whose vector field is a small graph network over "how relations co-occur," and measures time in a clock set by each graph's own event rate rather than in days or minutes.

The core idea fits in two sentences. Instead of learning how each entity changes over time, learn how the predictive strength of each relation rises, decays, and reactivates between events, in a way that depends only on the structure of how relations interact. Then run that dynamics in units of "typical gaps between events in this graph," so a model trained on daily political events can be applied unchanged to a 15-minute news stream or to a yearly encyclopedia. The model answers both what happens next (link forecasting) and when (time prediction), zero-shot on graphs it has never seen.

Where the two directions stand

Inductive relational reasoning learns patterns that do not depend on entity identity. Neural LP learns logical rules as soft chains of relation matrices and reached 94.49% on WN18 with disjoint test entities, where TransE fell to near 0%. That paper is our motivation for never storing per-entity vectors. ULTRA goes further. It builds a "relation graph" whose nodes are relation types and whose edges record four ways two relations can share an entity (tail-to-head, head-to-head, head-to-tail, tail-to-tail), computes relation features conditioned on the query relation, and feeds them to an entity-level path solver. With about 177k parameters it reaches 0.395 average zero-shot MRR across 54 graphs. We reuse its relation graph as the domain of our vector field. FITTER brings this to temporal graphs and transfers across vocabularies and time granularities. It achieves time-shift invariance by replacing timestamps with relative snapshot indices encoded sinusoidally, and it reports recovering 89–96% of in-domain transductive performance. It is our closest prior work and our main competitor. Its design choice, discarding gap lengths, is exactly what we contest. TiPNN also avoids entity IDs by extracting query-aware paths with relative time encodings, but it works on discretized history.

Continuous time enters relational rule learners only in heuristic form. TLogic scores mined temporal rules with a fixed exponential recency decay and reaches 0.4304 MRR on ICEWS14. TEILP models gaps between rule-linked events with Gaussian mixtures and reduces ICEWS14 time-prediction error to 70.06 days, against 87.39 for TimePlex. In both, the time model is a static function of the gap, decoupled from rule execution. Our model replaces that static function with a learned dynamics, which can express non-monotone effects such as a relation that becomes predictive again weeks after a trigger.

On the ODE side, Neural ODEs supply the integration machinery. Graph Neural ODEs supply the hybrid "flow between observations, jump at observations" scheme we adopt; their autoregressive variant held RMSE at 10.95 against 11.20 for a discrete counterpart on PeMS with 70% missing data. TANGO is the direct continuous-time temporal-KG precedent, at 42.86% MRR on ICEWS05-15 and 12x faster training than RE-Net. It integrates entity and relation embedding tables, however, so a new graph means retraining. FieldE uses ODEs as geometric paths between static entity embeddings, with one network per relation, and is transductive on both counts. CTGN integrates per-node memory over interaction durations on single-relation interaction graphs. All four bind the continuous state to identities. Our model binds it to relational structure.

Core Claim

The claim is that continuous time and vocabulary-agnostic transfer are compatible. Invariance across datasets does not require snapshot discretization. It requires that the dynamics be autonomous and run in a time variable normalized by a scale the model can read off the graph itself.

Let $t$ be raw time and $s_G$ the median gap between consecutive events in the observed history of graph $G$. This statistic is available at test time without labels. Define the clock $\tau = (t - t_0)/s_G$. If every timestamp in $G$ is multiplied by a constant $c$, $s_G$ is multiplied by $c$ and $\tau$ is unchanged. Using gaps from $t_0$ gives shift invariance, so the model is exactly invariant to the choice of units and origin. It keeps the relative lengths of irregular gaps, which snapshot indices discard.

The state is a matrix $A(\tau)$ with one $d$-dimensional row $\alpha_r(\tau)$ per relation $r$, conditioned on the query relation through ULTRA's labeling trick. Between events it flows; when an event of relation $r$ arrives it jumps:

$$\frac{dA(\tau)}{d\tau} = g_\phi\big(A(\tau);\, \mathcal{R}_G\big), \qquad \alpha_r(\tau_e^+) = \alpha_r(\tau_e^-) + u_\phi\big(A(\tau_e^-), e\big).$$

Here $g_\phi$ is a message-passing network over the relation graph $\mathcal{R}_G$ with its four edge types. The update $u_\phi$ is applied at event $e$ and sees only the event's relation, its position in the relation graph, and how many entities it touches, never entity identities. Because conditioning depends only on the query relation, there are at most $|R|$ distinct trajectories, each over $|R|$ nodes. Relation vocabularies are far smaller than entity sets, so integration is cheap compared with entity-level ODEs, and the cost is roughly independent of how dense the entity graph is. This addresses the cost concerns raised for FITTER (about 21 hours of GDELT inference) and for graph ODEs generally.

The state is read out in two ways. For link forecasting, $A(\tau_q)$ at the query time supplies the relation features consumed by an ULTRA/NBFNet-style entity path solver run over recent history, replacing FITTER's snapshot encodings. For time prediction, a readout gives an event rate $\lambda_q(\tau) = \mathrm{softplus}(w^\top[\alpha_{r_q}(\tau); h_q])$, where $h_q$ is the path solver's query-specific entity score feature. We augment the ODE with the running integral of $\lambda_q$, so the probability that no event has occurred yet, and hence a predicted time, comes out of the same solver call. This second output is something a gap encoding cannot produce without evaluating a dense time grid.

A side benefit is interpretability. Each $\alpha_r(\tau)$ is a curve of how strongly relation $r$ supports the query relation over time. This is a learned replacement for TLogic's fixed decay and can be inspected and compared against mined rules.

Research Program

We will build the model on top of the FITTER and ULTRA codebases' relation-graph construction, using a fixed-step fourth-order Runge–Kutta solver. Adaptive solvers are avoided because the stiffness literature and the GDE results warn they overfit and slow training. We will pretrain on a mixture of ICEWS14, ICEWS18 and ICEWS05-15 and evaluate zero-shot on graphs with different vocabularies and granularities: GDELT at 15 minutes, YAGO yearly, and WIKI. We follow FITTER's cross-domain protocol so numbers are directly comparable.

For time prediction we use TEILP's TEKG construction and evaluation code (TEILP Codebase) and measure MAE on ICEWS14 and interval overlap (aeIOU) on YAGO11k. Our model is evaluated both zero-shot and with the short fine-tuning budget ULTRA reports as typical (1,000–2,000 steps).

The analysis has three parts. The first is an exact invariance test, where timestamps of a held-out graph are rescaled by factors from 1/60 to 60. The second is an irregularity sweep, where events are thinned non-uniformly to create bursty, asynchronous streams, following TANGO's irregular ICEWS05-15 setup and extending it to the transfer targets. The third is an inspection of learned relation trajectories for non-monotone shapes that a decay model cannot represent.

Baselines

The naive reference point is a recency-and-frequency heuristic that predicts the object most often seen with the same subject and relation in the recent window, and the historical mean gap for time prediction. It needs no training, is run on identical splits, and anything that fails to beat it clearly has learned nothing transferable. No reported result was found on Lacuna for this heuristic on these splits, so we will measure it ourselves.

The strongest existing competitor for zero-shot transfer is FITTER. It shares our vocabulary-agnostic relation graph and differs exactly in how time is represented, so it isolates our question. The file reports only that it recovers 89–96% of in-domain transductive performance. We found no per-dataset zero-shot MRR for FITTER on Lacuna, so we will rerun it on our pretraining mixture and targets with the same path solver depth, hidden size, training steps and hyperparameter search budget. Beating it means higher zero-shot MRR on the transfer targets with confidence intervals over three seeds, and a widening gap as gaps become more irregular.

For in-domain reference we compare against TLogic (0.4304 MRR on ICEWS14) and TANGO (42.86% MRR on ICEWS05-15), both trained on the target graph. Matching them while being zero-shot would be a strong result. Falling within FITTER's 89–96% recovery band, but with continuous time, is the minimum bar. For time prediction the reference is TEILP at 70.06 days MAE on ICEWS14 and 0.2996 aeIOU on YAGO11k. Beating TEILP after short fine-tuning, or approaching it zero-shot, would count as success.

Three ablations isolate the key ingredients, all sharing the same backbone and budget. The first replaces the ODE with a closed-form per-relation exponential decay whose rate is predicted from the relation graph; this is a learned, transferable TLogic and corresponds to the special case of a linear diagonal vector field. The second replaces the ODE with sinusoidal encodings of the normalized gap $\tau$. The third keeps the ODE but runs it in raw time instead of the normalized clock.

Why not just…?

Why not just use FITTER with finer snapshots? Finer bins recover some gap information. But snapshot indices treat a one-minute gap and a one-week gap that happen to be adjacent snapshots identically, and finer bins multiply the number of snapshots, which is where FITTER's 21-hour GDELT cost comes from. The irregularity sweep, run with FITTER at several bin widths, directly tests whether bin width can substitute for continuous gaps at comparable compute.

Why not just encode the normalized gap with sinusoids and skip the ODE? This is the most serious threat. Because it uses our clock, it inherits our invariance, and it may match us on link forecasting. The ODE has two things to offer that it lacks: state that accumulates jumps from many asynchronous events, rather than encoding one gap at a time, and an event rate whose integral yields time prediction in one solve. If the second ablation matches the full model on both link and time prediction across the irregularity sweep, we will report that the normalized clock, not the ODE, is the contribution, and present it as such.

Why not just learn a transferable exponential decay, as TLogic does but conditioned on relation structure? This is a linear ODE with a closed-form solution, cheap and interpretable. It cannot express rise-then-fall or reactivation patterns. The first ablation measures how much accuracy those patterns are worth, and inspecting the learned trajectories shows whether the full model actually uses non-monotone shapes. If it does not, the decay model is the better choice.

Decisive Checks

The idea stands or falls on four results. The rescaling test should show identical predictions for our model and measurable degradation for the raw-time ablation and for gap encodings without normalization. Under the irregularity sweep, our advantage over FITTER should grow with irregularity; if it is flat, continuous time adds nothing for transfer. Zero-shot transfer from daily ICEWS to 15-minute GDELT should match or exceed FITTER at a fraction of its inference time, since integration cost scales with the relation vocabulary rather than with entity density. Finally, zero-shot or lightly fine-tuned time prediction should approach TEILP's 70.06-day MAE on ICEWS14 without any dataset-specific gap distributions. If the full model loses to the closed-form decay or gap-encoding ablations on all four, we will conclude that self-normalized time, not continuous dynamics, is what vocabulary-agnostic temporal reasoning needs, and report it as the finding.