SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.18010 · ICLR · 2024

Test-Time Adaptation with CLIP Reward for Zero-Shot Generalization in Vision-Language Models

Yi Yang, Xiaohan Wang, Shuai Zhao, ¶ Linchao

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 4 failures of our instrument; 5 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.18010.json · badge: /api/ran/2305.18010.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
mzhaoshuai/RLCF canonical (classifier label)
classifier basis: census
5 ran · 4 no recorded run
mzhaoshuai/rlcf community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
avg_entropy Ran
ran; our contract draft was wrong, not the code
mzhaoshuai/RLCF/TPT/tpt_cls.py
code served (permissive licence) · get_code("441ae80dd4f616f3")
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 Tensor, ndim 0, dtype family float, shape () 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)

# The function takes 'outputs' as a parameter
# outputs should be a tensor that supports:
# - subtraction and logsumexp operations
# - shape[0] access
# - dtype access via finfo
# - clamp and exp operations

# Create a small tensor with shape (batch_size=2, num_classes=4)
outputs = torch.randn(2, 4)

ARGS = {
    "outputs": outputs
}
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 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
avg_entropy Ran
ran; our contract draft was wrong, not the code
mzhaoshuai/RLCF/TPT/tpt_cls_rl.py
code served (permissive licence) · get_code("81d4b057b05c4ac1")
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. 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)

# The function takes 'outputs' which should be a tensor
# It performs operations: logsumexp, shape indexing, dtype checking, clamp, exp, sum
# outputs should be a 2D tensor (batch_size, num_classes) based on usage

outputs = torch.randn(2, 4)  # batch_size=2, num_classes=4

ARGS = {
    "outputs": outputs
}
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 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
extract_all_images Ran
ran, honoured the contract we drafted
mzhaoshuai/RLCF/clipscore/clipscore.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from leezekun/mmsci, is pointer only (licence: NONE) · get_code("d14ec1d960b2878e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from leezekun/mmsci, 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.

select_confident_samples Ran
ran; our contract draft was wrong, not the code
mzhaoshuai/RLCF/TPT/tpt_cls.py
code served (permissive licence) · get_code("3ce4d11e58de02ad")
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. 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)

# Create a small batch of logits
# batch_size=2, num_classes=4
logits = torch.randn(2, 4)

# top parameter: fraction of samples to select (0.0 to 1.0)
top = 0.5

ARGS = {
    "logits": logits,
    "top": top,
}
Setup block drafted by
a language model, Claude Haiku 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 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
select_confident_samples Ran
ran; our contract draft was wrong, not the code
mzhaoshuai/RLCF/TPT/tpt_cls_rl.py
code served (permissive licence) · get_code("03602a2e9952cb27")
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)

# Create a small batch of logits
# Shape: (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# Create the top parameter as a float between 0 and 1
# This represents the fraction of confident samples to select
top = 0.5

ARGS = {
    "logits": logits,
    "top": top,
}
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
build_model Not yet run
unverified (harvested, no recorded run)
mzhaoshuai/RLCF/TPT/clip/model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from GIT-LJc/LogitGap, is pointer only (licence: NONE) · get_code("aa56b568a90f8516")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from GIT-LJc/LogitGap, 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. No invocation recorded.

get_args Not yet run
unverified (harvested, no recorded run)
mzhaoshuai/RLCF/TPT/params.py
code served (permissive licence) · get_code("6a0c8049db0c43ed")
How it ran

no invocation recorded.

none_or_str Not yet run
unverified (harvested, no recorded run)
mzhaoshuai/RLCF/TPT/params.py
code served (permissive licence) · get_code("2fc6fdb85f13dc41")
How it ran

no invocation recorded.

test_time_tuning Not yet run
unverified (harvested, no recorded run)
mzhaoshuai/rlcf/TPT/tpt_cls_rl.py
code served (permissive licence) · get_code("5a1f70712c09b44b")
How it ran

no invocation recorded.

test_time_tuning Not yet run
unverified (harvested, no recorded run)
mzhaoshuai/RLCF/TPT/tpt_cls.py
code served (permissive licence) · get_code("2322616e6a60f9c6")
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 8 distinct functions with an identity, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 5 later) and 3 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
none_or_str 16 other papers
3 dated earlier, 1 the same month, 12 later
1810.01845 (2018-10)
Task-Oriented Hand Motion Retargeting for Dexterous Manipulation Imitation
1909.10893 (2019-09)
Recurrent Independent Mechanisms
2109.11251 (2021-09)
Trust Region Policy Optimisation in Multi-Agent Reinforcement Learning
and 13 more not named here
build_model 9 other papers
9 later
2311.15243 (2023-11)
ID-like Prompt Learning for Few-Shot Out-of-Distribution Detection
2401.15657 (2024-01)
Data-Free Generalized Zero-Shot Learning
2403.12952 (2024-03)
Just Shift It: Test-Time Prototype Shifting for Zero-Shot Generalization with Vision-Language Models
and 6 more not named here
select_confident_samples
brick of this paper's assembly: sampler
8 other papers
2 dated earlier, 6 later · 1 only as an assembly brick
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2209.07511 (2022-09)
Test-Time Prompt Tuning for Zero-Shot Generalization in Vision-Language Models
2401.15657 (2024-01)
Data-Free Generalized Zero-Shot Learning
and 5 more not named here
avg_entropy
brick of this paper's assembly: metric
7 other papers
2 dated earlier, 5 later · 2 only as an assembly brick
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2209.07511 (2022-09)
Test-Time Prompt Tuning for Zero-Shot Generalization in Vision-Language Models
2401.15657 (2024-01)
Data-Free Generalized Zero-Shot Learning
and 4 more not named here
extract_all_images 4 other papers
4 later
2306.09607 (2023-06)
Listener Model for the PhotoBook Referential Game with CLIPScores as Implicit Reference Chain
2407.04903 (2024-07)
MMSci: A Dataset for Graduate-Level Multi-Discipline Multimodal Scientific Understanding
2411.00390 (2024-11)
MetaMetrics-MT: Tuning Meta-Metrics for Machine Translation via Human Preference Calibration
and 1 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

One fascinating aspect of pre-trained vision-language models (VLMs) learning under language supervision is their impressive zero-shot generalization capability. However, this ability is hindered by distribution shifts between the training and testing data. Previous test time adaptation (TTA) methods for VLMs in zeroshot classification rely on minimizing the entropy of model outputs, tending to be stuck in incorrect model predictions. In this work, we propose TTA with feedback to rectify the model output and prevent the model from becoming blindly confident. Specifically, a CLIP model is adopted as the reward model during TTA and provides feedback for the VLM. Given a single test sample, the VLM is forced to maximize the CLIP reward between the input and sampled results from the VLM output distribution. The proposed reinforcement learning with CLIP feedback (RLCF) framework is highly flexible and universal. Beyond the classification task, with task-specific sampling strategies and a proper reward baseline choice, RLCF can be easily extended to not only discrimination tasks like retrieval but also generalization tasks like image captioning, improving the zero-shot generalization capacity of VLMs. According to the characteristics of these VL tasks, we build different fully TTA pipelines with RLCF to improve the zero-shot generalization ability of various VLMs. Extensive experiments along with promising empirical results demonstrate the effectiveness of RLCF. The code is available at https://github.com/mzhaoshuai/RLCF.

For agents

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

get_harvested_code_for_paper("2305.18010")
get_code_for_paper("2305.18010")
have("2305.18010")

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

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

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

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

Connect an agent — have() is free.