SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.02551 · ICML · 2023

CHiLS: Zero-Shot Image Classification with Hierarchical Label Sets

Saurabh Garg, Zachary Lipton, Julian Mcauley, Zachary Novack

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 6 have no contract verdict; 2 failures of our instrument; 3 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/2302.02551.json · badge: /api/ran/2302.02551.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
acmi-lab/chils canonical (classifier label)
classifier basis not recorded on the link
8 ran · 3 no recorded run
FunctionStatusWhere it lives
dataset_with_indices Ran
ran; our contract draft was wrong, not the code
acmi-lab/chils/src/zshot_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from SoftWiser-group/NeSy-without-Shortcuts, is pointer only (licence: NONE) · get_code("2129574ed34dcb74")
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 SoftWiser-group/NeSy-without-Shortcuts, 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.

dataset_with_indices Ran
ran; our contract draft was wrong, not the code
acmi-lab/chils/src/data_utils.py
code served (permissive licence) · get_code("5b57ee54bdf0b7a5")
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 type. 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.utils.data as data

torch.manual_seed(0)

# Create a minimal Dataset subclass to pass to dataset_with_indices
class MinimalDataset(data.Dataset):
    def __init__(self):
        self.data = [torch.randn(4) for _ in range(2)]
        self.targets = [0, 1]
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, index):
        return (self.data[index], self.targets[index])

# Create an instance of the dataset class to pass
dataset_cls = MinimalDataset

ARGS = {
    'cls': dataset_cls
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
get_CLIP_inputs_from_dict Ran
ran on a synthesized input
acmi-lab/chils/src/zshot_utils.py
code served (permissive licence) · get_code("234ae9cbbfa4fe06")
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

torch.manual_seed(0)

# Construct cl_set_dict: a dict mapping class names to lists of subclass words
cl_set_dict = {
    "animal": ["dog", "cat", "bird"],
    "vehicle": ["car", "truck"],
    "furniture": ["chair", "table", "desk"]
}

# Construct ord_class: an ordered list of classnames that must match the keys in cl_set_dict
ord_class = ["animal", "vehicle", "furniture"]

ARGS = {
    "cl_set_dict": cl_set_dict,
    "ord_class": ord_class
}
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 — 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
get_class_name Ran
ran on a synthesized input
acmi-lab/chils/src/utils.py
code served (permissive licence) · get_code("1cca8cd1fc9f507f")
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 str. 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
import importlib

# Create a minimal class with a 'name' attribute in a valid module
class DummyModel(nn.Module):
    name = "test_model"
    
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)

# We need to construct a valid module.class_string that points to an actual class
# We'll use a built-in torch class that exists and has a 'name' attribute
# Since the function uses cls.name, we need a class with that attribute
# Let's create a workaround by using a class that we can inject into a module

# Create a simple stand-in class with a name attribute
class TestClass:
    name = "my_test_class"

# Since we can't easily mock importlib, let's use a real torch class
# torch.nn.Linear exists and we can access it via importlib
# But it doesn't have a 'name' attribute by default, so let's patch it

import sys
from types import ModuleType

# Create a fake module with our test class
fake_module = ModuleType("fake_module")
fake_module.TestClass = TestClass
sys.modules["fake_module"] = fake_module

# Now we can use this in our ARGS
ARGS = {
    "module_class_string": "fake_module.TestClass",
    "split": "train"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_dict_hash Ran
ran on a synthesized input
acmi-lab/chils/src/utils.py
code served (permissive licence) · get_code("6bdaa18bfcbe2a56")
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 str. 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 yaml
import hashlib

# The function takes a dictionary as input and returns its MD5 hash
# by dumping it to YAML and encoding it.
# We need to provide a valid dictionary.

ARGS = {
    "dictionary": {
        "model_name": "test_model",
        "version": 1,
        "config": {
            "learning_rate": 0.001,
            "batch_size": 32,
            "layers": [64, 128, 256]
        },
        "metadata": {
            "author": "test",
            "date": "2024-01-01"
        }
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
list_files Ran
ran on a synthesized input
acmi-lab/chils/src/simple_utils.py
code served (permissive licence) · get_code("48287a6b9a790584")
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 tempfile
import os

# Create a temporary directory with some test files
temp_dir = tempfile.mkdtemp()

# Create some test files in the directory
test_files = ['file1.txt', 'file2.py', 'file3.md']
for filename in test_files:
    filepath = os.path.join(temp_dir, filename)
    with open(filepath, 'w') as f:
        f.write('test content')

# Also create a subdirectory to ensure it's not included
subdir = os.path.join(temp_dir, 'subdir')
os.makedirs(subdir)

ARGS = {
    'path': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
load_config Ran
ran on a synthesized input
acmi-lab/chils/src/utils.py
code served (permissive licence) · get_code("795a168f1c1503bb")
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 dict. 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 tempfile
import os
import yaml

# Create a temporary YAML config file
temp_dir = tempfile.mkdtemp()
config_file_path = os.path.join(temp_dir, "config.yaml")

# Write a sample config to the temporary file
sample_config = {
    "model": "resnet50",
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10,
    "layers": [64, 128, 256],
    "enable_logging": True
}

with open(config_file_path, 'w') as f:
    yaml.dump(sample_config, f)

ARGS = {
    "config_file": config_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_pickle Ran
ran on a synthesized input
acmi-lab/chils/src/simple_utils.py
code served (permissive licence) · get_code("29353942db28fc10")
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 dict. 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 pickle
import tempfile
import os

# Create a temporary directory and file for testing
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, 'test_data.pkl')

# Create a simple pickle file with some test data
test_data = {'key': 'value', 'number': 42, 'list': [1, 2, 3]}
with open(test_file, 'wb') as f:
    pickle.dump(test_data, f)

# Create locks directory
locks_dir = os.path.join(temp_dir, 'locks')

ARGS = {
    'fname': test_file,
    'lock_dir': locks_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
filelock — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
get_model Not yet run
unverified (harvested, no recorded run)
acmi-lab/chils/src/model_utils.py
code served (permissive licence) · get_code("f72e18409d2e2c29")
How it ran

no invocation recorded.

query_gpt_prompt Not yet run
unverified (harvested, no recorded run)
acmi-lab/chils/models/clip_models.py
code served (permissive licence) · get_code("2dcfaad02e7565df")
How it ran

no invocation recorded.

query_gpt_prompt Not yet run
unverified (harvested, no recorded run)
acmi-lab/chils/src/zshot_utils.py
code served (permissive licence) · get_code("b60aa51289c404bd")
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 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 9 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
dataset_with_indices 2 other papers
2 later
2305.17170 (2023-05)
Error Bounds for Learning with Vector-Valued Random Features
2403.00329 (2024-03)
Learning with Logical Constraints but without Shortcut Satisfaction

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

Open vocabulary models (e.g. CLIP) have shown strong performance on zero-shot classification through their ability generate embeddings for each class based on their (natural language) names. Prior work has focused on improving the accuracy of these models through prompt engineering or by incorporating a small amount of labeled downstream data (via finetuning). However, there has been little focus on improving the richness of the class names themselves, which can pose issues when class labels are coarsely-defined and are uninformative. We propose Classification with Hierarchical Label Sets (or CHiLS), an alternative strategy for zero-shot classification specifically designed for datasets with implicit semantic hierarchies. CHiLS proceeds in three steps: (i) for each class, produce a set of subclasses, using either existing label hierarchies or by querying GPT-3; (ii) perform the standard zero-shot CLIP procedure as though these subclasses were the labels of interest; (iii) map the predicted subclass back to its parent to produce the final prediction. Across numerous datasets with underlying hierarchical structure, CHiLS leads to improved accuracy in situations both with and without ground-truth hierarchical information. CHiLS is simple to implement within existing zero-shot pipelines and requires no additional training cost.

For agents

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

get_harvested_code_for_paper("2302.02551")
get_code_for_paper("2302.02551")
have("2302.02551")

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

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

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

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

Connect an agent — have() is free.