SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2510.23577 · NeurIPS · 2025

TAMI: Taming Heterogeneity in Temporal Interactions for Temporal Graph Link Prediction

Zhongyi Yu, Jianqiu Wu, Zhenghao Wu, Shuhan Zhong, Weifeng Su, Chul-Ho Lee, Weipeng Zhuo

arXiv · PDF · Open in the Atlas

Code that ran

6 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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/2510.23577.json · badge: /api/ran/2510.23577.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
Alleinx/TAMI_temporal_graph community
Papers with Code archive
6 ran · 6 no recorded run
FunctionStatusWhere it lives
MemoryBank Ran
ran on a synthesized input · constructed an object; no result was computed
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("88d37089bbc34b6f")
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 an instance of its own class, MemoryBank: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
from collections import defaultdict

torch.manual_seed(0)

ARGS = {
    'num_nodes': 8,
    'memory_dim': 4,
}
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 MemoryBank — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MemoryBank 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
MergeLayer Ran
ran on a synthesized input · constructed an object; no result was computed
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("d6c83c1b7087b900")
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 an instance of its own class, MergeLayer: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

class MergeLayer(nn.Module):

    def __init__(self, input_dim1: int, input_dim2: int, hidden_dim: int, output_dim: int):
        """
        Merge Layer to merge two inputs via: input_dim1 + input_dim2 -> hidden_dim -> output_dim.
        :param input_dim1: int, dimension of first input
        :param input_dim2: int, dimension of the second input
        :param hidden_dim: int, hidden dimension
        :param output_dim: int, dimension of the output
        """
        super().__init__()
        self.fc1 = nn.Linear(input_dim1 + input_dim2, hidden_dim)
        self.fc2 = nn.Linear(hidden_dim, output_dim)
        self.act = nn.ReLU()

    def forward(self, input_1: torch.Tensor, input_2: torch.Tensor):
        """
        merge and project the inputs
        :param input_1: Tensor, shape (*, input_dim1)
        :param input_2: Tensor, shape (*, input_dim2)
        :return:
        """
        x = torch.cat([input_1, input_2], dim=1)
        h = self.fc2(self.act(self.fc1(x)))
        return h


# Create test data
input_1 = torch.randn(2, 4)
input_2 = torch.randn(2, 3)

ARGS = {
    "input_dim1": 4,
    "input_dim2": 3,
    "hidden_dim": 5,
    "output_dim": 2,
}
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 MergeLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MergeLayer 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
MessageAggregator Ran
ran on a synthesized input · constructed an object; no result was computed
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("0cc93092271eaaae")
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 an instance of its own class, MessageAggregator: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

class MessageAggregator(nn.Module):

    def __init__(self):
        """
        Message aggregator. Given a batch of node ids and corresponding messages, aggregate messages with the same node id.
        """
        super(MessageAggregator, self).__init__()

    def aggregate_messages(self, node_ids: np.ndarray, node_raw_messages: dict):
        """
        given a list of node ids, and a list of messages of the same length,
        aggregate different messages with the same node id (only keep the last message for each node)
        :param node_ids: ndarray, shape (batch_size, )
        :param node_raw_messages: dict, dictionary of list, {node_id: list of tuples},
        each tuple is (message, time) with type (Tensor shape (message_dim, ), a scalar)
        :return:
        """
        unique_node_ids = np.unique(node_ids)
        unique_node_messages, unique_node_timestamps, to_update_node_ids = ([], [], [])
        for node_id in unique_node_ids:
            if len(node_raw_messages[node_id]) > 0:
                to_update_node_ids.append(node_id)
                unique_node_messages.append(node_raw_messages[node_id][-1][0])
                unique_node_timestamps.append(node_raw_messages[node_id][-1][1])
        to_update_node_ids = np.array(to_update_node_ids)
        unique_node_messages = torch.stack(unique_node_messages, dim=0) if len(unique_node_messages) > 0 else torch.Tensor([])
        unique_node_timestamps = np.array(unique_node_timestamps)
        return (to_update_node_ids, unique_node_messages, unique_node_timestamps)


# Create sample data
node_ids = np.array([0, 1, 0, 2, 1])

# Create messages: dict mapping node_id to list of (message_tensor, timestamp) tuples
node_raw_messages = {
    0: [
        (torch.tensor([1.0, 2.0, 3.0, 4.0]), 0.5),
        (torch.tensor([5.0, 6.0, 7.0, 8.0]), 1.5),
    ],
    1: [
        (torch.tensor([9.0, 10.0, 11.0, 12.0]), 2.0),
    ],
    2: [
        (torch.tensor([13.0, 14.0, 15.0, 16.0]), 0.8),
        (torch.tensor([17.0, 18.0, 19.0, 20.0]), 1.2),
        (torch.tensor([21.0, 22.0, 23.0, 24.0]), 3.0),
    ],
}

ARGS = {
}
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 MessageAggregator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MessageAggregator 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
NeighborSampler Ran
ran on a synthesized input · constructed an object; no result was computed
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("4ba369cbf1877730")
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 an instance of its own class, NeighborSampler: the run constructed the object and did not call it, so no result was computed. 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

# Construct a small adjacency list
# Each element is a list of tuples: (node_id, edge_id, timestamp)
# Node 0 has neighbors at different times
# Node 1 has neighbors at different times
adj_list = [
    [(1, 10, 1.0), (2, 11, 2.5), (3, 12, 3.7)],  # neighbors of node 0
    [(0, 20, 0.5), (2, 21, 1.8)],                 # neighbors of node 1
    [(0, 30, 1.2), (1, 31, 2.1), (3, 32, 4.0)],  # neighbors of node 2
]

ARGS = {
    'adj_list': adj_list,
    'sample_neighbor_strategy': 'uniform',
    'time_scaling_factor': 0.5,
    'seed': 42,
}
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 NeighborSampler — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a NeighborSampler 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
TimeEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("3442575cfdaa6e8f")
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 an instance of its own class, TimeEncoder: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'time_dim': 4,
    'parameter_requires_grad': True,
}
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 TimeEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TimeEncoder 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
TimeProjectionEmbedding Ran
ran on a synthesized input
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("cbda67021067d5e3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, 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 numpy as np

# INIT_ARGS for TimeProjectionEmbedding.__init__
INIT_ARGS = {
    'memory_dim': 8,
    'dropout': 0.1
}

# METHOD for the computation call
METHOD = 'compute_node_temporal_embeddings'

# ARGS for compute_node_temporal_embeddings
# We need:
# - node_memories: Tensor, shape (num_nodes, memory_dim)
# - node_ids: ndarray, shape (batch_size, )
# - node_time_intervals: Tensor, shape (batch_size, )

num_nodes = 10
batch_size = 3
memory_dim = 8  # Must match INIT_ARGS['memory_dim']

node_memories = torch.randn(num_nodes, memory_dim)
node_ids = np.array([0, 5, 9])  # Valid indices into node_memories
node_time_intervals = torch.randn(batch_size)

ARGS = {
    'node_memories': node_memories,
    'node_ids': node_ids,
    'node_time_intervals': node_time_intervals
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GRUMemoryUpdater Not yet run
unverified (harvested, no recorded run)
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("203d6e505cc1ee66")
How it ran

no invocation recorded.

GraphAttentionEmbedding Not yet run
unverified (harvested, no recorded run)
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("ddbf82031455bdde")
How it ran

no invocation recorded.

MemoryModel Not yet run
unverified (harvested, no recorded run)
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("011c68a3777418c4")
How it ran

no invocation recorded.

MemoryUpdater Not yet run
unverified (harvested, no recorded run)
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("999f04049e7dd348")
How it ran

no invocation recorded.

MultiHeadAttention Not yet run
unverified (harvested, no recorded run)
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("7ff8165c5ece0ae5")
How it ran

no invocation recorded.

RNNMemoryUpdater Not yet run
unverified (harvested, no recorded run)
Alleinx/TAMI_temporal_graph/models/MemoryModel.py
code served (permissive licence) · get_code("0ca29927400143ed")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
MultiHeadAttention
brick of this paper's assembly: helper
1 other paper
1 later
2602.00596 (2026-02)
Kernelized Edge Attention: Addressing Semantic Attention Blurring in Temporal Graph Neural Networks
NeighborSampler
brick of this paper's assembly: sampler
1 other paper
1 dated earlier
2303.13047 (2023-03)
Towards Better Dynamic Graph Learning: New Architecture and Unified Library

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

Repositories linked to this paper

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

Abstract

Temporal graph link prediction aims to predict future interactions between nodes in a graph based on their historical interactions, which are encoded in node embeddings. We observe that heterogeneity naturally appears in temporal interactions, e.g., a few node pairs can make most interaction events, and interaction events happen at varying intervals. This leads to the problems of ineffective temporal information encoding and forgetting of past interactions for a pair of nodes that interact intermittently for their link prediction. Existing methods, however, do not consider such heterogeneity in their learning process, and thus their learned temporal node embeddings are less effective, especially when predicting the links for infrequently interacting node pairs. To cope with the heterogeneity, we propose a novel framework called TAMI, which contains two effective components, namely log time encoding function (LTE) and link history aggregation (LHA). LTE better encodes the temporal information through transforming interaction intervals into more balanced ones, and LHA prevents the historical interactions for each target node pair from being forgotten. State-of-the-art temporal graph neural networks can be seamlessly and readily integrated into TAMI to improve their effectiveness. Experiment results on 13 classic datasets and three newest temporal graph benchmark (TGB) datasets show that TAMI consistently improves the link prediction performance of the underlying models in both transductive and inductive settings. Our code is available at https://github.com/Alleinx/TAMI_temporal_graph.

For agents

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

get_harvested_code_for_paper("2510.23577")
get_code_for_paper("2510.23577")
have("2510.23577")

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

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

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

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

Connect an agent — have() is free.