SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.emnlp-main.274 · EMNLP · 2023

NeuSTIP: A Neuro-Symbolic Model for Link and Time Prediction in Temporal Knowledge Graphs

Ishaan Singh, Navdeep Kaur, Garima Mausam

Code that ran

10 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2023.emnlp-main.274.json · badge: /api/ran/2023.emnlp-main.274.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
liu-yushan/TLogic canonical (classifier label)
classifier basis: census
10 ran · 0 no recorded run
FunctionStatusWhere it lives
baseline_candidates Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/baseline.py
code served (permissive licence) · get_code("a5683f1f2c0762fb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# test_query_rel: an integer representing a test query relation
test_query_rel = 5

# edges: a dict mapping relation ids to lists of edge tuples
edges = {
    1: [(0, 1), (1, 2)],
    2: [(2, 3), (3, 4)],
    5: [(1, 3), (2, 4)],
}

# obj_dist: overall object distribution as a dict mapping object ids to their frequencies
obj_dist = {
    0: 0.1,
    1: 0.2,
    2: 0.3,
    3: 0.25,
    4: 0.15,
}

# rel_obj_dist: object distribution for each relation, dict mapping relation id to dict of object frequencies
rel_obj_dist = {
    1: {0: 0.05, 1: 0.15, 2: 0.8},
    2: {2: 0.4, 3: 0.35, 4: 0.25},
    5: {1: 0.5, 3: 0.3, 4: 0.2},
}

ARGS = {
    "test_query_rel": test_query_rel,
    "edges": edges,
    "obj_dist": obj_dist,
    "rel_obj_dist": rel_obj_dist,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_obj_distribution Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/baseline.py
code served (permissive licence) · get_code("0b2d215afc7228c7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from collections import Counter

# Construct learn_data as a numpy array
# The function accesses learn_data[:, 2] to get objects (3rd column)
# Shape: (n_samples, 3) where columns are [subject, relation, object]
learn_data = np.array([
    [0, 1, 10],
    [1, 2, 10],
    [2, 1, 11],
    [3, 2, 10],
    [4, 3, 12],
    [5, 3, 11],
], dtype=np.int64)

# Construct edges dict
# Keys are relation IDs, values are numpy arrays with same structure as learn_data
# The function accesses edges[rel][:, 2] to get objects for each relation
edges = {
    1: np.array([[0, 1, 10], [2, 1, 11]], dtype=np.int64),
    2: np.array([[1, 2, 10], [3, 2, 10]], dtype=np.int64),
    3: np.array([[4, 3, 12], [5, 3, 11]], dtype=np.int64),
}

ARGS = {
    "learn_data": learn_data,
    "edges": edges,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
filter_rules Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/rule_application.py
code served (permissive licence) · get_code("e249fe89454c4279")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct a valid rules_dict
# The function expects a dict where values are lists of rule dictionaries
# Each rule dict needs 'conf', 'body_supp', and 'body_rels' keys

rules_dict = {
    'rule_type_1': [
        {
            'conf': 0.95,
            'body_supp': 50,
            'body_rels': ['rel1', 'rel2']
        },
        {
            'conf': 0.75,
            'body_supp': 30,
            'body_rels': ['rel1', 'rel2', 'rel3']
        },
        {
            'conf': 0.50,
            'body_supp': 10,
            'body_rels': ['rel1']
        }
    ],
    'rule_type_2': [
        {
            'conf': 0.85,
            'body_supp': 40,
            'body_rels': ['rel2', 'rel3', 'rel4']
        },
        {
            'conf': 0.60,
            'body_supp': 20,
            'body_rels': ['rel1']
        }
    ]
}

min_conf = 0.7
min_body_supp = 25
rule_lengths = [2, 3]

ARGS = {
    'rules_dict': rules_dict,
    'min_conf': min_conf,
    'min_body_supp': min_body_supp,
    'rule_lengths': rule_lengths
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
match_body_relations Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/rule_application.py
code served (permissive licence) · get_code("b192f13202775a68")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 3, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct a minimal rule dict
rule = {
    'body_rels': [0, 1]  # Two relations in the body
}

# Construct edges dict with relation -> edge array mappings
# edges[rel_id] should be a 2D numpy array where:
# - column 0 is subject
# - column 1 is predicate (relation)
# - column 2 is object (target)
# - column 3 is additional info
edges = {
    0: np.array([
        [5, 0, 10, 1],
        [5, 0, 11, 2],
        [7, 0, 12, 3],
    ], dtype=np.int32),
    1: np.array([
        [10, 1, 20, 4],
        [11, 1, 21, 5],
        [12, 1, 22, 6],
    ], dtype=np.int32),
}

# Test query subject
test_query_sub = 5

ARGS = {
    'rule': rule,
    'edges': edges,
    'test_query_sub': test_query_sub,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 3, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
score1 Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/score_functions.py
code served (permissive licence) · get_code("ec64ca26282067c9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct a valid rule dict with required keys
rule = {
    'rule_supp': 0.8,      # support of the rule
    'body_supp': 0.5       # support of the rule body
}

# Construct the constant for smoothing
c = 0

# Map all parameters to their values
ARGS = {
    'rule': rule,
    'c': c
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
score2 Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/score_functions.py
code served (permissive licence) · get_code("38df6ead48b0d198")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd

# Create a small DataFrame with the required 'timestamp_0' column
cands_walks = pd.DataFrame({
    'timestamp_0': [100, 150, 200, 120]
})

# Define test query timestamp
test_query_ts = 250

# Define lambda parameter for exponential distribution
lmbda = -0.01

ARGS = {
    'cands_walks': cands_walks,
    'test_query_ts': test_query_ts,
    'lmbda': lmbda
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
score_12 Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/score_functions.py
code served (permissive licence) · get_code("c855d9800322402b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd

# Create a mock rule dictionary
rule = {
    'rule_supp': 0.8,
    'body_supp': 0.5
}

# Create a mock cands_walks DataFrame
# The function accesses cands_walks['timestamp_0']
cands_walks = pd.DataFrame({
    'timestamp_0': [1000, 1200, 1500, 800]
})

# Define other parameters
test_query_ts = 1600
lmbda = -0.001
a = 0.6

ARGS = {
    'rule': rule,
    'cands_walks': cands_walks,
    'test_query_ts': test_query_ts,
    'lmbda': lmbda,
    'a': a
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
store_edges Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/temporal_walk.py
code served (permissive licence) · get_code("24f5605c6d8557e5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small numpy array representing quadruples
# Shape: (num_quads, 4) where columns are [subject, relation, object, ...]
# We'll create 6 quadruples with 3 different relations
quads = np.array([
    [0, 1, 2, 0],
    [1, 1, 3, 1],
    [2, 2, 0, 2],
    [3, 2, 1, 3],
    [4, 3, 2, 4],
    [5, 3, 3, 5]
], dtype=np.int64)

ARGS = {
    "quads": quads
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
store_neighbors Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/temporal_walk.py
code served (permissive licence) · get_code("1e22a4f282698ce9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small numpy array representing quadruples
# Each row represents a quadruple with format: [source_node, ...]
# We'll create 5 quadruples with 4 columns
quads = np.array([
    [0, 1, 2, 3],
    [0, 4, 5, 6],
    [1, 7, 8, 9],
    [1, 10, 11, 12],
    [2, 13, 14, 15]
], dtype=np.int32)

ARGS = {
    "quads": quads
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
verbalize_rule Ran
ran on a synthesized input
liu-yushan/TLogic/mycode/rule_learning.py
code served (permissive licence) · get_code("1b15c1d6ef52d66a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Create a sample rule dictionary
rule = {
    'conf': 0.875432,  # confidence score
    'rule_supp': 15,   # rule support count
    'body_supp': 20,   # body support count
    'head_rel': 1,     # head relation index
    'body_rels': [2, 3, 4],  # body relation indices (3 relations in the body)
    'var_constraints': [[0, 2], [1], [3], [4]]  # variable constraints mapping
}

# Create a mapping from relation index to relation name
id2relation = {
    1: 'knows',
    2: 'likes',
    3: 'follows',
    4: 'mentors'
}

ARGS = {
    'rule': rule,
    'id2relation': id2relation
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
store_edges 1 other paper
1 same year, order not determinable
2312.15816 (2023-12)
TEILP: Time Prediction over Knowledge Graphs via Logical Reasoning
store_neighbors 1 other paper
1 same year, order not determinable
2312.15816 (2023-12)
TEILP: Time Prediction over Knowledge Graphs via Logical Reasoning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Neuro-symbolic (NS) models for knowledge graph completion (KGC) combine the benefits of symbolic models (interpretable inference) with those of distributed representations (parameter sharing, high accuracy). While several NS models exist for KGs with static facts, there is limited work on temporal KGC (TKGC) for KGs where a fact is associated with a time interval. In response, we propose a novel NS model for TKGC called NeuSTIP, which performs link prediction and time interval prediction in a TKG. NeuSTIP learns temporal rules with Allen predicates, which ensure temporal consistency between neighboring predicates in the rule body. We further design a unique scoring function that evaluates the confidence of the candidate answers while performing link and time interval predictions by utilizing the learned rules. Our empirical evaluation on two time interval based TKGC datasets shows that our model shows competitive performance on link prediction and establishes a new state of the art on time prediction.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2023.emnlp-main.274")
get_code_for_paper("2023.emnlp-main.274")
have("2023.emnlp-main.274")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2023.emnlp-main.274.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2023.emnlp-main.274.svg)](https://syntology.ai/paper/2023.emnlp-main.274)

Connect an agent — have() is free.