SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.02437 · CVPR · 2023

ConZIC: Controllable Zero-shot Image Captioning by Sampling-Based Polishing

Hao Zhang, Bo Chen, Dongsheng Wang, Zhengjue Wang, Ruiying Lu, Zequn Zeng

arXiv · PDF · Open in the Atlas

Code that ran

3 of 10 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; 2 failures of our instrument; 7 no recorded run), measured 2026-11-21; 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.02437.json · badge: /api/ran/2303.02437.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
joeyz0z/ConZIC community
Papers with Code archive
3 ran · 7 no recorded run
FunctionStatusWhere it lives
generate_caption_step Ran
ran; our contract draft was wrong, not the code
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("7a2fccd6d2912eba")
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 3, 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.functional as F

torch.manual_seed(0)

# Parameters:
# - out: torch.Tensor of shape (batch_size, seq_len, vocab_size)
# - gen_idx: int, index into seq_len dimension
# - mask: tensor used in element-wise multiplication with probs
# - temperature: optional float for scaling logits
# - top_k: int, number of top elements to select

batch_size = 2
seq_len = 5
vocab_size = 4

# Create output tensor of logits
out = torch.randn(batch_size, seq_len, vocab_size)

# gen_idx should be a valid index into seq_len dimension
gen_idx = 2

# mask should be broadcastable with probs (batch_size, vocab_size)
# After softmax, probs has shape (batch_size, vocab_size)
mask = torch.ones(batch_size, vocab_size)

# temperature is optional, can be None or a float
temperature = 0.8

# top_k should be > 0 to actually select from top k
top_k = 3

ARGS = {
    "out": out,
    "gen_idx": gen_idx,
    "mask": mask,
    "temperature": temperature,
    "top_k": top_k,
}
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 3, 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
get_init_text Ran
ran, honoured the contract we drafted
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("580f8666594fcbf4")
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 2, 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

class SimpleTokenizer:
    """Minimal tokenizer stand-in with encode and mask_token"""
    def __init__(self):
        self.mask_token = "[MASK]"
    
    def encode(self, text):
        """Simple encoding: split text and return list of token ids"""
        tokens = text.split()
        # Return a list of integers representing token ids
        return list(range(len(tokens)))

# Create a simple tokenizer instance
tokenizer = SimpleTokenizer()

# Define parameters
seed_text = "hello world"
max_len = 5
batch_size = 2

ARGS = {
    "tokenizer": tokenizer,
    "seed_text": seed_text,
    "max_len": max_len,
    "batch_size": batch_size
}
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 2, 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
update_token_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("4a41705616e3bbca")
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, 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

# Create a mock tokenizer with a vocab dict
class MockTokenizer:
    def __init__(self):
        self.vocab = {
            '.': 0,
            'a': 1,
            'b': 2,
            'c': 3
        }

torch.manual_seed(0)

# Create arguments
tokenizer = MockTokenizer()
token_mask = torch.zeros(2, 4)  # batch_size=2, vocab_size=4
max_len = 5
index = 3

ARGS = {
    'tokenizer': tokenizer,
    'token_mask': token_mask,
    'max_len': max_len,
    'index': 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 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
POS_sequential_generation Not yet run
unverified (harvested, no recorded run)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("932b4e2e1d9ac06e")
How it ran

no invocation recorded.

batch_texts_POS_Sentiments_analysis Not yet run
unverified (harvested, no recorded run)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("9e4e742ec3ee5af1")
How it ran

no invocation recorded.

batch_texts_POS_analysis Not yet run
unverified (harvested, no recorded run)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("ea029a9ae14463cd")
How it ran

no invocation recorded.

control_generate_caption Not yet run
unverified (harvested, no recorded run)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("87c4eb6e2eb39819")
How it ran

no invocation recorded.

sentiment_sequential_generation Not yet run
unverified (harvested, no recorded run)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("545b48c4df087bad")
How it ran

no invocation recorded.

sentiment_shuffle_generation Not yet run
unverified (harvested, no recorded run)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("974e0fd37be015e7")
How it ran

no invocation recorded.

text_POS_Sentiments_analysis Not yet run
unverified (harvested, no recorded run)
joeyz0z/ConZIC/control_gen_utils.py
code served (permissive licence) · get_code("51cd62b886b4d5c2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Zero-shot capability has been considered as a new revolution of deep learning, letting machines work on tasks without curated training data. As a good start and the only existing outcome of zero-shot image captioning (IC), ZeroCap abandons supervised training and sequentially searches every word in the caption using the knowledge of large-scale pre-trained models. Though effective, its autoregressive generation and gradient-directed searching mechanism limit the diversity of captions and inference speed, respectively. Moreover, ZeroCap does not consider the controllability issue of zero-shot IC. To move forward, we propose a framework for Controllable Zero-shot IC, named ConZIC. The core of ConZIC is a novel samplingbased non-autoregressive language model named Gibbs-BERT, which can generate and continuously polish every word. Extensive quantitative and qualitative results demonstrate the superior performance of our proposed ConZIC for both zero-shot IC and controllable zero-shot IC. Especially, ConZIC achieves about 5× faster generation speed than ZeroCap, and about 1.5× higher diversity scores, with accurate generation given different control signals. Our code is available at https://github.com/joeyz0z/ConZIC. * Equal contribution. Generated caption at each iteration 0 th : Image of [mask] [mask] [mask] [mask]…[mask] [mask] [mask] 1 st : Image of a short of eight big fat cat friends. 2 nd : Image of a video painting promoting white walking little cats. 3 rd : Image of a background illustration supporting fat beautiful cats. 4 th : Image of a dream theme depicting a white night cat. 5 th : Image of a landscape theme depicting white young fat cat. 6 th : Image of a fall scene having a white cat with white night cloak. 7 th : Image of a white cat scene accompanying a pink night sky. 8 th : Image of a white cat singing in a pink night scene. 9 th : Image of a white cat talking in a fantasy night landscape with a boat. 10 th : Image of a white cat talking at a fantasy night scene on a boat.

For agents

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

get_harvested_code_for_paper("2303.02437")
get_code_for_paper("2303.02437")
have("2303.02437")

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

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

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

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

Connect an agent — have() is free.