SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.06152 · 2023

Structure-CLIP: Towards Scene Graph Knowledge to Enhance Multi-modal Structured Representations

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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; 2 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/2305.06152.json · badge: /api/ran/2305.06152.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
zjukg/DUET canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
L2_normalize Ran
ran on a synthesized input
zjukg/DUET/model/visual_utils.py
code served (permissive licence) · get_code("499944ccee88c36f")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

# L2_normalize takes an array parameter and normalizes it using L2 norm
# It calls np.linalg.norm(array) and performs division
# The array should be a numpy array

# Create a small test array with distinct dimensions
test_array = np.array([3.0, 4.0, 0.0, 0.0], dtype=np.float32)

ARGS = {
    "array": test_array
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
calibrated_stacking Ran
ran on a synthesized input
zjukg/DUET/model/main_utils.py
code served (permissive licence) · get_code("a2b367aa9ac6d4c8")
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, 200) 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)

# Create a minimal opt object with the required attributes
class OptConfig:
    def __init__(self):
        # test_seen_label should be a tensor that can be converted to numpy
        # and its values used as indices into the output tensor
        self.test_seen_label = torch.tensor([0, 2, 4], dtype=torch.long)

opt = OptConfig()

# output: batchsize * 200
# We use batch size 2, and 200 dimensional output (as specified in docstring)
output = torch.randn(2, 200)

# lam: regularization parameter
lam = 0.001

ARGS = {
    'opt': opt,
    'output': output,
    'lam': lam
}
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 Tensor, ndim 2, dtype family float, shape (2, 200) — shape (2, 200) 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
compute_sim Ran
ran on a synthesized input
zjukg/DUET/model/util.py
code served (permissive licence) · get_code("cad018a9a75d5d4b")
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 numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small feature vectors for images and texts
# The function expects now_image, now_text, tmp_imgs, tmp_texts to be lists/arrays
# where indexing with [0] gives a vector that can be passed to cosine_similarity

# Create current image and text features (single samples)
now_image = [np.array([0.1, 0.2, 0.3, 0.4], dtype=np.float32)]
now_text = [np.array([0.5, 0.6, 0.7, 0.8], dtype=np.float32)]

# Create temporary image and text features (multiple samples)
# The function iterates through these with indices
tmp_imgs = [
    np.array([0.15, 0.25, 0.35, 0.45], dtype=np.float32),
    np.array([0.2, 0.3, 0.4, 0.5], dtype=np.float32),
    np.array([0.12, 0.22, 0.32, 0.42], dtype=np.float32),
]

tmp_texts = [
    np.array([0.55, 0.65, 0.75, 0.85], dtype=np.float32),
    np.array([0.51, 0.61, 0.71, 0.81], dtype=np.float32),
    np.array([0.52, 0.62, 0.72, 0.82], dtype=np.float32),
]

# Wrap in lists to match the indexing pattern [0] in the function
tmp_imgs = [[img] for img in tmp_imgs]
tmp_texts = [[txt] for txt in tmp_texts]

ARGS = {
    "now_image": now_image,
    "now_text": now_text,
    "tmp_imgs": tmp_imgs,
    "tmp_texts": tmp_texts,
    "beta": 0.3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 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
cosine_similarity Ran
ran on a synthesized input
zjukg/DUET/model/util.py
code served (permissive licence) · get_code("783a0907b8c9734d")
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 two sample vectors of the same length
x = np.array([1.0, 2.0, 3.0, 4.0])
y = np.array([2.0, 4.0, 6.0, 8.0])

ARGS = {
    'x': x,
    'y': y,
    'norm': False
}
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
map_label Ran
ran on a synthesized input
zjukg/DUET/model/visual_utils.py
code served (permissive licence) · get_code("a8962fd16b659954")
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 1, dtype family int, shape (5,) 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)

# Analyzing the function:
# - label: a tensor that will be compared with classes[i] and indexed
# - classes: a tensor with a .size(0) method, elements that can be compared with label

# Create a small label tensor with values that match some class indices
label = torch.tensor([0, 1, 0, 2, 1])

# Create a classes tensor with distinct values
classes = torch.tensor([0, 1, 2])

ARGS = {
    "label": label,
    "classes": classes,
}
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 1, dtype family int, shape (5,) — shape (5,) 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
randomMask Ran
ran on a synthesized input
zjukg/DUET/model/util.py
code served (permissive licence) · get_code("4f51d40e5e4d5244")
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
from unittest.mock import Mock

torch.manual_seed(0)

class SimpleTokenizer:
    def tokenize(self, text):
        # Return a list of tokens including special tokens
        return ['[SEP]'] + text.split() + ['[CLS]']
    
    def convert_tokens_to_string(self, tokens):
        # Join tokens with spaces
        return ' '.join(tokens)

# Create a simple tokenizer instance
tokenizer = SimpleTokenizer()

# Create sample text and mask
now_text = "has color red"
# Mask array where 2 indicates positions to consider, 0 indicates end
now_mask = [2, 2, 2, 0, 0]

ARGS = {
    "now_text": now_text,
    "now_mask": now_mask,
    "tokenizer": tokenizer
}
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
sort_acc Ran
ran on a synthesized input
zjukg/DUET/model/visual_utils.py
code served (permissive licence) · get_code("e9f8277102262110")
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 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)

# Analyzing the function:
# - acc: used with len(acc), indexed by acc[k], and .sort() called on it
#   This should be a list of numeric values
# - name: used with len(name), indexed by name[sorted_index[i]]
#   This should be a list of strings or identifiers

# Create test data
acc = [0.95, 0.87, 0.92, 0.79]
name = ["model_a", "model_b", "model_c", "model_d"]

ARGS = {
    "acc": acc,
    "name": name
}
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 tuple, ndim 2, 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
load_tf_weights_in_bert Not yet run
unverified (harvested, no recorded run)
zjukg/DUET/model/swin_modeling_bert.py
code served (permissive licence) · get_code("4db905959447729d")
How it ran

no invocation recorded.

load_tf_weights_in_lxmert Not yet run
unverified (harvested, no recorded run)
zjukg/DUET/model/modeling_lxmert.py
code served (permissive licence) · get_code("0dc3270313a8304e")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

FunctionAlso present inEarliest-datedOthers named
load_tf_weights_in_bert 14 other papers
5 dated earlier, 1 the same month, 7 later, 1 same year, order not determinable
2112.02505 (2021-12)
Causal Distillation for Language Models
2022.findings-emnlp.24 (2022 (year only))
AssistSR: Task-oriented Video Segment Retrieval for Personal AI Assistant
2206.07699 (2022-06)
Write and Paint: Generative Vision-Language Models are Unified Modal Learners
and 11 more not named here

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

Large-scale vision-language pre-training has achieved significant performance in multi-modal understanding and generation tasks. However, existing methods often perform poorly on image-text matching tasks that require structured representations, i.e., representations of objects, attributes, and relations. As illustrated in Fig.~reffig:case (a), the models cannot make a distinction between ``An astronaut rides a horse" and ``A horse rides an astronaut". This is because they fail to fully leverage structured knowledge when learning representations in multi-modal scenarios. In this paper, we present an end-to-end framework Structure-CLIP, which integrates Scene Graph Knowledge (SGK) to enhance multi-modal structured representations. Firstly, we use scene graphs to guide the construction of semantic negative examples, which results in an increased emphasis on learning structured representations. Moreover, a Knowledge-Enhance Encoder (KEE) is proposed to leverage SGK as input to further enhance structured representations. To verify the effectiveness of the proposed framework, we pre-train our model with the aforementioned approaches and conduct experiments on downstream tasks. Experimental results demonstrate that Structure-CLIP achieves state-of-the-art (SOTA) performance on VG-Attribution and VG-Relation datasets, with 12.5% and 4.1% ahead of the multi-modal SOTA model respectively. Meanwhile, the results on MSCOCO indicate that Structure-CLIP significantly enhances the structured representations while maintaining the ability of general representations. Our code is available at https://github.com/zjukg/Structure-CLIP.

For agents

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

get_harvested_code_for_paper("2305.06152")
get_code_for_paper("2305.06152")
have("2305.06152")

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

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

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

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

Connect an agent — have() is free.