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 Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2502.09507")

Code

Syntology Ran 8 of 32 code samples harvested from 4 repositories linked to this paper; 24 have no recorded run. Of those that ran: 4 ran · our draft was wrong; 1 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: found in paper text by Syntology: 32 samples from 4 repositories, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

salesforce/LAVIS found in paper text by SyntologyBSD-3-Clause report
neuroexplicit-saar/discover-then-name found in paper text by SyntologyMIT report
saprmarks/feature-circuits found in paper text by SyntologyMIT report
ndif-team/nnsight found in paper text by SyntologyMIT 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; 8 ran; 0 honoured the contract we drafted; 24 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · our draft was wrong
1ran · fixture could not drive it
3ran
24unverified

Licence: 0 of the 32 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 4 repositories linked to this paper, official or community; each sample names its own and says which. “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. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (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 from a repository marked official are listed first. 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 four 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; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). 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.

basic_clean neuroexplicit-saar/discover-then-name/clip/simple_tokenizer.py found in paper text by Syntology ran · our draft was wrong fingerprinted MIT (permissive) · 98f385d847636a3e · report
getAttMap salesforce/LAVIS/lavis/common/gradcam.py found in paper text by Syntology ran · fixture could not drive it fingerprinted BSD-3-Clause (permissive) · 7d214655954e2bc6 · report
get_pairs neuroexplicit-saar/discover-then-name/clip/simple_tokenizer.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · d919ae32e5e4e616 · report
interpolate_pos_embed salesforce/LAVIS/lavis/models/vit.py found in paper text by Syntology ran · our draft was wrong BSD-3-Clause (permissive) · c6ec173f19f5c34d · report
main_process salesforce/LAVIS/lavis/common/dist_utils.py found in paper text by Syntology ran BSD-3-Clause (permissive) · 98589643273920ba · report
node_to_dict salesforce/LAVIS/lavis/common/config.py found in paper text by Syntology ran BSD-3-Clause (permissive) · 791c72070c0b1cfb · report
tile salesforce/LAVIS/lavis/models/base_model.py found in paper text by Syntology ran fingerprinted BSD-3-Clause (permissive) · cb33571427334815 · report
whitespace_clean neuroexplicit-saar/discover-then-name/clip/simple_tokenizer.py found in paper text by Syntology ran · our draft was wrong fingerprinted MIT (permissive) · 9542161e9640b858 · report
all_gather_with_grad salesforce/LAVIS/lavis/models/base_model.py found in paper text by Syntology unverified BSD-3-Clause (permissive) · 0ec9fc2025c16f65 · report
apply ndif-team/nnsight/src/nnsight/util.py found in paper text by Syntology unverified MIT (permissive) · 013ac77858f729a5 · report
build_model neuroexplicit-saar/discover-then-name/clip/model.py found in paper text by Syntology unverified MIT (permissive) · 3662e54c46137680 · report
capture_exception ndif-team/nnsight/src/nnsight/intervention/errors.py found in paper text by Syntology unverified MIT (permissive) · 6db205fad012bb49 · report
concat ndif-team/nnsight/src/nnsight/intervention/batching.py found in paper text by Syntology unverified MIT (permissive) · 4426e27aa118f08d · report
download_cached_file salesforce/LAVIS/lavis/common/dist_utils.py found in paper text by Syntology unverified BSD-3-Clause (permissive) · 643539116e049080 · report
from_import_path ndif-team/nnsight/src/nnsight/util.py found in paper text by Syntology unverified MIT (permissive) · 5a59e925d9bdd730 · report
get_annotation saprmarks/feature-circuits/data_loading_utils.py found in paper text by Syntology unverified MIT (permissive) · 07b539dc323f7bf6 · report
get_name_gemma saprmarks/feature-circuits/circuit_plotting.py found in paper text by Syntology unverified MIT (permissive) · 78a00cb43e4b428b · report
get_name_pythia saprmarks/feature-circuits/circuit_plotting.py found in paper text by Syntology unverified MIT (permissive) · 77dfb02ffefe5bbc · report
get_probe_classifier_ckpt neuroexplicit-saar/discover-then-name/dncbm/utils.py found in paper text by Syntology unverified MIT (permissive) · 0b14ce4fe263ff5b · report
get_sae_ckpt neuroexplicit-saar/discover-then-name/dncbm/utils.py found in paper text by Syntology unverified MIT (permissive) · 6d0212913db960d6 · report
is_model_running ndif-team/nnsight/src/nnsight/ndif.py found in paper text by Syntology unverified MIT (permissive) · a31e3e8047f3f679 · report
load neuroexplicit-saar/discover-then-name/clip/clip.py found in paper text by Syntology unverified MIT (permissive) · b91b981015bbf498 · report
load_examples_nopair saprmarks/feature-circuits/data_loading_utils.py found in paper text by Syntology unverified MIT (permissive) · 900950517fc5e4d5 · report
ndif_status ndif-team/nnsight/src/nnsight/ndif.py found in paper text by Syntology unverified MIT (permissive) · 6a750256744289a9 · report
plot_circuit_posaligned saprmarks/feature-circuits/circuit_plotting.py found in paper text by Syntology unverified MIT (permissive) · a7b85fe417248ff9 · report
sparse_flatten saprmarks/feature-circuits/coo_utils.py found in paper text by Syntology unverified MIT (permissive) · fd2e79ac3e8d7ce8 · report
sparse_mean saprmarks/feature-circuits/coo_utils.py found in paper text by Syntology unverified MIT (permissive) · 5d898b6d7272c096 · report
sparse_reshape saprmarks/feature-circuits/coo_utils.py found in paper text by Syntology unverified MIT (permissive) · eaebec17f584ac1f · report
status ndif-team/nnsight/src/nnsight/ndif.py found in paper text by Syntology unverified MIT (permissive) · fb66304fd81f1b4a · report
to_import_path ndif-team/nnsight/src/nnsight/util.py found in paper text by Syntology unverified MIT (permissive) · c3262cc8bbc0cf2f · report
to_numpy neuroexplicit-saar/discover-then-name/dncbm/visualization/drawing_functions.py found in paper text by Syntology unverified MIT (permissive) · 77c07376a0e1c1a0 · report
to_numpy_img neuroexplicit-saar/discover-then-name/dncbm/visualization/drawing_functions.py found in paper text by Syntology unverified MIT (permissive) · abb04880ee7994e0 · 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