Papers › When and How Does CLIP Enable Domain and Compositional Generalization?

When and How Does CLIP Enable Domain and Compositional Generalization?

13 Feb 2025arXiv:2502.09507archive 2025-07-28

Elias Kempf, Simon Schrodi, Max Argus, Thomas Brox

The remarkable generalization performance of contrastive vision-language models like CLIP is often attributed to the diversity of their training distributions. However, key questions remain unanswered: Can CLIP generalize to an entirely unseen domain when trained on a diverse mixture of domains (domain generalization)? Can it generalize to unseen classes within partially seen domains (compositional generalization)? What factors affect such generalization? To answer these questions, we trained CLIP models on systematically constructed training distributions with controlled domain diversity and object class exposure. Our experiments show that domain diversity is essential for both domain and compositional generalization, yet compositional generalization can be surprisingly weaker than domain generalization when the training distribution contains a suboptimal subset of the test domain. Through data-centric and mechanistic analyses, we find that successful generalization requires learning of shared representations already in intermediate layers and shared circuitry.

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 32 code samples harvested from 4 repositories linked to this paper: 24 ran (of which 0 constructed an object rather than computing a result; 16 with no instrument failure: 0 honoured, 0 violated, 16 with no contract checked; 8 where Syntology's instrument failed) · 8 unverified. Where Syntology's instrument failed: 7 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: found in paper text by Syntology: 32 samples from 4 repositories, 24 ran (16 with no instrument failure; 8 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-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 1 of the 24 samples that ran has no recorded date.

salesforce/LAVIS found in paper text by SyntologyBSD-3-ClauseSyntology: 7 samples, 5 ran (5 instrument-failed) · 2 unverified report
neuroexplicit-saar/discover-then-name found in paper text by SyntologyMITSyntology: 9 samples, 6 ran (3 instrument-failed) · 3 unverified report
saprmarks/feature-circuits found in paper text by SyntologyMITSyntology: 8 samples, 7 ran (0 instrument-failed) · 1 unverified report
ndif-team/nnsight found in paper text by SyntologyMITSyntology: 8 samples, 6 ran (0 instrument-failed) · 2 unverified 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

32 samples harvested: 24 ran (of which 0 constructed an object rather than computing a result; 16 with no instrument failure: 0 honoured, 0 violated, 16 with no contract checked; 8 where Syntology's instrument failed) · 8 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

7ran · our draft was wrong
1ran; the contract check could not run
16ran
8unverified

Licence: 5 of the 32 samples are pointer only, meaning Syntology does not serve that copy's text. For 5 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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.

salesforce/LAVIS found in paper text by Syntology 7 samples, 5 ran (5 instrument-failed) · 2 unverified
getAttMap in 30 papers lavis/common/gradcam.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted BSD-3-Clause (permissive) · 7d214655954e2bc6 · report fixture: signature img:ndarray/3/float, attMap:ndarray/2/float, blur:bool/0/bool, overlap:bool/0/bool · returned ndarray · level recorded 2026-09-22
interpolate_pos_embed in 59 papers lavis/models/vit.py ran · our draft was wrong BSD-3-Clause (permissive) · c6ec173f19f5c34d · report fixture: signature pos_embed_checkpoint:Tensor/3/float, visual_encoder:callable/0/? · returned Tensor · level recorded, date not recorded
main_process in 45 papers lavis/common/dist_utils.py ran · our draft was wrong BSD-3-Clause (permissive) · 98589643273920ba · report fixture: signature func:callable/0/? · returned function · level recorded 2026-09-24
node_to_dict in 40 papers lavis/common/config.py ran · our draft was wrong BSD-3-Clause (permissive) · 791c72070c0b1cfb · report fixture: signature node:DictConfig/0/? · returned dict · level recorded 2026-09-24
tile in 109 papers
census: 5 implementations from 7 papers, 4 distinct outputs across 3 buckets, one shared input per bucket
lavis/models/base_model.py ran · our draft was wrong fingerprinted BSD-3-Clause (permissive) here; the stored copy is pointer only · cb33571427334815 · report fixture: signature x:Tensor/4/float, dim:int/0/int, n_tile:int/0/int · returned Tensor · level recorded 2026-09-24
all_gather_with_grad in 93 papers lavis/models/base_model.py unverified BSD-3-Clause (permissive) · 0ec9fc2025c16f65 · report
download_cached_file in 40 papers lavis/common/dist_utils.py unverified BSD-3-Clause (permissive) · 643539116e049080 · report
neuroexplicit-saar/discover-then-name found in paper text by Syntology 9 samples, 6 ran (3 instrument-failed) · 3 unverified
basic_clean in 217 papers clip/simple_tokenizer.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · 98f385d847636a3e · report fixture: signature text:str/0/str · returned str · level recorded 2026-09-22
get_pairs in 260 papers clip/simple_tokenizer.py ran · our draft was wrong MIT (permissive) · d919ae32e5e4e616 · report fixture: signature word:tuple/1/str · returned set · level recorded 2026-09-22
get_probe_classifier_ckpt dncbm/utils.py ran MIT (permissive) · 0b14ce4fe263ff5b · report fixture: signature args:Args/0/?, which_ckpt:NoneType/0/?, name_only:bool/0/bool · returned tuple · level recorded 2026-09-24
to_numpy in 103 papers
census: 24 implementations from 29 papers, 2 distinct outputs across 2 buckets, one shared input per bucket
dncbm/visualization/drawing_functions.py ran MIT (permissive) · 77c07376a0e1c1a0 · report fixture: signature tensor:Tensor/2/float · returned ndarray · level recorded 2026-09-25
to_numpy_img dncbm/visualization/drawing_functions.py ran MIT (permissive) · abb04880ee7994e0 · report fixture: signature tensor:Tensor/3/float · returned ndarray · level recorded 2026-09-24
whitespace_clean in 230 papers clip/simple_tokenizer.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · 9542161e9640b858 · report fixture: signature text:str/0/str · returned str · level recorded 2026-09-22
build_model in 469 papers clip/model.py unverified MIT (permissive) here; the stored copy is pointer only · 3662e54c46137680 · report
get_sae_ckpt dncbm/utils.py unverified MIT (permissive) · 6d0212913db960d6 · report
load in 392 papers clip/clip.py unverified MIT (permissive) here; the stored copy is pointer only · b91b981015bbf498 · report
saprmarks/feature-circuits found in paper text by Syntology 8 samples, 7 ran (0 instrument-failed) · 1 unverified
get_annotation data_loading_utils.py ran MIT (permissive) · 07b539dc323f7bf6 · report fixture: signature dataset:str/0/str, model:callable/0/?, data:dict/0/? · returned dict · level recorded 2026-09-25
get_name_gemma circuit_plotting.py ran MIT (permissive) · 78a00cb43e4b428b · report fixture: signature component:str/0/str, layer:int/0/int, idx:list/1/int · returned str · level recorded 2026-09-25
get_name_pythia circuit_plotting.py ran MIT (permissive) · 77dfb02ffefe5bbc · report fixture: signature component:str/0/str, layer:int/0/int, idx:list/1/list · returned str · level recorded 2026-09-25
load_examples_nopair data_loading_utils.py ran MIT (permissive) · 900950517fc5e4d5 · report fixture: signature dataset:dict/0/?, num_examples:int/0/int, model:callable/0/? · returned list · level recorded 2026-09-24
sparse_flatten coo_utils.py ran MIT (permissive) · fd2e79ac3e8d7ce8 · report fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-24
sparse_mean coo_utils.py ran fingerprinted MIT (permissive) · 5d898b6d7272c096 · report fixture: signature x:Tensor/3/float, dim:int/0/int · returned Tensor · level recorded 2026-09-24
sparse_reshape coo_utils.py ran MIT (permissive) · eaebec17f584ac1f · report fixture: signature x:Tensor/2/float, shape:tuple/1/int · returned Tensor · level recorded 2026-09-24
plot_circuit_posaligned circuit_plotting.py unverified MIT (permissive) · a7b85fe417248ff9 · report
ndif-team/nnsight found in paper text by Syntology 8 samples, 6 ran (0 instrument-failed) · 2 unverified
apply in 10 papers src/nnsight/util.py ran MIT (permissive) · 013ac77858f729a5 · report fixture: signature data:dict/0/?, fn:callable/0/?, cls:callable/0/?, n:int/0/int · returned dict · level recorded 2026-09-24
concat in 21 papers src/nnsight/intervention/batching.py ran MIT (permissive) · 4426e27aa118f08d · report fixture: signature structures:list/1/Tensor · returned Tensor · level recorded 2026-09-24
from_import_path src/nnsight/util.py ran MIT (permissive) · 5a59e925d9bdd730 · report fixture: signature path:str/0/str · returned type · level recorded 2026-09-24
is_model_running src/nnsight/ndif.py ran fingerprinted MIT (permissive) · a31e3e8047f3f679 · report fixture: signature repo_id:str/0/str, revision:str/0/str · returned bool · level recorded 2026-09-24
status src/nnsight/ndif.py ran MIT (permissive) · fb66304fd81f1b4a · report fixture: signature raw:bool/0/bool · returned NdifStatus · level recorded 2026-09-24
to_import_path src/nnsight/util.py ran MIT (permissive) · c3262cc8bbc0cf2f · report fixture: signature obj:callable/0/? · returned str · level recorded 2026-09-24
capture_exception src/nnsight/intervention/errors.py unverified MIT (permissive) · 6db205fad012bb49 · report
ndif_status src/nnsight/ndif.py unverified MIT (permissive) · 6a750256744289a9 · report

Tasks

DiversityDomain Generalization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

CLIP

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