Papers › Calibrating Uncertainty for Zero-Shot Adversarial CLIP

Calibrating Uncertainty for Zero-Shot Adversarial CLIP

15 Dec 2025ICMLarXiv:2512.12997added by Syntology

Wenjing Lu, Zerui Tao, Yuning Qiu, Dongping Zhang, Yang Yang, Qibin Zhao

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

CLIP delivers strong zero-shot classification but remains highly vulnerable to adversarial attacks. Prior adversarial fine-tuning work primarily matches predicted logits between clean and adversarial examples, which overlooks uncertainty calibration and may degrade the zero-shot generalization. A common expectation in reliable uncertainty estimation is that predictive uncertainty should increase as inputs become more difficult or shift away from the training distribution. However, we frequently observe the opposite in the adversarial setting: perturbations not only degrade accuracy but also suppress uncertainty, leading to severe miscalibration and over-confidence. This reveals a critical reliability gap beyond robustness. To bridge this gap, we propose an adversarial fine-tuning objective for CLIP considering both accuracy and uncertainty. By reparameterizing CLIP outputs as the concentration parameters of a Dirichlet distribution, we propose a unified representation that captures relative semantic structure and confidence magnitude. This enables holistic distribution alignment under perturbations, moving beyond single-logit anchoring and restoring calibrated uncertainty. Experiments across multiple zero-shot benchmarks demonstrate that our method significantly improves uncertainty calibration and achieves competitive adversarial robustness while preserving clean accuracy.

PaperPDFCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 22 code samples harvested from 1 repository linked to this paper: 18 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 13 where Syntology's instrument failed) · 4 unverified. Where Syntology's instrument failed: 10 where our contract draft was wrong; 3 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: found in paper text by Syntology: 22 samples from 1 repository, 18 ran (5 with no instrument failure; 13 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 1 of the 18 samples that ran has no recorded date.

VivienLu/UCAT found in paper text by SyntologySyntology: 22 samples, 18 ran (13 instrument-failed) · 4 unverified report

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

22 samples harvested: 18 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 13 where Syntology's instrument failed) · 4 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

10ran · our draft was wrong
3ran; the contract check could not run
5ran
4unverified

Licence: 22 of the 22 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 VivienLu/UCAT. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

VivienLu/UCAT found in paper text by Syntology 22 samples, 18 ran (13 instrument-failed) · 4 unverified
accuracy in 872 papers
census: 8 implementations from 7 papers, 7 distinct outputs across 6 buckets, one shared input per bucket
utils.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant no licence file found · pointer only · b0f936d4d6ae3b8c · report fixture: signature output:Tensor/2/float, target:Tensor/1/int, topk:tuple/1/int · returned list · level recorded, date not recorded
au_dirichlet slip-ucat.py ran no licence file found · pointer only · 2561f9e79b1a7b83 · report fixture: signature alpha:Tensor/2/float, C:int/0/int, eps:float/0/float · returned Tensor · level recorded 2026-09-26
clip_img_preprocessing models/model.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 405bd24ae83558d9 · report fixture: signature X:Tensor/4/float, device:str/0/str · returned Tensor · level recorded 2026-09-26
compute_multilabel_metrics main-multilabel.py ran · our draft was wrong no licence file found · pointer only · 725e3cb076f6048b · report fixture: signature outputs:Tensor/2/float, targets:Tensor/2/float, from_logits:bool/0/bool, threshold:float/0/float, top_k:NoneType/0/?, eps:float/0/float · returned dict · level recorded 2026-09-26
cosine_lr in 31 papers utils.py ran no licence file found · pointer only · 932d44bbf8bd0e3f · report fixture: signature optimizer:SGD/0/?, base_lr:float/0/float, warmup_length:int/0/int, steps:int/0/int · returned function · level recorded 2026-09-26
create_logits in 7 papers models/model.py ran no licence file found · pointer only · cad29a7a417c68d3 · report fixture: signature x1:Tensor/2/float, x2:Tensor/2/float, logit_scale:Tensor/0/float · returned tuple · level recorded 2026-09-26
entropy_from_logits in 13 papers slip-ucat.py ran · our draft was wrong fingerprinted no licence file found · pointer only · d2d06e2a020d4fc5 · report fixture: signature logits:Tensor/2/float · returned Tensor · level recorded 2026-09-26
eu_dirichlet slip-ucat.py ran no licence file found · pointer only · 846e76d01ed68531 · report fixture: signature alpha:Tensor/2/float, C:int/0/int, eps:float/0/float · returned Tensor · level recorded 2026-09-26
fixed_patch in 11 papers models/prompters.py ran · our draft was wrong no licence file found · pointer only · 162f47c0241fc73c · report fixture: signature args:Args/0/? · returned FixedPatchPrompter · level recorded 2026-09-26
getCLIP util/model.py ran no licence file found · pointer only · 81450906b6e6919b · report fixture: signature model:callable/0/?, model_name:str/0/str, gpu_id:str/0/str · returned tuple · level recorded 2026-09-26
get_loss in 107 papers
census: 5 implementations from 5 papers, 5 distinct outputs across 4 buckets, one shared input per bucket
slip/slip_models.py ran · our draft was wrong no licence file found · pointer only · 4c34821ae12949e9 · report fixture: returned SLIPLoss · level recorded 2026-09-22
get_metric_names in 11 papers slip/slip_models.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 345ec4da9f331b85 · report fixture: signature model:str/0/str · returned list · level recorded 2026-09-22
normalize in 638 papers
census: 70 implementations from 82 papers, 51 distinct outputs across 11 buckets, one shared input per bucket
models/model.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 638942a0de2d2288 · report fixture: signature X:Tensor/4/float, device:int/0/int · returned Tensor · level recorded 2026-09-26
padding in 37 papers models/prompters.py ran · our draft was wrong no licence file found · pointer only · f5a7aedde2544358 · report fixture: signature args:ArgsConfig/0/? · returned PadPrompter · level recorded 2026-09-26
random_patch in 13 papers models/prompters.py ran · our draft was wrong no licence file found · pointer only · cd3ffbc5192b9ccf · report fixture: signature args:ArgsConfig/0/? · returned RandomPatchPrompter · level recorded 2026-09-26
refine_classname in 8 papers utils.py ran · our draft was wrong no licence file found · pointer only · 60ab7dcbb5498f88 · report fixture: signature class_names:list/1/str · returned list · level recorded 2026-09-26
reshapeTransform14 util/model.py ran; the contract check could not run (RAISES) no licence file found · pointer only · 8126da3092bcfb30 · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-26
reshapeTransform7 util/model.py ran; the contract check could not run (RAISES) no licence file found · pointer only · 2acf843d6df1edf4 · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-26
attack_pgd in 10 papers attacks.py unverified no licence file found · pointer only · 6a6111640475b80b · report
attack_pgd in 10 papers attacks_multilabel.py unverified no licence file found · pointer only · 3a8a760ecfb5b55a · report
build_model in 469 papers replace/model.py unverified no licence file found · pointer only · a25e1e252d00d120 · report
clamp in 78 papers
census: 7 implementations from 8 papers, 6 distinct outputs across 4 buckets, one shared input per bucket
attacks.py unverified no licence file found · pointer only · 8a93e041134b597a · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2512.12997, was issued in December 2025, after that date, so the archive has no leaderboard rows for it.

Placed on leaderboards by Syntology Syntology

Syntology's extractor, the model Claude Sonnet 4.5, judged this paper's tables to report on 1 leaderboard (a model's judgement, not a result) and has not placed the paper on it: Multi-Label Classification · MS-COCO (rejected by the independent check). What is not shown.

Syntology has checked 8,886 of the 18,637 papers on this site that are newer than the archive (for 3,717 of them no archive leaderboard matched the paper's tables, so there was nothing further to check); 733 were read and have nothing to place (arXiv has no HTML version of the paper, or that version has no tables), 41 could not be read (the extractor's reply could not be parsed), and results from the other 8,977 appear after they are checked.

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