SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2008.12813 · 2020

HittER: Hierarchical Transformers for Knowledge Graph Embeddings

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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 7 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2008.12813.json · badge: /api/ran/2008.12813.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
microsoft/HittER community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
seeyourmind/tkgelib community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
filename_in_module Ran
ran on a synthesized input
microsoft/HittER/kge/misc.py
code served (permissive licence) · get_code("4ca15d3df7072836")
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 os
import inspect
import tempfile
import types

# Create a temporary directory and module file to satisfy the function's requirements
temp_dir = tempfile.mkdtemp()

# Create a simple Python module file in the temp directory
module_file_path = os.path.join(temp_dir, 'test_module.py')
with open(module_file_path, 'w') as f:
    f.write('# Test module\nTEST_VAR = 42\n')

# Create another temp directory for the second module
temp_dir2 = tempfile.mkdtemp()
module_file_path2 = os.path.join(temp_dir2, 'test_module2.py')
with open(module_file_path2, 'w') as f:
    f.write('# Test module 2\nTEST_VAR = 43\n')

# Create a test filename that exists in temp_dir
test_filename = 'test_file.txt'
test_file_full_path = os.path.join(temp_dir, test_filename)
with open(test_file_full_path, 'w') as f:
    f.write('test content')

# Create mock modules by dynamically loading the files
import importlib.util
spec = importlib.util.spec_from_file_location("test_module", module_file_path)
test_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(test_module)

spec2 = importlib.util.spec_from_file_location("test_module2", module_file_path2)
test_module2 = importlib.util.module_from_spec(spec2)
spec2.loader.exec_module(test_module2)

# Set the __file__ attribute to ensure inspect.getfile works
test_module.__file__ = module_file_path
test_module2.__file__ = module_file_path2

ARGS = {
    'module_or_module_list': test_module,
    'filename': test_filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
index_KvsAll Ran
ran on a synthesized input
microsoft/HittER/kge/indexing.py
code served (permissive licence) · get_code("6064ed3d652179ac")
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 OrderedDict. 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
from collections import defaultdict, OrderedDict

torch.manual_seed(0)

class MockConfig:
    def log(self, message, prefix=''):
        pass

class MockDataset:
    def __init__(self):
        self._indexes = {}
        self.config = MockConfig()
        self._splits = {
            'train': torch.LongTensor([
                [0, 1, 2],
                [1, 2, 0],
            ]),
            'valid': torch.LongTensor([
                [2, 0, 1],
                [0, 2, 1],
            ]),
            'test': torch.LongTensor([
                [1, 0, 2],
                [2, 1, 0],
            ]),
        }
    
    def split(self, split_name):
        return self._splits[split_name]

dataset = MockDataset()
split = 'train'
key = 'sp'

ARGS = {
    'dataset': dataset,
    'split': split,
    'key': key,
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
index_KvsAll_to_torch Ran
ran on a synthesized input
microsoft/HittER/kge/indexing.py
code served (permissive licence) · get_code("ef8ff474ebd295a8")
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. 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)

# The function expects an index dict where:
# - keys are integers (used as dict keys)
# - values are tensors or tensor-like objects that can be concatenated
# This mimics a "key vs all" index structure where each key maps to a set of values

index = {
    0: torch.tensor([1, 2, 3], dtype=torch.int),
    5: torch.tensor([4, 5], dtype=torch.int),
    10: torch.tensor([6, 7, 8, 9], dtype=torch.int),
}

ARGS = {
    "index": index
}
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 tuple — a tuple output has no array shape of its own; none is 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
index_frequency_percent Ran
ran on a synthesized input
seeyourmind/tkgelib/kge/indexing.py
pointer only (licence: MIT) · get_code("48fd41e4af6e88db")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, seeyourmind/tkgelib, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

index_neighbor Ran
ran on a synthesized input
microsoft/HittER/kge/indexing.py
code served (permissive licence) · get_code("60a0dd5eb91604d4")
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. 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
import networkx as nx

torch.manual_seed(0)

class MockConfig:
    def log(self, message, prefix=''):
        pass

class MockDataset:
    def __init__(self):
        self._indexes = {}
        self.config = MockConfig()
        self._num_entities = 5
        self._num_relations = 3
        self._train_triples = torch.tensor([
            [0, 0, 1],
            [1, 1, 2],
            [2, 0, 3],
            [0, 2, 4],
            [3, 1, 2]
        ], dtype=torch.long)
    
    def num_entities(self):
        return self._num_entities
    
    def num_relations(self):
        return self._num_relations
    
    def split(self, split_name):
        if split_name == 'train':
            return self._train_triples
        return torch.tensor([], dtype=torch.long)

dataset = MockDataset()

ARGS = {
    'dataset': dataset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
is_number Ran
ran on a synthesized input
microsoft/HittER/kge/misc.py
code served (permissive licence) · get_code("3087bb1d9186ca95")
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 bool, 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
import numpy as np

torch.manual_seed(0)

ARGS = {
    "s": "42",
    "number_type": int
}
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 bool, 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
which Ran
ran on a synthesized input
microsoft/HittER/kge/misc.py
code served (permissive licence) · get_code("5ebd841a3319a390")
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 os

# The function 'which' takes a single parameter 'program' which is a string
# representing the name or path of a program to search for in the system PATH.
# The function looks for executable files matching that program name.

# We'll provide a simple program name that might exist on most systems
ARGS = {
    "program": "python"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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, 2 later) and 5 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
is_number 2 other papers
1 later, 1 same year, order not determinable
2020.emnlp-demos.22 (2020 (year only))
LibKGE A knowledge graph embedding library for reproducible research
2106.12144 (2021-06)
NodePiece: Compositional and Parameter-Efficient Representations of Large Knowledge Graphs
which 2 other papers
1 later, 1 same year, order not determinable
2020.emnlp-demos.22 (2020 (year only))
LibKGE A knowledge graph embedding library for reproducible research
2106.12144 (2021-06)
NodePiece: Compositional and Parameter-Efficient Representations of Large Knowledge Graphs

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-22.

Repositories linked to this paper

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

Abstract

This paper examines the challenging problem of learning representations of entities and relations in a complex multi-relational knowledge graph. We propose HittER, a Hierarchical Transformer model to jointly learn Entity-relation composition and Relational contextualization based on a source entity's neighborhood. Our proposed model consists of two different Transformer blocks: the bottom block extracts features of each entity-relation pair in the local neighborhood of the source entity and the top block aggregates the relational information from outputs of the bottom block. We further design a masked entity prediction task to balance information from the relational context and the source entity itself. Experimental results show that HittER achieves new state-of-the-art results on multiple link prediction datasets. We additionally propose a simple approach to integrate HittER into BERT and demonstrate its effectiveness on two Freebase factoid question answering datasets.

For agents

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

get_harvested_code_for_paper("2008.12813")
get_code_for_paper("2008.12813")
have("2008.12813")

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

curl https://syntology.ai/api/ran/2008.12813.json

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

[![Syntology run record](https://syntology.ai/api/ran/2008.12813.svg)](https://syntology.ai/paper/2008.12813)

Connect an agent — have() is free.