SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.00312 · ICLR · 2023

Multimodal Analogical Reasoning over Knowledge Graphs

Lei Li, Xiang Chen, Ningyu Zhang, Shumin Deng, Huajun Chen, Xiaozhuan Liang

arXiv · PDF · Open in the Atlas

Code that ran

17 of 27 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 10 have no contract verdict; 5 failures of our instrument; 10 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/2210.00312.json · badge: /api/ran/2210.00312.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
zjunlp/MKGformer canonical (classifier label)
classifier basis not recorded on the link
12 ran · 0 no recorded run
zjunlp/MKG_Analogy marked official in Papers with Code
Papers with Code archive
5 ran · 10 no recorded run
FunctionStatusWhere it lives
CLIPMLP Ran
ran on a synthesized input · constructed an object; no result was computed
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("afce1111b619c932")
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, CLIPMLP: 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
from transformers.activations import ACT2FN

torch.manual_seed(0)

# Create a minimal config object with the required attributes
class MinimalConfig:
    def __init__(self):
        self.hidden_size = 4
        self.intermediate_size = 8
        self.hidden_act = "gelu"

config = MinimalConfig()

ARGS = {
    "config": config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CLIPMLP — 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 CLIPMLP 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
CLIPVisionEmbeddings Ran
ran on a synthesized input · constructed an object; no result was computed
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("83268e2e1fee13be")
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, CLIPVisionEmbeddings: 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
from torch import nn
from transformers.models.clip import CLIPVisionConfig

torch.manual_seed(0)

# Create a minimal CLIPVisionConfig
config = CLIPVisionConfig(
    hidden_size=4,
    image_size=8,
    patch_size=4,
    num_hidden_layers=2,
    projection_dim=4,
)

# Create pixel_values tensor: (batch_size=2, channels=3, height=8, width=8)
pixel_values = torch.randn(2, 3, 8, 8)

# Create aux_embeddings: list of tensors with shape (batch_size, channels=3, height, width)
aux_embeddings = [
    torch.randn(2, 3, 8, 8),
    torch.randn(2, 3, 8, 8),
]

# Create rcnn_embeddings: list of tensors with shape (batch_size, channels=3, height, width)
rcnn_embeddings = [
    torch.randn(2, 3, 8, 8),
    torch.randn(2, 3, 8, 8),
]

ARGS = {
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CLIPVisionEmbeddings — 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 CLIPVisionEmbeddings 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
_expand_mask Ran
ran; our contract draft was wrong, not the code
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("4b1fb3ae6a6d23fd")
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) and returned Tensor, ndim 4, dtype family float, shape (2, 1, 3, 4) 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)

# Create a small attention mask tensor of shape [bsz, seq_len]
# bsz=2, seq_len=4
mask = torch.randint(0, 2, (2, 4), dtype=torch.float32)

# dtype for expansion
dtype = torch.float32

# Optional target length (can be None or an int)
tgt_len = 3

ARGS = {
    "mask": mask,
    "dtype": dtype,
    "tgt_len": tgt_len,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 4, dtype family float, shape (2, 1, 3, 4) — shape (2, 1, 3, 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
acc Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/lit_models/utils.py
code served (permissive licence) · get_code("e5c96daa2363c6ff")
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

# Create sample logits and labels
# logits: shape (batch_size, num_classes)
# The function uses np.argmax(logits, axis=-1) to get predictions
# and compares with labels, so labels should have shape (batch_size,)

batch_size = 2
num_classes = 4

logits = np.random.randn(batch_size, num_classes).astype(np.float32)
labels = np.array([0, 2], dtype=np.int64)

ARGS = {
    "logits": logits,
    "labels": labels,
}
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 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
clip_loss Ran
ran; our contract draft was wrong, not the code
zjunlp/MKGformer/MKG/models/modeling_clip.py
pointer only (licence: MIT); the stored copy get_code serves, from microsoft/xpretrain, is pointer only (licence: NOASSERTION) · get_code("e5b89b1f72c319ed")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from microsoft/xpretrain, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

clip_loss Ran
ran, violated the contract we drafted
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("1aa7f7b75b2418fa")
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 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
from torch import nn

torch.manual_seed(0)

# The function clip_loss takes a similarity tensor and computes contrastive loss
# from it. The similarity tensor is used in two ways:
# 1. As logits directly in contrastive_loss(similarity)
# 2. Transposed in contrastive_loss(similarity.T)
# 
# contrastive_loss expects a 2D tensor (batch_size, num_classes) where
# it computes cross_entropy with targets being torch.arange(len(logits))
# 
# For clip_loss, similarity should be a 2D tensor representing similarity
# between images and captions. A typical shape would be (batch_size, batch_size)
# where each row is similarities of one image to all captions and vice versa.

# Create a small similarity matrix (batch_size=2, matching dimensions)
# Shape: (2, 2) - small batch of 2 samples
similarity = torch.randn(2, 2, dtype=torch.float32)

ARGS = {
    "similarity": similarity,
}
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 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
contrastive_loss Ran
ran; our contract draft was wrong, not the code
zjunlp/MKGformer/MKG/models/modeling_clip.py
pointer only (licence: MIT); the stored copy get_code serves, from microsoft/xpretrain, is pointer only (licence: NOASSERTION) · get_code("4675779aec92d6c0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from microsoft/xpretrain, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

contrastive_loss Ran
ran, honoured the contract we drafted
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("f2e5f28608115fa6")
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) and returned Tensor, 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
from torch import nn

torch.manual_seed(0)

# The function expects a logits tensor
# It computes cross_entropy(logits, torch.arange(len(logits)))
# So logits should be a 2D tensor where:
# - First dimension is batch size (will be used as target indices 0, 1, 2, ...)
# - Second dimension is number of classes
# For cross_entropy, we need num_classes >= max(target_indices)
# If batch_size=2, targets will be [0, 1], so we need at least 2 classes

logits = torch.randn(2, 4)  # batch_size=2, num_classes=4

ARGS = {
    "logits": logits,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
decode Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/lit_models/transformer.py
code served (permissive licence) · get_code("4aaee21eb89b469e")
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 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 numpy as np

torch.manual_seed(0)

class MockTokenizer:
    """Stand-in tokenizer that implements batch_decode method."""
    def batch_decode(self, output_ids, skip_special_tokens=False, clean_up_tokenization_spaces=True):
        """Mock batch_decode that returns a list of strings."""
        # Convert tensor to list if needed
        if isinstance(output_ids, torch.Tensor):
            output_ids = output_ids.tolist()
        
        # Return a list of strings (one per batch item)
        # Add some whitespace to test str.strip behavior
        return ["  hello world  ", "  test string  "]

# Create mock tokenizer
tokenizer = MockTokenizer()

# Create output_ids as a small tensor (batch_size=2, seq_len=4)
output_ids = torch.tensor([[1, 2, 3, 4], [5, 6, 7, 8]])

ARGS = {
    "output_ids": output_ids,
    "tokenizer": tokenizer,
}
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 list, ndim 1, dtype family float — 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
get_entity_spans_pre_processing Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/models/utils.py
code served (permissive licence) · get_code("a0b34bcb573fbd1c")
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 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

sentences = [
    "This is a test sentence",
    "Another sentence with special\xa0characters {and} [brackets]"
]

ARGS = {
    "sentences": sentences
}
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 list, ndim 1, dtype family float — 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
get_extended_attention_mask Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/models/modeling_unimo.py
code served (permissive licence) · get_code("dd48a2143b53be6f")
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 4, dtype family float, shape (2, 1, 1, 4) 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
from torch import nn, device as torch_device

torch.manual_seed(0)

# Create a 2D attention mask (batch_size=2, seq_length=4)
# 1 indicates tokens to attend to, 0 for tokens to ignore
attention_mask_2d = torch.tensor([
    [1, 1, 1, 0],
    [1, 1, 0, 0]
], dtype=torch.long)

# Define input_shape
input_shape = (2, 4)  # (batch_size, seq_length)

# Define device (CPU only)
device = torch_device('cpu')

ARGS = {
    'attention_mask': attention_mask_2d,
    'input_shape': input_shape,
    '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 Tensor, ndim 4, dtype family float, shape (2, 1, 1, 4) — shape (2, 1, 1, 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
get_head_mask Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/models/modeling_unimo.py
code served (permissive licence) · get_code("14ea78cc67ff4f00")
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 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
from torch import nn, Tensor

torch.manual_seed(0)

# Test case 1: head_mask is None
ARGS = {
    "head_mask": None,
    "num_hidden_layers": 12,
    "is_attention_chunked": False,
}
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 list, ndim 1, dtype family float — 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
label_smoothed_nll_loss Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/models/utils.py
code served (permissive licence) · get_code("fadc10fc2c451c92")
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

torch.manual_seed(0)

# Construct arguments for label_smoothed_nll_loss
# The function expects:
# - lprobs: log probabilities tensor, shape (batch_size, vocab_size)
# - target: target indices tensor, shape (batch_size,) or (batch_size, 1)
# - epsilon: label smoothing parameter (float)
# - ignore_index: index to ignore in loss computation (int, default -100)

batch_size = 2
vocab_size = 4

# lprobs: log probabilities, typically output from log_softmax
# Shape: (batch_size, vocab_size)
lprobs = torch.randn(batch_size, vocab_size)
lprobs = torch.log_softmax(lprobs, dim=-1)

# target: ground truth label indices
# Shape: (batch_size,)
target = torch.tensor([0, 2], dtype=torch.long)

# epsilon: label smoothing coefficient (typically small, e.g., 0.1)
epsilon = 0.1

# ignore_index: padding token index to ignore (default -100)
ignore_index = -100

ARGS = {
    "lprobs": lprobs,
    "target": target,
    "epsilon": epsilon,
    "ignore_index": ignore_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, 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
lmap Ran
ran; our contract draft was wrong, not the code
zjunlp/MKGformer/MKG/lit_models/transformer.py
code served (permissive licence) · get_code("cca3a1dc3db5bbf1")
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 1, 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 torch
import torch.nn as nn
from typing import Callable, Iterable, List

torch.manual_seed(0)

# Define a simple callable function
def simple_function(x):
    return x * 2

# Define an iterable with various types
iterable_data = [1, 2, 3, 4, 5]

# Construct ARGS dictionary
ARGS = {
    "f": simple_function,
    "x": iterable_data
}
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 list, ndim 1, 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
multilabel_categorical_crossentropy Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/lit_models/transformer.py
code served (permissive licence) · get_code("d235c954a3acaf08")
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 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)

# Create small tensors for multilabel classification
# y_pred: predicted logits/scores for multilabel classification
# y_true: binary labels (0 or 1) for multilabel classification

batch_size = 2
num_labels = 4

# Predictions: logits for each label (batch_size x num_labels)
y_pred = torch.randn(batch_size, num_labels)

# Ground truth: binary labels for each label (batch_size x num_labels)
y_true = torch.randint(0, 2, (batch_size, num_labels)).float()

ARGS = {
    "y_pred": y_pred,
    "y_true": y_true
}
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 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
rank_score Ran
ran on a synthesized input
zjunlp/MKGformer/MKG/lit_models/utils.py
code served (permissive licence) · get_code("a698ba8988b64507")
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

# The function rank_score takes a list of ranks (integers representing ranking positions)
# and computes hit rates at different thresholds and mean reciprocal rank.
# 
# Looking at the function body:
# - It iterates through ranks with enumerate
# - It checks if each rank is <= 10, <= 5, or <= 1
# - It computes 1.0 / rank for MRR
# - It returns means of lists
#
# So 'ranks' should be a list of positive integers representing rank positions

# Create a sample list of ranks for testing
ranks = [1, 2, 5, 8, 15, 20, 3, 4]

ARGS = {
    "ranks": ranks
}
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
replace_return_docstrings Ran
ran; our contract draft was wrong, not the code
zjunlp/MKGformer/MKG/models/utils.py
code served (permissive licence) · get_code("67aa808378a82feb")
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 function. 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 re

class MockOutputType:
    """Mock output type class for testing"""
    __module__ = "transformers.models.mock"
    __name__ = "MockOutput"
    __doc__ = """
    Mock output class.
    
    Args:
        logits (`torch.FloatTensor` of shape `(batch_size, sequence_length, vocab_size)`):
            Prediction scores of the language modeling head.
        hidden_states (`torch.FloatTensor`, *optional*):
            Hidden states of the model.
        attentions (`torch.FloatTensor`, *optional*):
            Attention weights.
    """

class TFMockOutputType:
    """Mock TensorFlow output type class for testing"""
    __module__ = "transformers.models.mock"
    __name__ = "TFMockOutput"
    __doc__ = """
    Mock TensorFlow output class.
    
    Args:
        logits (`tf.Tensor` of shape `(batch_size, sequence_length, vocab_size)`):
            Prediction scores of the language modeling head.
        hidden_states (`tf.Tensor`, *optional*):
            Hidden states of the model.
    """

def mock_function():
    """
    A mock function with a Returns placeholder.
    
    Args:
        input_ids: Input tensor
        attention_mask: Attention mask
    
    Returns:
        Placeholder for return documentation
    """
    pass

ARGS = {
    "output_type": MockOutputType,
    "config_class": "MockConfig"
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
CLIPAttention Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("bc71a7b0ac64e193")
How it ran

no invocation recorded.

CLIPBaseModelOutput Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("eac07c4625c7ecf0")
How it ran

no invocation recorded.

CLIPBaseModelOutputWithPooling Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("0a895d6880258edf")
How it ran

no invocation recorded.

CLIPEncoder Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("89fb5ce36cf33f90")
How it ran

no invocation recorded.

CLIPEncoderLayer Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("d8f1abf8ccc978b3")
How it ran

no invocation recorded.

CLIPModel Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("27ff4c9021371f00")
How it ran

no invocation recorded.

CLIPOutput Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("c1560a0097321925")
How it ran

no invocation recorded.

CLIPTextEmbeddings Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("f27778de07c0b042")
How it ran

no invocation recorded.

CLIPTextTransformer Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("cb9f127c9449b83d")
How it ran

no invocation recorded.

CLIPVisionTransformer Not yet run
unverified (harvested, no recorded run)
zjunlp/MKG_Analogy/MarT/models/modeling_clip.py
code served (permissive licence) · get_code("255891e0b510d846")
How it ran

no invocation recorded.

Also present in other papers' code

Of 27 samples lifted from this paper's linked repositories, 27 carry a function identity and 0 do not. Of the 25 distinct functions with an identity, 9 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 4 the same month, 5 later) and 16 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
contrastive_loss
brick of this paper's assembly: loss
27 other papers
2 dated earlier, 1 the same month, 24 later · 3 only as an assembly brick
2206.00621 (2022-06)
Cross-View Language Modeling: Towards Unified Cross-Lingual Cross-Modal Pre-training
2209.06430 (2022-09)
CLIP-ViP: Adapting Pre-trained Image-Text Model to Video-Language Alignment
2210.07795 (2022-10)
EfficientVLM: Fast and Accurate Vision-Language Models via Knowledge Distillation and Modal-adaptive Pruning
and 24 more not named here
lmap 9 other papers
8 dated earlier, 1 later
2007.08426 (2020-07)
Investigating Pretrained Language Models for Graph-to-Text Generation
2104.08400 (2021-04)
Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs
2104.08691 (2021-04)
The Power of Scale for Parameter-Efficient Prompt Tuning
and 6 more not named here
clip_loss
brick of this paper's assembly: loss
6 other papers
2 dated earlier, 1 the same month, 3 later · 1 only as an assembly brick
2206.00621 (2022-06)
Cross-View Language Modeling: Towards Unified Cross-Lingual Cross-Modal Pre-training
2209.06430 (2022-09)
CLIP-ViP: Adapting Pre-trained Image-Text Model to Video-Language Alignment
2210.07795 (2022-10)
EfficientVLM: Fast and Accurate Vision-Language Models via Knowledge Distillation and Modal-adaptive Pruning
and 3 more not named here
replace_return_docstrings 4 other papers
2 dated earlier, 2 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2104.08066 (2021-04)
Effect of Visual Extensions on Natural Language Understanding in Vision-and-Language Models
2305.01938 (2023-05)
Doc2SoarGraph: Discrete Reasoning over Visually-Rich Table-Text Documents via Semantic-Oriented Hierarchical Graphs
and 1 more not named here
_expand_mask
brick of this paper's assembly: helper
3 other papers
1 dated earlier, 2 later
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2308.07648 (2023-08)
Prompt Switch: Efficient CLIP Adaptation for Text-Video Retrieval
2506.13366 (2025-06)
Enhancing Goal-oriented Proactive Dialogue Systems via Consistency Reflection and Correction
acc 1 other paper
1 the same month
2210.10678 (2022-10)
Towards Realistic Low-resource Relation Extraction: A Benchmark with Empirical Baseline Study
get_entity_spans_pre_processing 1 other paper
1 dated earlier
2208.07652 (2022-08)
CorpusBrain: Pre-train a Generative Retrieval Model for Knowledge-Intensive Language Tasks
label_smoothed_nll_loss 1 other paper
1 dated earlier
2203.07836 (2022-03)
Graph Pre-training for AMR Parsing and Generation
multilabel_categorical_crossentropy 1 other paper
1 the same month
2210.10678 (2022-10)
Towards Realistic Low-resource Relation Extraction: A Benchmark with Empirical Baseline Study

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

Analogical reasoning is fundamental to human cognition and holds an important place in various fields. However, previous studies mainly focus on single-modal analogical reasoning and ignore taking advantage of structure knowledge. Notably, the research in cognitive psychology has demonstrated that information from multimodal sources always brings more powerful cognitive transfer than single modality sources. To this end, we introduce the new task of multimodal analogical reasoning over knowledge graphs, which requires multimodal reasoning ability with the help of background knowledge. Specifically, we construct a Multimodal Analogical Reasoning dataSet (MARS) and a multimodal knowledge graph MarKG. We evaluate with multimodal knowledge graph embedding and pre-trained Transformer baselines, illustrating the potential challenges of the proposed task. We further propose a novel model-agnostic Multimodal analogical reasoning framework with Transformer (MarT) motivated by the structure mapping theory, which can obtain better performance. We hope our work can deliver benefits and inspire future research 1 .

For agents

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

get_harvested_code_for_paper("2210.00312")
get_code_for_paper("2210.00312")
have("2210.00312")

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

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

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

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

Connect an agent — have() is free.