SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1908.03557 · 2019

VisualBERT: A Simple and Performant Baseline for Vision and Language

Cho-Jui Hsieh, Kai-Wei Chang, Li, Da Yin, Harold Liunian, Mark Yatskar

arXiv · PDF · Open in the Atlas

Code that ran

4 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 5 no recorded run), measured 2026-11-21; 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/1908.03557.json · badge: /api/ran/1908.03557.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
gchhablani/multilingual-vqa community
Papers with Code archive
2 ran · 1 no recorded run
chenkangyang/paddle_visual_bert community
Papers with Code archive
2 ran · 1 no recorded run
YIKUAN8/Transformers-VQA community
Papers with Code archive
0 ran · 3 no recorded run
FunctionStatusWhere it lives
CLIPVisionBertConfig Ran
ran on a synthesized input · constructed an object; no result was computed
gchhablani/multilingual-vqa/models/flax_clip_vision_bert/modeling_clip_vision_bert.py
code served (permissive licence) · get_code("74b2fcf39fdad75a")
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 an instance of its own class, CLIPVisionBertConfig: the run constructed the object and did not call it, so no result was computed. 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 copy
from transformers import BertConfig, CLIPVisionConfig
from transformers.configuration_utils import PretrainedConfig

# Create minimal BertConfig
bert_config_dict = {
    'vocab_size': 30522,
    'hidden_size': 768,
    'num_hidden_layers': 2,
    'num_attention_heads': 12,
    'intermediate_size': 3072,
    'hidden_act': 'gelu',
    'hidden_dropout_prob': 0.1,
    'attention_probs_dropout_prob': 0.1,
    'max_position_embeddings': 512,
    'type_vocab_size': 2,
    'initializer_range': 0.02,
    'layer_norm_eps': 1e-12,
}

# Create minimal CLIPVisionConfig
clip_vision_config_dict = {
    'hidden_size': 768,
    'image_size': 224,
    'patch_size': 16,
    'num_channels': 3,
    'num_hidden_layers': 2,
    'num_attention_heads': 12,
    'intermediate_size': 3072,
    'hidden_act': 'gelu',
    'hidden_dropout_prob': 0.1,
    'attention_probs_dropout_prob': 0.1,
    'initializer_range': 0.02,
    'layer_norm_eps': 1e-12,
}

ARGS = {
    'bert_config': bert_config_dict,
    'clip_vision_config': clip_vision_config_dict,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CLIPVisionBertConfig — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CLIPVisionBertConfig 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
FlaxCLIPVisionBertModule Ran
ran on a synthesized input · constructed an object; no result was computed
gchhablani/multilingual-vqa/models/flax_clip_vision_bert/modeling_clip_vision_bert.py
code served (permissive licence) · get_code("eed1fcab3a96812d")
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 an instance of its own class, FlaxCLIPVisionBertModule: the run constructed the object and did not call it, so no result was computed. 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 jax
import jax.numpy as jnp
import flax.linen as nn
from transformers import BertConfig, CLIPVisionConfig

# Import the class we need to construct arguments for
from transformers.models.bert.modeling_flax_bert import FlaxBertEncoder, FlaxBertPooler
from transformers.models.clip.modeling_flax_clip import FlaxCLIPVisionModule

# Define the config classes needed
class CLIPVisionBertConfig:
    model_type = 'clip-vision-bert'
    is_composition = True

    def __init__(self, bert_config, clip_vision_config, **kwargs):
        self.bert_config = bert_config
        self.clip_vision_config = clip_vision_config
        for key, value in kwargs.items():
            setattr(self, key, value)

# Create minimal BertConfig
bert_config = BertConfig(
    vocab_size=1000,
    hidden_size=64,
    num_hidden_layers=2,
    num_attention_heads=2,
    intermediate_size=256,
    hidden_act="gelu",
    hidden_dropout_prob=0.1,
    attention_probs_dropout_prob=0.1,
    max_position_embeddings=512,
    type_vocab_size=2,
    initializer_range=0.02,
    layer_norm_eps=1e-12,
)

# Create minimal CLIPVisionConfig
clip_vision_config = CLIPVisionConfig(
    hidden_size=64,
    image_size=32,
    patch_size=8,
    num_hidden_layers=2,
    num_attention_heads=2,
    intermediate_size=256,
    hidden_act="gelu",
    hidden_dropout_prob=0.1,
    attention_probs_dropout_prob=0.1,
    initializer_range=0.02,
    layer_norm_eps=1e-12,
)

# Create the combined config
config = CLIPVisionBertConfig(
    bert_config=bert_config,
    clip_vision_config=clip_vision_config,
)

# Create small tensor inputs
batch_size = 2
seq_length = 8
visual_seq_length = 16
hidden_size = 64

input_ids = jnp.ones((batch_size, seq_length), dtype=jnp.int32)
token_type_ids = jnp.zeros((batch_size, seq_length), dtype=jnp.int32)
position_ids = jnp.arange(seq_length, dtype=jnp.int32)[None, :].repeat(batch_size, axis=0)

# Pixel values for CLIP vision module (batch, channels, height, width)
pixel_values = jnp.ones((batch_size, 3, 32, 32), dtype=jnp.float32)

visual_token_type_ids = jnp.ones((batch_size, visual_seq_length), dtype=jnp.int32)
visual_position_ids = jnp.arange(visual_seq_length, dtype=jnp.int32)[None, :].repeat(batch_size, axis=0)

# Construct ARGS dictionary for FlaxCLIPVisionBertModule.__call__
ARGS = {
    'config': config,
    'dtype': jnp.float32,
    'add_pooling_layer': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FlaxCLIPVisionBertModule — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FlaxCLIPVisionBertModule 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
perform_truncate Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chenkangyang/paddle_visual_bert/run_pretrain.py
pointer only (licence: NONE) · get_code("cd39cffdc7b1f9c3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chenkangyang/paddle_visual_bert 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.

random_word Ran
ran; our contract draft was wrong, not the code
chenkangyang/paddle_visual_bert/run_pretrain.py
pointer only (licence: NONE) · get_code("1d3d00a8a5932be0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chenkangyang/paddle_visual_bert 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.

BertEncoder Not yet run
unverified (harvested, no recorded run)
YIKUAN8/Transformers-VQA/src/modeling.py
pointer only (licence: NONE) · get_code("59f36be33253afad")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, YIKUAN8/Transformers-VQA 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.

FlaxCLIPVisionBertEmbeddings Not yet run
unverified (harvested, no recorded run)
gchhablani/multilingual-vqa/models/flax_clip_vision_bert/modeling_clip_vision_bert.py
code served (permissive licence) · get_code("bc82bcf6d781550f")
How it ran

no invocation recorded.

VBBertModel Not yet run
unverified (harvested, no recorded run)
YIKUAN8/Transformers-VQA/src/modeling.py
pointer only (licence: NONE) · get_code("2e705a7d909038d1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, YIKUAN8/Transformers-VQA 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.

VisualBertEmbeddings Not yet run
unverified (harvested, no recorded run)
YIKUAN8/Transformers-VQA/src/modeling.py
pointer only (licence: NONE) · get_code("7c7933295057c6b3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, YIKUAN8/Transformers-VQA 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.

prepare_train_features_single Not yet run
unverified (harvested, no recorded run)
chenkangyang/paddle_visual_bert/run_pretrain.py
pointer only (licence: NONE) · get_code("49436f86e6503e90")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, chenkangyang/paddle_visual_bert 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 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 8 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
BertEncoder
brick of this paper's assembly: model
1 other paper
1 later
2105.03761 (2021-05)
e-ViL: A Dataset and Benchmark for Natural Language Explanations in Vision-Language Tasks

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

Repositories linked to this paper

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

Abstract

We propose VisualBERT, a simple and flexible framework for modeling a broad range of vision-and-language tasks. VisualBERT consists of a stack of Transformer layers that implicitly align elements of an input text and regions in an associated input image with self-attention. We further propose two visually-grounded language model objectives for pre-training VisualBERT on image caption data. Experiments on four vision-and-language tasks including VQA, VCR, NLVR 2 , and Flickr30K show that VisualBERT outperforms or rivals with state-of-the-art models while being significantly simpler. Further analysis demonstrates that Vi-sualBERT can ground elements of language to image regions without any explicit supervision and is even sensitive to syntactic relationships, tracking, for example, associations between verbs and image regions corresponding to their arguments.

For agents

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

get_harvested_code_for_paper("1908.03557")
get_code_for_paper("1908.03557")
have("1908.03557")

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

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

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

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

Connect an agent — have() is free.