SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.20990 · 2025

SharpZO: Hybrid Sharpness-Aware Vision Language Model Prompt Tuning via Forward-Only Passes

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2506.20990.json · badge: /api/ran/2506.20990.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
yifanycc/sharpzo canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
FunctionStatusWhere it lives
basic_clean Ran
ran; our contract draft was wrong, not the code
yifanycc/sharpzo/clip/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("98f385d847636a3e")
How it ran

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

ce_loss Ran
ran; our contract draft was wrong, not the code
yifanycc/sharpzo/clip/bb_clip_model.py
code served (permissive licence) · get_code("199d6f35dcbfe379")
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 torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for input_logits and target_logits
# Both need to be 2D tensors (batch_size, num_classes) for softmax(dim=1) and log_softmax(dim=1)
batch_size = 2
num_classes = 4

input_logits = torch.randn(batch_size, num_classes)
target_logits = torch.randn(batch_size, num_classes)

ARGS = {
    'input_logits': input_logits,
    'target_logits': target_logits,
}
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 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
get_pairs Ran
ran; our contract draft was wrong, not the code
yifanycc/sharpzo/clip/simple_tokenizer.py
code served (permissive licence) · get_code("d919ae32e5e4e616")
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 set. 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)

# The function get_pairs takes a word parameter
# A word is represented as a tuple of symbols (variable-length strings)
# The function iterates through the word and creates pairs of consecutive symbols

word = ("hello", "world", "test")

ARGS = {
    "word": word
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
listdir_nohidden Ran
ran; our contract draft was wrong, not the code
yifanycc/sharpzo/datasets/imagenet.py
pointer only (licence: MIT); the stored copy get_code serves, from mrflogs/ICLR24, is pointer only (licence: NONE) · get_code("fe317c3d4d24147a")
How it ran

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

pre_load_features Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yifanycc/sharpzo/utils.py
code served (permissive licence) · get_code("f539d9cc7267493c")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal mock CLIP model that has encode_image method
class MockCLIPModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(3, 4)  # input 3 channels, output 4-dim features
    
    def encode_image(self, images):
        # images shape: (batch, 3, H, W) -> flatten spatial dims
        batch_size = images.shape[0]
        # Simple mock: just process through linear layer
        x = images.view(batch_size, -1)  # flatten
        x = x[:, :3]  # take first 3 elements
        return self.linear(x)

# Create a small config dict
cfg = {"model": "mock_clip", "dataset": "test"}

# Create a small data loader (list of batches)
# Each batch is (images, labels)
batch_size = 2
num_batches = 2
loader = []
for _ in range(num_batches):
    images = torch.randn(batch_size, 3, 8, 8)  # 2 images, 3 channels, 8x8
    labels = torch.randint(0, 10, (batch_size,))
    loader.append((images, labels))

# Create the mock CLIP model
clip_model = MockCLIPModel()

ARGS = {
    "cfg": cfg,
    "split": "train",
    "clip_model": clip_model,
    "loader": loader,
    "norm": True
}
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
whitespace_clean Ran
ran; our contract draft was wrong, not the code
yifanycc/sharpzo/clip/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("9542161e9640b858")
How it ran

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

build_model Not yet run
unverified (harvested, no recorded run)
yifanycc/sharpzo/clip/model.py
code served (permissive licence) · get_code("5b58ecca1df5fb53")
How it ran

no invocation recorded.

ce_loss Not yet run
unverified (harvested, no recorded run)
yifanycc/sharpzo/main_sharpzo.py
code served (permissive licence) · get_code("3d3bb1e71ff2f61e")
How it ran

no invocation recorded.

cls_acc Not yet run
unverified (harvested, no recorded run)
yifanycc/sharpzo/utils.py
code served (permissive licence) · get_code("f2a0a5061e7c204e")
How it ran

no invocation recorded.

load Not yet run
unverified (harvested, no recorded run)
yifanycc/sharpzo/clip/clip.py
pointer only (licence: MIT); the stored copy get_code serves, from gaopengcuhk/Tip-Adapter, is pointer only (licence: NONE) · get_code("db64af1ba3479e8d")
How it ran

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

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 9 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 4 the same month, 7 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
get_pairs 258 other papers
215 dated earlier, 1 the same month, 30 later, 11 same year, order not determinable, 1 undated · 4 only as an assembly brick
1802.06474 (2018-02)
A Closed-form Solution to Photorealistic Image Stylization
1803.01128 (2018-03)
Seq2Sick: Evaluating the Robustness of Sequence-to-Sequence Models with Adversarial Examples
1809.00125 (2018-09)
Simple Fusion: Return of the Language Model
and 255 more not named here
whitespace_clean 231 other papers
196 dated earlier, 1 the same month, 23 later, 10 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 228 more not named here
basic_clean 218 other papers
196 dated earlier, 1 the same month, 10 later, 10 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 215 more not named here
build_model 119 other papers
103 dated earlier, 1 the same month, 11 later, 2 same year, order not determinable, 2 undated
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2104.14294 (2021-04)
Emerging Properties in Self-Supervised Vision Transformers
and 116 more not named here
load 17 other papers
12 dated earlier, 3 later, 2 same year, order not determinable
2211.16582 (2022-11)
SinDDM: A Single Image Denoising Diffusion Model
2302.00070 (2023-02)
Debiasing Vision-Language Models via Biased Prompts
and 14 more not named here
cls_acc 12 other papers
8 dated earlier, 3 later, 1 same year, order not determinable · 2 only as an assembly brick
2210.01253 (2022-10)
PLOT: PROMPT LEARNING WITH OPTIMAL TRANS-PORT FOR VISION-LANGUAGE MODELS
2402.04087 (2024-02)
A Hard-to-Beat Baseline for Training-free CLIP-based Adaptation
2403.12964 (2024-03)
Enhancing Vision-Language Few-Shot Adaptation with Negative Learning
and 9 more not named here
listdir_nohidden 4 other papers
3 dated earlier, 1 later
2402.04050 (2024-02)
Connecting the Dots: Collaborative Fine-tuning for Black-Box Vision-Language Models
2406.00345 (2024-06)
DECOOP: Robust Prompt Tuning with Out-of-Distribution Detection
2406.09353 (2024-06)
Enhancing Domain Adaptation through Prompt Gradient Alignment
and 1 more not named here
ce_loss 1 other paper
1 dated earlier
2402.04050 (2024-02)
Connecting the Dots: Collaborative Fine-tuning for Black-Box Vision-Language Models

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

Repositories linked to this paper

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

Abstract

Fine-tuning vision language models (VLMs) has achieved remarkable performance across various downstream tasks; yet, it requires access to model gradients through backpropagation (BP), making them unsuitable for memory-constrained, inference-only edge devices. To address this limitation, previous work has explored various BP-free fine-tuning methods. However, these approaches often rely on high-variance evolutionary strategies (ES) or zeroth-order (ZO) optimization, and often fail to achieve satisfactory performance. In this paper, we propose a hybrid Sharpness-aware Zeroth-order optimization (SharpZO) approach, specifically designed to enhance the performance of ZO VLM fine-tuning via a sharpness-aware warm-up training. SharpZO features a two-stage optimization process: a sharpness-aware ES stage that globally explores and smooths the loss landscape to construct a strong initialization, followed by a fine-grained local search via sparse ZO optimization. The entire optimization relies solely on forward passes. Detailed theoretical analysis and extensive experiments on CLIP models demonstrate that SharpZO significantly improves accuracy and convergence speed, achieving up to 7% average gain over state-of-the-art forward-only methods.

For agents

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

get_harvested_code_for_paper("2506.20990")
get_code_for_paper("2506.20990")
have("2506.20990")

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

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

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

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

Connect an agent — have() is free.