SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.findings-acl.335 · ACL Findings · 2023

ECOLA: Enhancing Temporal Knowledge Embeddings with Contextualized Language Representations

Yao Zhang, Volker Tresp, Heinz Koeppl, Lmu Munich, Zhen Han, Zifeng Ding, Hinrich Schütze, Jindong Gu, Ruotong Liao, Yujia Gu

Open in the Atlas

Code that ran

5 of 5 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 5 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.findings-acl.335.json · badge: /api/ran/2023.findings-acl.335.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
mayhugotong/ECOLA canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
create_mlm_instances Ran
ran on a synthesized input
mayhugotong/ECOLA/code/utils.py
code served (permissive licence) · get_code("e4dbb17c4e2c48d2")
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 2, 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 random
import collections
import numpy as np

class SimpleTokenizer:
    def decode(self, token_ids):
        # Simulate decoding - return '##' prefix for tokens >= 100 to simulate subword tokens
        if token_ids[0] >= 100:
            return '##word'
        return 'word'

# Create token sequence with special tokens and regular tokens
# For BERT-like tokenizer: 0=PAD, 101=CLS, 102=SEP, 103=MASK
tokens = [101, 2054, 2003, 1045, 102, 2054, 2003, 2017, 102]  # CLS What is I SEP What is you SEP
mask_index = 103
vocab_size = 30522
tokenizer = SimpleTokenizer()
random_seed = 12345
masked_lm_prob = 0.15
max_predictions_per_seq = 20

ARGS = {
    'tokens': tokens,
    'mask_index': mask_index,
    'vocab_size': vocab_size,
    'tokenizer': tokenizer,
    'random_seed': random_seed,
    'masked_lm_prob': masked_lm_prob,
    'max_predictions_per_seq': max_predictions_per_seq
}
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 2, dtype family int — 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
get_linear_schedule Ran
ran on a synthesized input
mayhugotong/ECOLA/code/run_e2e_train.py
code served (permissive licence) · get_code("821383ed9b6c294c")
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 LambdaLR. 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 torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a simple model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = SGD(model.parameters(), lr=0.1)

# Define schedule parameters
warmup_steps = 100
training_steps = 1000
last_epoch = -1

ARGS = {
    "optimizer": optimizer,
    "warmup_steps": warmup_steps,
    "training_steps": training_steps,
    "last_epoch": last_epoch
}
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 LambdaLR — a LambdaLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LambdaLR 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
parse_batch_x Ran
ran on a synthesized input
mayhugotong/ECOLA/code/run_e2e_train.py
code served (permissive licence) · get_code("0b5492fb83cc2120")
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 a dict with various tensor keys
batch_x = {
    'input_ids': torch.randint(0, 1000, (2, 4)),  # batch_size=2, seq_len=4
    'num_tokens': torch.randint(1, 5, (2,)),  # batch_size=2
    'attention_mask': torch.ones((2, 4), dtype=torch.long),  # batch_size=2, seq_len=4
    'token_type_ids': torch.zeros((2, 4), dtype=torch.long),  # batch_size=2, seq_len=4
    'word_masked_lm_labels': torch.randint(-100, 1000, (2, 4)),  # batch_size=2, seq_len=4
    'entity_masked_lm_labels': torch.randint(-100, 1000, (2, 4)),  # batch_size=2, seq_len=4
    'relation_masked_lm_labels': torch.randint(-100, 1000, (2, 4)),  # batch_size=2, seq_len=4
    'tkg_tuple': torch.randint(0, 100, (2, 3)),  # batch_size=2, tuple_dim=3
    'tuple_labels': torch.randint(0, 2, (2,)),  # batch_size=2
}

device = 'cpu'

ARGS = {
    'batch_x': batch_x,
    'device': device,
}
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
setup_for_distributed_mode Ran
ran on a synthesized input
mayhugotong/ECOLA/code/run_e2e_train.py
code served (permissive licence) · get_code("4efc3b28c906bad3")
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 torch
import torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

# Build a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create model instance
model = MinimalModel()

# Create optimizer
optimizer = optim.SGD(model.parameters(), lr=0.01)

# Device (CPU only)
device = torch.device('cpu')

# Arguments dictionary
ARGS = {
    'model': model,
    'optimizer': optimizer,
    'device': device,
    'n_gpu': 1,
    'local_rank': -1,
    'fp16': False,
    'fp16_opt_level': 'O1'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
apex, torch — 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
to_device Ran
ran on a synthesized input
mayhugotong/ECOLA/code/utils.py
code served (permissive licence) · get_code("9013a1c0caf7f2d6")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# The function takes a single parameter: tensor
# It checks if CUDA is available and moves the tensor to CUDA if so
# Otherwise returns the tensor as-is
# We need to provide a valid tensor

tensor = torch.randn(2, 4)

ARGS = {
    "tensor": tensor
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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
to_device 1 other paper
1 dated earlier
2003.13432 (2020-03)
Graph Hawkes Neural Network for Forecasting on Temporal 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-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

Since conventional knowledge embedding models cannot take full advantage of the abundant textual information, there have been extensive research efforts in enhancing knowledge embedding using texts. However, existing enhancement approaches cannot apply to temporal knowledge graphs (tKGs), which contain time-dependent event knowledge with complex temporal dynamics. Specifically, existing enhancement approaches often assume knowledge embedding is time-independent. In contrast, the entity embedding in tKG models usually evolves, which poses the challenge of aligning temporally relevant texts with entities. To this end, we propose to study enhancing temporal knowledge embedding with textual data in this paper. As an approach to this task, we propose Enhanced Temporal Knowledge Embeddings with Contextualized Language Representations (ECOLA), which takes the temporal aspect into account and injects textual information into temporal knowledge embedding. To evaluate ECOLA, we introduce three new datasets for training and evaluating ECOLA. Extensive experiments show that ECOLA significantly enhances temporal KG embedding models with up to 287% relative improvements regarding Hits@1 on the link prediction task. The code and models are publicly available ‡ .

For agents

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

get_harvested_code_for_paper("2023.findings-acl.335")
get_code_for_paper("2023.findings-acl.335")
have("2023.findings-acl.335")

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

curl https://syntology.ai/api/ran/2023.findings-acl.335.json

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

[![Syntology run record](https://syntology.ai/api/ran/2023.findings-acl.335.svg)](https://syntology.ai/paper/2023.findings-acl.335)

Connect an agent — have() is free.