SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1908.07490 · 2019

LXMERT: Learning Cross-Modality Encoder Representations from Transformers

Mohit Bansal, Hao Tan

arXiv · PDF · Open in the Atlas

Code that ran

4 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 11 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.07490.json · badge: /api/ran/1908.07490.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
ghazaleh-mahmoodi/lxmert_compression community
Papers with Code archive
4 ran · 8 no recorded run
itsShnik/adaptively-finetuning-transformers community
Papers with Code archive
0 ran · 3 no recorded run
FunctionStatusWhere it lives
BertConfig Ran
ran on a synthesized input · constructed an object; no result was computed
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("5324d31f8ea9ca59")
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, BertConfig: 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
import json
import sys
from io import open
import tempfile
import os

# Create a temporary config file for testing the from_json_file path
temp_config = {
    "vocab_size": 30522,
    "hidden_size": 768,
    "num_hidden_layers": 12,
    "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
}

# Test with integer vocab_size (most common path)
ARGS = {
    "vocab_size_or_config_json_file": 30522,
    "hidden_size": 768,
    "num_hidden_layers": 12,
    "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
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BertConfig — 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 BertConfig 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
BertEmbeddings Ran
ran on a synthesized input · constructed an object; no result was computed
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("e988ae429f42601c")
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, BertEmbeddings: 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 torch
from torch import nn

torch.manual_seed(0)

class Config:
    def __init__(self):
        self.vocab_size = 100
        self.hidden_size = 4
        self.max_position_embeddings = 16
        self.type_vocab_size = 2
        self.hidden_dropout_prob = 0.1

config = Config()

input_ids = torch.randint(0, config.vocab_size, (2, 3), dtype=torch.long)
token_type_ids = torch.randint(0, config.type_vocab_size, (2, 3), dtype=torch.long)

ARGS = {
    'config': config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BertEmbeddings — 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 BertEmbeddings 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
VisualConfig Ran
ran on a synthesized input · constructed an object; no result was computed
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("3644fb46790a5387")
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, VisualConfig: 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 torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    'l_layers': 12,
    'x_layers': 5,
    'r_layers': 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type VisualConfig — 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 VisualConfig 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
VisualFeatEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("62eb6af27b771c4f")
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, VisualFeatEncoder: 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 torch
from torch import nn

torch.manual_seed(0)

class Config:
    def __init__(self):
        self.hidden_size = 768
        self.hidden_dropout_prob = 0.1

ARGS = {
    'config': Config()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type VisualFeatEncoder — 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 VisualFeatEncoder 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
BertCrossattLayer Not yet run
unverified (harvested, no recorded run)
itsShnik/adaptively-finetuning-transformers/lxmert/src/lxrt/modeling.py
pointer only (licence: NONE) · get_code("041610d8fd391e5c")
How it ran

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

BertLayer Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("2f7d2c26e185cb3f")
How it ran

no invocation recorded.

BertPreTrainedModel Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("805f9fc004ffa11b")
How it ran

no invocation recorded.

LXRTEncoder Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("eec3a5ce59023166")
How it ran

no invocation recorded.

LXRTEncoder Not yet run
unverified (harvested, no recorded run)
itsShnik/adaptively-finetuning-transformers/lxmert/src/lxrt/modeling.py
pointer only (licence: NONE) · get_code("b2d464cb37f35db7")
How it ran

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

LXRTModel Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("69076d81f02f197f")
How it ran

no invocation recorded.

LXRTXLayer Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("0b1bea7c4d0afd60")
How it ran

no invocation recorded.

LXRTXLayer Not yet run
unverified (harvested, no recorded run)
itsShnik/adaptively-finetuning-transformers/lxmert/src/lxrt/modeling.py
pointer only (licence: NONE) · get_code("22162f5bca31d93a")
How it ran

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

cached_path Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("a4e8483353cec520")
How it ran

no invocation recorded.

get_from_cache Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("242c3c3d7e930e18")
How it ran

no invocation recorded.

load_tf_weights_in_bert Not yet run
unverified (harvested, no recorded run)
ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py
code served (permissive licence) · get_code("7099305544368003")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 9 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 7 the same month, 9 later) and 6 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
cached_path
brick of this paper's assembly: helper
27 other papers
2 dated earlier, 3 the same month, 22 later · 5 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
1908.02265 (2019-08)
ViLBERT: Pretraining Task-Agnostic Visiolinguistic Representations for Vision-and-Language Tasks
and 24 more not named here
load_tf_weights_in_bert
brick of this paper's assembly: helper
9 other papers
1 the same month, 8 later · 2 only as an assembly brick
1908.03557 (2019-08)
VisualBERT: A Simple and Performant Baseline for Vision and Language
2006.06195 (2020-06)
Large-Scale Adversarial Training for Vision-and-Language Representation Learning
2021.emnlp-main.518 (2021 (year only))
NDH-FULL: Learning and Evaluating Navigational Agents on Full-Length Dialogue
and 6 more not named here
get_from_cache
brick of this paper's assembly: helper
6 other papers
1 dated earlier, 2 the same month, 3 later · 4 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1908.02265 (2019-08)
ViLBERT: Pretraining Task-Agnostic Visiolinguistic Representations for Vision-and-Language Tasks
1908.03557 (2019-08)
VisualBERT: A Simple and Performant Baseline for Vision and Language
and 3 more not named here
BertConfig
brick of this paper's assembly: helper
5 other papers
1 dated earlier, 1 the same month, 3 later · 4 only as an assembly brick
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1908.03557 (2019-08)
VisualBERT: A Simple and Performant Baseline for Vision and Language
2006.06195 (2020-06)
Large-Scale Adversarial Training for Vision-and-Language Representation Learning
and 2 more not named here
BertLayer
brick of this paper's assembly: helper
4 other papers
1 the same month, 3 later · 3 only as an assembly brick
1908.03557 (2019-08)
VisualBERT: A Simple and Performant Baseline for Vision and Language
2006.06195 (2020-06)
Large-Scale Adversarial Training for Vision-and-Language Representation Learning
2105.03761 (2021-05)
e-ViL: A Dataset and Benchmark for Natural Language Explanations in Vision-Language Tasks
and 1 more not named here
VisualConfig
brick of this paper's assembly: helper
4 other papers
1 the same month, 3 later · 4 only as an assembly brick
1908.03557 (2019-08)
VisualBERT: A Simple and Performant Baseline for Vision and Language
2006.06195 (2020-06)
Large-Scale Adversarial Training for Vision-and-Language Representation Learning
2105.03761 (2021-05)
e-ViL: A Dataset and Benchmark for Natural Language Explanations in Vision-Language Tasks
and 1 more not named here
BertPreTrainedModel
brick of this paper's assembly: helper
3 other papers
1 the same month, 2 later · 2 only as an assembly brick
1908.03557 (2019-08)
VisualBERT: A Simple and Performant Baseline for Vision and Language
2006.06195 (2020-06)
Large-Scale Adversarial Training for Vision-and-Language Representation Learning
2107.14596 (2021-07)
Multi-stage Pre-training over Simplified Multimodal Pre-training Models
LXRTXLayer
brick of this paper's assembly: helper, model
2 other papers
2 later · 2 only as an assembly brick
2006.06195 (2020-06)
Large-Scale Adversarial Training for Vision-and-Language Representation Learning
2107.14596 (2021-07)
Multi-stage Pre-training over Simplified Multimodal Pre-training Models
VisualFeatEncoder
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2107.14596 (2021-07)
Multi-stage Pre-training over Simplified Multimodal Pre-training Models

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

Vision-and-language reasoning requires an understanding of visual concepts, language semantics, and, most importantly, the alignment and relationships between these two modalities. We thus propose the LXMERT (Learning Cross-Modality Encoder Representations from Transformers) framework to learn these vision-and-language connections. In LXMERT, we build a large-scale Transformer model that consists of three encoders: an object relationship encoder, a language encoder, and a cross-modality encoder. Next, to endow our model with the capability of connecting vision and language semantics, we pre-train the model with large amounts of image-and-sentence pairs, via five diverse representative pre-training tasks: masked language modeling, masked object prediction (feature regression and label classification), cross-modality matching, and image question answering. These tasks help in learning both intra-modality and cross-modality relationships. After fine-tuning from our pretrained parameters, our model achieves the state-of-the-art results on two visual question answering datasets (i.e., VQA and GQA). We also show the generalizability of our pretrained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR 2 , and improve the previous best result by 22% absolute (54% to 76%). Lastly, we demonstrate detailed ablation studies to prove that both our novel model components and pretraining strategies significantly contribute to our strong results; and also present several attention visualizations for the different encoders. 1

For agents

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

get_harvested_code_for_paper("1908.07490")
get_code_for_paper("1908.07490")
have("1908.07490")

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

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

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

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

Connect an agent — have() is free.