SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.14371 · 2024

SelEx: Self-Expertise in Fine-Grained Generalized Category Discovery

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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 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/2408.14371.json · badge: /api/ran/2408.14371.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
sarahrastegar/selex canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
cluster_acc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sarahrastegar/selex/project_utils/cluster_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from HaiyangZheng/PHE, is pointer only (licence: NONE) · get_code("569a0b5d2369b072")
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 HaiyangZheng/PHE, 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.

drop_add_residual_stochastic_depth Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sarahrastegar/selex/models/vision_transformer2.py
code served (permissive licence) · get_code("167e169f064431a0")
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 3, dtype family float, shape (2, 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
import torch.nn as nn

torch.manual_seed(0)

class SimpleResidualFunc(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Create a simple residual function
residual_func = SimpleResidualFunc()

# Create input tensor: (batch_size=2, sequence_length=3, embedding_dim=4)
x = torch.randn(2, 3, 4)

# Define arguments
ARGS = {
    "x": x,
    "residual_func": residual_func,
    "sample_drop_ratio": 0.5,
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 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
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sarahrastegar/selex/models/vision_transformer.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.

evaluate_clustering Ran
ran; our contract draft was wrong, not the code
sarahrastegar/selex/project_utils/cluster_utils.py
code served (permissive licence) · get_code("15d2b95b53f6db9a")
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

np.random.seed(0)

# Create small synthetic clustering data
n_samples = 50

# y_true: ground truth labels (0, 1, 2)
y_true = np.array([0] * 17 + [1] * 16 + [2] * 17, dtype=int)

# y_pred: predicted labels with some clustering assignments
y_pred = np.array([0] * 16 + [1] * 17 + [2] * 17, dtype=int)

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — 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
make_2tuple Ran
ran, honoured the contract we drafted
sarahrastegar/selex/models/vision_transformer2.py
code served (permissive licence) · get_code("3c04490a215299f2")
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 tuple, 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 numpy as np

torch.manual_seed(0)

# Test case 1: tuple input with length 2
test_tuple = (5, 7)

# Test case 2: integer input
test_int = 3

# We'll create ARGS with the integer case
ARGS = {
    "x": test_int
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
named_apply Ran
ran; our contract draft was wrong, not the code
sarahrastegar/selex/models/vision_transformer2.py
code served (permissive licence) · get_code("e9858e26f4c51e98")
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 SimpleModel. 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 typing import Callable

torch.manual_seed(0)

# Define a simple callback function that will be applied to modules
def apply_fn(module: nn.Module, name: str):
    """Simple function that gets applied to each module"""
    pass

# Build a small nested nn.Module to traverse
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.nested = nn.Sequential(
            nn.Linear(2, 5),
            nn.ReLU()
        )
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        x = self.nested(x)
        return x

module = SimpleModel()

ARGS = {
    'fn': apply_fn,
    'module': module,
    'name': '',
    'depth_first': True,
    'include_root': 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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
pairwise_distance Ran
ran; our contract draft was wrong, not the code
sarahrastegar/selex/methods/clustering/faster_mix_k_means_pytorch.py
code served (permissive licence) · get_code("980dd2e8fa24f9da")
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 (4, 2) 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 pairwise distance computation
# data1: N1 x M matrix (4 points, 3 dimensions)
# data2: N2 x M matrix (2 points, 3 dimensions)
data1 = torch.randn(4, 3)
data2 = torch.randn(2, 3)

ARGS = {
    "data1": data1,
    "data2": data2,
    "batch_size": None,
}
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 (4, 2) — shape (4, 2) 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
purity_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sarahrastegar/selex/project_utils/cluster_utils.py
code served (permissive licence) · get_code("1645ca2fb55ce1f8")
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
from sklearn import metrics

# purity_score computes clustering purity by:
# 1. Creating a contingency matrix from y_true and y_pred
# 2. Finding the max value in each column (axis=0)
# 3. Summing those maxes and dividing by total sum
#
# Parameters:
# - y_true: ground truth labels (array-like)
# - y_pred: predicted cluster labels (array-like)

# Create small example data
np.random.seed(0)

# Ground truth labels: 10 samples, 3 true classes
y_true = np.array([0, 0, 0, 0, 1, 1, 1, 2, 2, 2])

# Predicted clusters: 10 samples, 4 predicted clusters
y_pred = np.array([0, 0, 1, 1, 1, 2, 2, 2, 3, 3])

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
info_nce_logits Not yet run
unverified (harvested, no recorded run)
sarahrastegar/selex/methods/contrastive_training/contrastive_training.py
code served (permissive licence) · get_code("40f5a2f8b0143f94")
How it ran

no invocation recorded.

vit_small Not yet run
unverified (harvested, no recorded run)
sarahrastegar/selex/models/vision_transformer.py
code served (permissive licence) · get_code("995a10f898196998")
How it ran

no invocation recorded.

vit_tiny Not yet run
unverified (harvested, no recorded run)
sarahrastegar/selex/models/vision_transformer.py
code served (permissive licence) · get_code("996780ba4be89ba3")
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, 11 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 3 the same month, 9 later) and 0 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
177 dated earlier, 2 the same month, 37 later, 7 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
vit_tiny 33 other papers
24 dated earlier, 8 later, 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
named_apply 26 other papers
12 dated earlier, 12 later, 2 undated
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2204.07683 (2022-04)
Safe Self-Refinement for Transformer-based Domain Adaptation
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
and 23 more not named here
vit_small 22 other papers
17 dated earlier, 4 later, 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 19 more not named here
drop_add_residual_stochastic_depth 21 other papers
11 dated earlier, 1 the same month, 7 later, 2 undated
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2312.02366 (2023-12)
Evaluating General Purpose Vision Foundation Models for Medical Image Analysis: An Experimental Study of DINOv2 on Radiology Benchmarks
and 18 more not named here
make_2tuple 20 other papers
10 dated earlier, 1 the same month, 8 later, 1 undated · 1 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2312.02366 (2023-12)
Evaluating General Purpose Vision Foundation Models for Medical Image Analysis: An Experimental Study of DINOv2 on Radiology Benchmarks
and 17 more not named here
cluster_acc 7 other papers
5 dated earlier, 2 later
2201.02609 (2022-01)
Generalized Category Discovery
2305.06144 (2023-05)
Learning Semi-supervised Gaussian Mixture Models for Generalized Category Discovery
and 4 more not named here
pairwise_distance 7 other papers
4 dated earlier, 1 later, 1 same year, order not determinable, 1 undated
2201.02609 (2022-01)
Generalized Category Discovery
2212.05590 (2022-12)
PromptCAL: Contrastive Affinity Learning via Auxiliary Prompts for Generalized Novel Category Discovery
2308.11063 (2023-08)
MetaGCD: Learning to Continually Learn in Generalized Category Discovery
and 4 more not named here
purity_score 7 other papers
6 dated earlier, 1 later
2201.02609 (2022-01)
Generalized Category Discovery
2305.06144 (2023-05)
Learning Semi-supervised Gaussian Mixture Models for Generalized Category Discovery
and 4 more not named here
evaluate_clustering 5 other papers
5 dated earlier
2201.02609 (2022-01)
Generalized Category Discovery
2305.06144 (2023-05)
Learning Semi-supervised Gaussian Mixture Models for Generalized Category Discovery
and 2 more not named here
info_nce_logits 1 other paper
1 undated
no dated paper among those named
openreview_YA3AvVx2Ze
CoGe-GCD: Reframing Generalized Category Discovery with Compositional Generalization

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

In this paper, we address Generalized Category Discovery, aiming to simultaneously uncover novel categories and accurately classify known ones. Traditional methods, which lean heavily on self-supervision and contrastive learning, often fall short when distinguishing between fine-grained categories. To address this, we introduce a novel concept called `self-expertise', which enhances the model's ability to recognize subtle differences and uncover unknown categories. Our approach combines unsupervised and supervised self-expertise strategies to refine the model's discernment and generalization. Initially, hierarchical pseudo-labeling is used to provide `soft supervision', improving the effectiveness of self-expertise. Our supervised technique differs from traditional methods by utilizing more abstract positive and negative samples, aiding in the formation of clusters that can generalize to novel categories. Meanwhile, our unsupervised strategy encourages the model to sharpen its category distinctions by considering within-category examples as `hard' negatives. Supported by theoretical insights, our empirical results showcase that our method outperforms existing state-of-the-art techniques in Generalized Category Discovery across several fine-grained datasets. Our code is available at: https://github.com/SarahRastegar/SelEx.

For agents

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

get_harvested_code_for_paper("2408.14371")
get_code_for_paper("2408.14371")
have("2408.14371")

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

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

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

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

Connect an agent — have() is free.