SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.15111 · CVPR · 2023

Learning Attention as Disentangler for Compositional Zero-shot Learning

Kai Han, Kwan-Yee Wong, Shaozhe Hao

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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 3 have no contract verdict; 5 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2303.15111.json · badge: /api/ran/2303.15111.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
haoosz/ade-czsl canonical (classifier label)
classifier basis not recorded on the link
8 ran · 3 no recorded run
FunctionStatusWhere it lives
calculate_margines Ran
ran; our contract draft was wrong, not the code
haoosz/ade-czsl/models/common.py
code served (permissive licence) · get_code("e1f2aca5ffc5a9b3")
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, 3) 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)

# domain_embedding: pairs * feats
# gt: batch * feats
# The function expects:
# - domain_embedding: shape (pairs, features)
# - gt: shape (batch, features)

batch_size = 2
pairs = 3
features = 4

domain_embedding = torch.randn(pairs, features)
gt = torch.randn(batch_size, features)
margin_range = 5

ARGS = {
    "domain_embedding": domain_embedding,
    "gt": gt,
    "margin_range": margin_range
}
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, 3) — shape (2, 3) 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_cosine_similarity Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
haoosz/ade-czsl/models/ade.py
pointer only (licence: MIT); the stored copy get_code serves, from xduxyli/scen-master, is pointer only (licence: NONE) · get_code("7388b930197b0c81")
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 xduxyli/scen-master, and GitHub detected no licence in that repository when it was checked. 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.

cos_logits Ran
ran on a synthesized input
haoosz/ade-czsl/visual_concept_retrieval.py
code served (permissive licence) · get_code("7f600db4d6fef4ee")
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, 3) 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 torch.nn.functional as F

torch.manual_seed(0)

# emb: embedding tensor that will be normalized and multiplied
# Should be shape (batch_size, embedding_dim)
emb = torch.randn(2, 4)

# proto: prototype tensor that will be normalized and transposed
# Should be shape (num_prototypes, embedding_dim)
proto = torch.randn(3, 4)

ARGS = {
    "emb": emb,
    "proto": proto,
}
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, 3) — shape (2, 3) 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
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
haoosz/ade-czsl/models/multi_head_attention.py
pointer only (licence: MIT); the stored copy get_code serves, from gladzhang/Xformer, is pointer only (licence: NONE) · get_code("55120f2026b56aa2")
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 gladzhang/Xformer, and GitHub detected no licence in that repository when it was checked. 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.

emd_inference_opencv Ran
ran on a synthesized input
haoosz/ade-czsl/models/emd_utils.py
code served (permissive licence) · get_code("829d4aa345489492")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F
import numpy as np

torch.manual_seed(0)

# Create small tensors for the function
# cost_matrix should be a 2D tensor (comparing two sets of points)
cost_matrix = torch.randn(3, 4)

# weight1 and weight2 should be 1D tensors that represent weights/masses
# They need to have the same length as the dimensions they correspond to in cost_matrix
weight1 = torch.randn(3)
weight2 = torch.randn(4)

ARGS = {
    "cost_matrix": cost_matrix,
    "weight1": weight1,
    "weight2": weight2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
emd_inference_opencv_test Ran
ran on a synthesized input
haoosz/ade-czsl/models/emd_utils.py
code served (permissive licence) · get_code("4d2e05bc40a813cc")
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. 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 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.functional as F

torch.manual_seed(0)

# distance_matrix: shape (batch_size, n, m) where n and m are point set sizes
# weight1: shape (batch_size, n) - weights for first point set
# weight2: shape (batch_size, m) - weights for second point set

batch_size = 2
n_points_1 = 3
n_points_2 = 4

# Create cost/distance matrices for each sample in batch
distance_matrix = torch.randn(batch_size, n_points_1, n_points_2, dtype=torch.float32)

# Create weight tensors with positive values
weight1 = torch.rand(batch_size, n_points_1, dtype=torch.float32) + 0.1
weight2 = torch.rand(batch_size, n_points_2, dtype=torch.float32) + 0.1

ARGS = {
    "distance_matrix": distance_matrix,
    "weight1": weight1,
    "weight2": weight2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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
same_domain_triplet_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
haoosz/ade-czsl/models/common.py
code served (permissive licence) · get_code("59725ffc3ce58459")
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. 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)

device = 'cpu'

# Tiny tensors with distinct dimensions for clarity
batch_size = 2
feature_dim = 4
num_pairs = 3

# image_embedding: Tensor of shape (batch_size, feature_dim)
image_embedding = torch.randn(batch_size, feature_dim)

# trip_images: Tensor of shape (batch_size, num_pairs, feature_dim)
trip_images = torch.randn(batch_size, num_pairs, feature_dim)

# gt: Tensor of shape (batch_size,) with values in range [0, num_pairs)
gt = torch.tensor([0, 2], dtype=torch.long)

# hard_k: optional parameter for top-k selection
hard_k = 2

# margin: hyperparameter for triplet loss
margin = 2

ARGS = {
    'image_embedding': image_embedding,
    'trip_images': trip_images,
    'gt': gt,
    'hard_k': hard_k,
    'margin': margin
}
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
trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
haoosz/ade-czsl/models/vision_transformer.py
code served (permissive licence) · get_code("915b71e73a54fc97")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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. 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 math

torch.manual_seed(0)

# Create a small tensor to be modified by trunc_normal_
tensor = torch.empty(2, 4)

# Define parameters for truncated normal initialization
mean = 0.0
std = 1.0
a = -2.0
b = 2.0

ARGS = {
    'tensor': tensor,
    'mean': mean,
    'std': std,
    'a': a,
    'b': b
}
Setup block drafted by
a language model, Claude Sonnet 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 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
get_image_extractor Not yet run
unverified (harvested, no recorded run)
haoosz/ade-czsl/models/image_extractor.py
code served (permissive licence) · get_code("7dacb21751b86b46")
How it ran

no invocation recorded.

l2_all_batched Not yet run
unverified (harvested, no recorded run)
haoosz/ade-czsl/models/common.py
code served (permissive licence) · get_code("2a1c66c4d01008db")
How it ran

no invocation recorded.

vit_tiny Not yet run
unverified (harvested, no recorded run)
haoosz/ade-czsl/models/vision_transformer.py
code served (permissive licence) · get_code("f7bba5d7d89fc9dc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 9 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 6 later) and 2 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
drop_path 224 other papers
75 dated earlier, 10 the same month, 132 later, 6 same year, order not determinable, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
trunc_normal_ 160 other papers
48 dated earlier, 7 the same month, 103 later, 2 same year, order not determinable · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
vit_tiny 33 other papers
9 dated earlier, 1 the same month, 21 later, 1 same year, order not determinable, 1 undated
2201.02609 (2022-01)
Generalized Category Discovery
2202.11929 (2022-02)
Word Segmentation on Discovered Phone Units with Dynamic Programming and Self-Supervised Scoring
2203.08414 (2022-03)
Unsupervised Semantic Segmentation by Distilling Feature Correspondences
and 30 more not named here
calculate_margines 2 other papers
2 later
2312.04076 (2023-12)
Large Language Models are Good Prompt Learners for Low-Shot Image Classification
Zheng_Large_Language_Models_are_Good_Prompt_Learners_for_Low-Shot_Image_CVPR_2024_paper (2024 (year only))
Large Language Models are Good Prompt Learners for Low-Shot Image Classification
l2_all_batched 2 other papers
2 later
2312.04076 (2023-12)
Large Language Models are Good Prompt Learners for Low-Shot Image Classification
Zheng_Large_Language_Models_are_Good_Prompt_Learners_for_Low-Shot_Image_CVPR_2024_paper (2024 (year only))
Large Language Models are Good Prompt Learners for Low-Shot Image Classification
same_domain_triplet_loss 2 other papers
2 later
2312.04076 (2023-12)
Large Language Models are Good Prompt Learners for Low-Shot Image Classification
Zheng_Large_Language_Models_are_Good_Prompt_Learners_for_Low-Shot_Image_CVPR_2024_paper (2024 (year only))
Large Language Models are Good Prompt Learners for Low-Shot Image Classification
compute_cosine_similarity 1 other paper
1 dated earlier
2206.14475 (2022-06)
Siamese Contrastive Embedding Network for Compositional Zero-Shot Learning
emd_inference_opencv 1 other paper
1 dated earlier
2003.06777 (2020-03)
DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning
emd_inference_opencv_test 1 other paper
1 dated earlier
2003.06777 (2020-03)
DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning

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

Compositional zero-shot learning (CZSL) aims at learning visual concepts (i.e., attributes and objects) from seen compositions and combining concept knowledge into unseen compositions. The key to CZSL is learning the disentanglement of the attribute-object composition. To this end, we propose to exploit cross-attentions as compositional disentanglers to learn disentangled concept embeddings. For example, if we want to recognize an unseen composition "yellow flower", we can learn the attribute concept "yellow" and object concept "flower" from different yellow objects and different flowers respectively. To further constrain the disentanglers to learn the concept of interest, we employ a regularization at the attention level. Specifically, we adapt the earth mover's distance (EMD) as a feature similarity metric in the cross-attention module. Moreover, benefiting from concept disentanglement, we improve the inference process and tune the prediction score by combining multiple concept probabilities. Comprehensive experiments on three CZSL benchmark datasets demonstrate that our method significantly outperforms previous works in both closed-and openworld settings, establishing a new state-of-the-art. Project

For agents

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

get_harvested_code_for_paper("2303.15111")
get_code_for_paper("2303.15111")
have("2303.15111")

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

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

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

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

Connect an agent — have() is free.