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

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

29 May 2023arXiv:2305.18010archive 2025-07-28

Shuai Zhao, Xiaohan Wang, Linchao Zhu, Yi Yang

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 zero-shot 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 \textit{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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2305.18010")

Code

Syntology Ran 3 of 10 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 1 ran with no contract checked.

By repository: official repository: 10 samples from 1 repository, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

mzhaoshuai/rlcf officialmentioned in paperpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 3 ran; 0 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
1ran
7unverified

Licence: 0 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from mzhaoshuai/RLCF. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

avg_entropy mzhaoshuai/RLCF/TPT/tpt_cls.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 441ae80dd4f616f3 · report
extract_all_images mzhaoshuai/RLCF/clipscore/clipscore.py official repository ran Apache-2.0 (permissive) · d14ec1d960b2878e · report
select_confident_samples mzhaoshuai/RLCF/TPT/tpt_cls.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 3ce4d11e58de02ad · report
avg_entropy mzhaoshuai/RLCF/TPT/tpt_cls_rl.py official repository unverified Apache-2.0 (permissive) · 81d4b057b05c4ac1 · report
build_model mzhaoshuai/RLCF/TPT/clip/model.py official repository unverified Apache-2.0 (permissive) · aa56b568a90f8516 · report
get_args mzhaoshuai/RLCF/TPT/params.py official repository unverified Apache-2.0 (permissive) · 6a0c8049db0c43ed · report
none_or_str mzhaoshuai/RLCF/TPT/params.py official repository unverified Apache-2.0 (permissive) · 2fc6fdb85f13dc41 · report
select_confident_samples mzhaoshuai/RLCF/TPT/tpt_cls_rl.py official repository unverified Apache-2.0 (permissive) · 03602a2e9952cb27 · report
test_time_tuning mzhaoshuai/rlcf/TPT/tpt_cls_rl.py official repository unverified Apache-2.0 (permissive) · 5a1f70712c09b44b · report
test_time_tuning mzhaoshuai/RLCF/TPT/tpt_cls.py official repository unverified Apache-2.0 (permissive) · 2322616e6a60f9c6 · report

Tasks

Image CaptioningImage ClassificationRetrievalTest-time AdaptationText RetrievalZero-Shot LearningZero-shot Generalization

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGNCLIPTest

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections