SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.20171 · 2024

Diffusion Feedback Helps CLIP See Better

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 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; 2 failures of our instrument; 2 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/2407.20171.json · badge: /api/ran/2407.20171.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
baaivision/diva canonical (classifier label)
classifier basis: census
2 ran · 2 no recorded run
FunctionStatusWhere it lives
checkpoint_filter_fn Ran
ran; our contract draft was wrong, not the code
baaivision/diva/condition/SigLIP_for_timm_models_visiontransformer.py
code served (permissive licence) · get_code("f23f374916d14243")
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 dict. 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
import torch.nn as nn
import math

torch.manual_seed(0)

# Build a minimal model that has the attributes accessed by checkpoint_filter_fn
class MinimalPatchEmbed(nn.Module):
    def __init__(self):
        super().__init__()
        self.proj = nn.Conv2d(3, 64, kernel_size=16, stride=16)
        self.grid_size = (14, 14)

class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.patch_embed = MinimalPatchEmbed()
        # pos_embed shape: [1, num_patches + num_prefix_tokens, embed_dim]
        # num_patches = 14*14 = 196, num_prefix_tokens = 1
        self.pos_embed = nn.Parameter(torch.randn(1, 197, 768))
        self.num_prefix_tokens = 1
        self.no_embed_class = False

model = MinimalModel()

# Build a state_dict with patch_embed.proj.weight and pos_embed
state_dict = {
    'patch_embed.proj.weight': torch.randn(64, 3, 16, 16),
    'pos_embed': torch.randn(1, 197, 768),
}

ARGS = {
    'state_dict': state_dict,
    'model': model,
    'adapt_layer_scale': False,
    'interpolation': 'bicubic',
    'antialias': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
get_init_weights_vit Ran
ran; our contract draft was wrong, not the code
baaivision/diva/condition/SigLIP_for_timm_models_visiontransformer.py
code served (permissive licence) · get_code("42d148d34d7586d4")
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 partial. 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
import torch.nn as nn
from functools import partial

torch.manual_seed(0)

# The function get_init_weights_vit takes two parameters:
# 1. mode: str (default 'jax')
# 2. head_bias: float (default 0.0)

# The function returns a partial function or a function object
# It doesn't actually "execute" these functions in the body shown,
# it just returns them based on the mode parameter.

# So we need to provide valid arguments for get_init_weights_vit itself.

ARGS = {
    'mode': 'jax',
    'head_bias': 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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
build_model Not yet run
unverified (harvested, no recorded run)
baaivision/diva/condition/OpenAICLIP_for_clip_model.py
code served (permissive licence) · get_code("ab308f362b0e9ee9")
How it ran

no invocation recorded.

resize_pos_embed Not yet run
unverified (harvested, no recorded run)
baaivision/diva/condition/SigLIP_for_timm_models_visiontransformer.py
code served (permissive licence) · get_code("ed04551ca8295bde")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 3 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
build_model 53 other papers
31 dated earlier, 1 the same month, 19 later, 2 same year, order not determinable
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2210.01115 (2022-10)
LASP: Text-to-Text Optimization for Language-Aware Soft Prompting of Vision & Language Models
2211.09552 (2022-11)
UniFormerV2: Spatiotemporal Learning by Arming Image ViTs with Video UniFormer
and 50 more not named here
get_init_weights_vit 25 other papers
18 dated earlier, 1 the same month, 6 later · 1 only as an assembly brick
2112.08654 (2021-12)
Learning to Prompt for Continual Learning
2207.12819 (2022-07)
S-Prompts Learning with Pre-trained Transformers: An Occam's Razor for Domain Incremental Learning
2210.08823 (2022-10)
Scaling & Shifting Your Features: A New Baseline for Efficient Model Tuning
and 22 more not named here
resize_pos_embed 3 other papers
1 dated earlier, 2 later
2402.00865 (2024-02)
Towards Optimal Feature-Shaping Methods for Out-of-Distribution Detection
2409.10956 (2024-09)
Versatile Incremental Learning: Towards Class and Domain-Agnostic Incremental Learning
2409.17978 (2024-09)
HydraViT: Stacking Heads for a Scalable ViT

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

Contrastive Language-Image Pre-training (CLIP), which excels at abstracting open-world representations across domains and modalities, has become a foundation for a variety of vision and multimodal tasks. However, recent studies reveal that CLIP has severe visual shortcomings, such as which can hardly distinguish orientation, quantity, color, structure, etc. These visual shortcomings also limit the perception capabilities of multimodal large language models (MLLMs) built on CLIP. The main reason could be that the image-text pairs used to train CLIP are inherently biased, due to the lack of the distinctiveness of the text and the diversity of images. In this work, we present a simple post-training approach for CLIP models, which largely overcomes its visual shortcomings via a self-supervised diffusion process. We introduce DIVA, which uses the DIffusion model as a Visual Assistant for CLIP. Specifically, DIVA leverages generative feedback from text-to-image diffusion models to optimize CLIP representations, with only images (without corresponding text). We demonstrate that DIVA improves CLIP's performance on the challenging MMVP-VLM benchmark which assesses fine-grained visual abilities to a large extent (e.g., 3-7%), and enhances the performance of MLLMs and vision models on multimodal understanding and segmentation tasks. Extensive evaluation on 29 image classification and retrieval benchmarks confirms that our framework preserves CLIP's strong zero-shot capabilities. The code is available at https://github.com/baaivision/DIVA.

For agents

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

get_harvested_code_for_paper("2407.20171")
get_code_for_paper("2407.20171")
have("2407.20171")

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

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

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

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

Connect an agent — have() is free.