SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.07983 · ICLR · 2025

Two Effects, One Trigger: On the Modality Gap, Object Bias, and Information Imbalance in Contrastive Vision-Language Models

Thomas Brox, Volker Fischer, Simon Schrodi, David Hoffmann, Max Argus

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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; 4 failures of our instrument; 1 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/2404.07983.json · badge: /api/ran/2404.07983.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
lmb-freiburg/two-effects-one-trigger canonical (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_accuracy Ran
ran; our contract draft was wrong, not the code
lmb-freiburg/two-effects-one-trigger/analysis/gap_precompute.py
code served (permissive licence) · get_code("08e7bba3e22dab87")
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 float, 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

torch.manual_seed(0)

# Create small tensors for predictions and labels
# preds: shape (2,) - batch size 2, predictions
# labels: shape (2,) - batch size 2, ground truth labels
preds = torch.tensor([0, 1], dtype=torch.long)
labels = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    "preds": preds,
    "labels": labels,
}
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 float, 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
compute_l2m Ran
ran; our contract draft was wrong, not the code
lmb-freiburg/two-effects-one-trigger/analysis/gap_precompute.py
code served (permissive licence) · get_code("b2a030fd39fe6690")
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 float, 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

torch.manual_seed(0)

# Create small tensors for image and text features
# Batch size: 2, Feature dimension: 4
image_features = torch.randn(2, 4)
text_features = torch.randn(2, 4)

ARGS = {
    "image_features": image_features,
    "text_features": text_features,
}
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 float, 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
encode_clip Ran
ran; our contract draft was wrong, not the code
lmb-freiburg/two-effects-one-trigger/analysis/object_bias_precompute.py
code served (permissive licence) · get_code("be5986bcfffaea8b")
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 tuple. 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 torch.utils.data import DataLoader

torch.manual_seed(0)

# Create a minimal CLIP-like model
class MinimalCLIPModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.image_proj = nn.Linear(4, 8)
        self.text_proj = nn.Linear(4, 8)
    
    def encode_image(self, x):
        # x shape: (batch, 4)
        return self.image_proj(x)
    
    def encode_text(self, x):
        # x shape: (batch, 4)
        return self.text_proj(x)

# Create a minimal tokenizer
class MinimalTokenizer:
    def __call__(self, prompts):
        # Return a tensor of shape (num_prompts, 4)
        if isinstance(prompts, list):
            return torch.randn(len(prompts), 4)
        else:
            return torch.randn(1, 4)

# Create minimal batches: (inputs, attr_label, label)
def create_batch():
    inputs = torch.randn(2, 4)  # batch_size=2, feature_dim=4
    attr_label = torch.tensor([0, 1])  # batch_size=2
    label = torch.tensor([0, 1])  # batch_size=2
    return (inputs, attr_label, label)

# Create a data loader
loader = [create_batch() for _ in range(2)]

# Create model and move to device
model = MinimalCLIPModel()

# Create tokenizer
tokenizer = MinimalTokenizer()

# Create prompts
prompts = ["a cat", "a dog"]

ARGS = {
    "model": model,
    "loader": loader,
    "tokenizer": tokenizer,
    "prompts": prompts,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch, tqdm — 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
recall_at_k Ran
ran; our contract draft was wrong, not the code
lmb-freiburg/two-effects-one-trigger/analysis/gap_precompute.py
code served (permissive licence) · get_code("11e8a5d9bccd29e9")
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 tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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)

# Create small tensors for image and text encodings
# image_encodings: (num_images, embedding_dim)
# text_encodings: (num_texts, embedding_dim)
num_images = 2
num_texts = 3
embedding_dim = 4

image_encodings = torch.randn(num_images, embedding_dim)
text_encodings = torch.randn(num_texts, embedding_dim)

# text_to_image_map: (num_texts,) - maps each text to its corresponding image index
text_to_image_map = torch.tensor([0, 1, 0])

# image_to_text_map: (num_images, captions_per_image) - maps each image to its text indices
captions_per_image = 2
image_to_text_map = torch.tensor([[0, 2], [1, 1]])

# k values for recall computation
k_vals = [1, 2]

# device
device = torch.device("cpu")

ARGS = {
    "image_encodings": image_encodings,
    "text_encodings": text_encodings,
    "text_to_image_map": text_to_image_map,
    "image_to_text_map": image_to_text_map,
    "k_vals": k_vals,
    "device": device,
}
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 tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
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
inter_intra_cossine_sims Not yet run
unverified (harvested, no recorded run)
lmb-freiburg/two-effects-one-trigger/analysis/object_bias_precompute.py
code served (permissive licence) · get_code("a82147ecdc2a56ca")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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.

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 vision-language models (VLMs), like CLIP, have gained popularity for their versatile applicability to various downstream tasks. Despite their successes in some tasks, like zero-shot object recognition, they perform surprisingly poor on other tasks, like attribute recognition. Previous work has attributed these challenges to the modality gap, a separation of image and text in the shared representation space, and to a bias towards objects over other factors, such as attributes. In this analysis paper, we investigate both phenomena thoroughly. We evaluated off-the-shelf VLMs and while the gap's influence on performance is typically overshadowed by other factors, we find indications that closing the gap indeed leads to improvements. Moreover, we find that, contrary to intuition, only few embedding dimensions drive the gap and that the embedding spaces are differently organized. To allow for a clean study of object bias, we introduce a definition and a corresponding measure of it. Equipped with this tool, we find that object bias does not lead to worse performance on other concepts, such as attributes per se. However, why do both phenomena, modality gap and object bias, emerge in the first place? To answer this fundamental question and uncover some of the inner workings of contrastive VLMs, we conducted experiments that allowed us to control the amount of shared information between the modalities. These experiments revealed that the driving factor behind both the modality gap and the object bias, is an information imbalance between images and captions, and unveiled an intriguing connection between the modality gap and entropy of the logits.

For agents

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

get_harvested_code_for_paper("2404.07983")
get_code_for_paper("2404.07983")
have("2404.07983")

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

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

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

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

Connect an agent — have() is free.