SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.04350 · CVPR · 2024

Pre-trained Model Guided Fine-Tuning for Zero-Shot Adversarial Robustness

Jie Zhang, Zheng Yuan, Shiguang Shan, Sibo Wang

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 7 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2401.04350.json · badge: /api/ran/2401.04350.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
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/utils.py
pointer only (licence: NONE) · get_code("b0f936d4d6ae3b8c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

cosine_lr Ran
ran; our contract draft was wrong, not the code
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from VivienLu/UCAT, is pointer only (licence: NONE) · get_code("932d44bbf8bd0e3f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

create_logits Ran
ran; our contract draft was wrong, not the code
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/models/model.py
pointer only (licence: NONE); the stored copy get_code serves, from VivienLu/UCAT, is pointer only (licence: NONE) · get_code("cad29a7a417c68d3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

fixed_patch Ran
ran; our contract draft was wrong, not the code
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/models/prompters.py
pointer only (licence: NONE) · get_code("263288717b164fe4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

get_indices Ran
ran, honoured the contract we drafted
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/PMG_AFT.py
pointer only (licence: NONE) · get_code("e252ed259f3e084a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

padding Ran
ran; our contract draft was wrong, not the code
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/models/prompters.py
pointer only (licence: NONE) · get_code("ed6b8fbf59cfc213")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

random_patch Ran
ran; our contract draft was wrong, not the code
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/models/prompters.py
pointer only (licence: NONE) · get_code("d22c609a1ecad7e5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

refine_classname Ran
ran; our contract draft was wrong, not the code
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from VivienLu/UCAT, is pointer only (licence: NONE) · get_code("60ab7dcbb5498f88")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

build_model Not yet run
unverified (harvested, no recorded run)
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/replace/model.py
pointer only (licence: NONE) · get_code("4a56b27d9a5bc21a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

load Not yet run
unverified (harvested, no recorded run)
serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness/replace/clip.py
pointer only (licence: NONE) · get_code("9e585a3531b71996")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, serendipity1122/Pre-trained-Model-Guided-Fine-Tuning-for-Zero-Shot-Adversarial-Robustness 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.

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, 9 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 1 the same month, 9 later) and 1 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
accuracy 116 other papers
93 dated earlier, 1 the same month, 21 later, 1 same year, order not determinable · 8 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1610.05820 (2016-10)
Membership Inference Attacks Against Machine Learning Models
1905.03696 (2019-05)
HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision
and 113 more not named here
cosine_lr 12 other papers
4 dated earlier, 8 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2209.00179 (2022-09)
Universal Vision-Language Dense Retrieval: Learning A Unified Representation Space for Multi-Modal Retrieval
2302.14042 (2023-02)
Knowledge-enhanced Visual-Language Pre-training on Chest Radiology Images
and 9 more not named here
fixed_patch 7 other papers
3 dated earlier, 4 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2303.08138 (2023-03)
Diversity-Aware Meta Visual Prompting
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
and 4 more not named here
padding 7 other papers
3 dated earlier, 4 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2303.08138 (2023-03)
Diversity-Aware Meta Visual Prompting
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
and 4 more not named here
create_logits 6 other papers
2 dated earlier, 4 later
2208.05318 (2022-08)
Generative Action Description Prompts for Skeleton-based Action Recognition
2312.03288 (2023-12)
STEP CATFormer: Spatial-Temporal Effective Body-Part Cross Attention Transformer for Skeleton-based Action Recognition
2404.19287 (2024-04)
Revisiting the Adversarial Robustness of Vision Language Models: a Multimodal Perspective
and 3 more not named here
random_patch 6 other papers
3 dated earlier, 3 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2303.08138 (2023-03)
Diversity-Aware Meta Visual Prompting
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
and 3 more not named here
build_model 2 other papers
2 later
2410.21802 (2024-10)
Text-Guided Attention is All You Need for Zero-Shot Robustness in Vision-Language Models
2512.12997 (2025-12)
Calibrating Uncertainty for Zero-Shot Adversarial CLIP
refine_classname 2 other papers
2 later
2404.19287 (2024-04)
Revisiting the Adversarial Robustness of Vision Language Models: a Multimodal Perspective
2512.12997 (2025-12)
Calibrating Uncertainty for Zero-Shot Adversarial CLIP
load 1 other paper
1 later
2404.19287 (2024-04)
Revisiting the Adversarial Robustness of Vision Language Models: a Multimodal Perspective

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

Repositories linked to this paper

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

Abstract

Large-scale pre-trained vision-language models like CLIP have demonstrated impressive performance across various tasks, and exhibit remarkable zero-shot generalization capability, while they are also vulnerable to imperceptible adversarial examples. Existing works typically employ adversarial training (fine-tuning) as a defense method against adversarial examples. However, direct application to the CLIP model may result in overfitting, compromising the model's capacity for generalization. In this paper, we propose Pre-trained Model Guided Adversarial Fine-Tuning (PMG-AFT) method, which leverages supervision from the original pre-trained model by carefully designing an auxiliary branch, to enhance the model's zero-shot adversarial robustness. Specifically, PMG-AFT minimizes the distance between the features of adversarial examples in the target model and those in the pre-trained model, aiming to preserve the generalization features already captured by the pre-trained model. Extensive Experiments on 15 zero-shot datasets demonstrate that PMG-AFT significantly outperforms the state-of-the-art method, improving the top-1 robust accuracy by an average of 4.99%. Furthermore, our approach consistently improves clean accuracy by an average of 8.72%. Our code is available at here. 1

For agents

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

get_harvested_code_for_paper("2401.04350")
get_code_for_paper("2401.04350")
have("2401.04350")

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

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

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

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

Connect an agent — have() is free.