Papers › LXMERT: Learning Cross-Modality Encoder Representations from Transformers

LXMERT: Learning Cross-Modality Encoder Representations from Transformers

20 Aug 2019IJCNLP 2019 11arXiv:1908.07490archive 2025-07-28

Hao Tan, Mohit Bansal

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 pre-trained 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 pre-trained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR2, 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 pre-training strategies significantly contribute to our strong results; and also present several attention visualizations for the different encoders. Code and pre-trained models publicly available at: https://github.com/airsplay/lxmert

PaperPDFConference PDFCodeCode 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="1908.07490")

Code

Syntology Ran 4 of 15 code samples harvested from 2 repositories linked to this paper; 11 have no recorded run. Of those that ran: 4 ran with no contract checked.

By repository: community (archive-listed): 15 samples from 2 repositories, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

airsplay/lxmert officialmentioned in papermentioned on GitHubpytorchMIT report
ghazaleh-mahmoodi/lxmert_compression mentioned on GitHubpytorch report
huggingface/transformers mentioned on GitHubpytorch report
social-ai-studio/matk mentioned on GitHubpytorch report
zhegan27/LXMERT-AdvTrain mentioned on GitHubpytorch report
zhegan27/VILLA mentioned on GitHubpytorchMIT 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

15 samples harvested; 4 ran; 0 honoured the contract we drafted; 11 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
11unverified

Licence: 3 of the 15 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 2 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.

BertConfig ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 5324d31f8ea9ca59 · report
BertEmbeddings ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · e988ae429f42601c · report
VisualConfig ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) ran MIT (permissive) · 3644fb46790a5387 · report
VisualFeatEncoder ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 62eb6af27b771c4f · report
BertCrossattLayer itsShnik/adaptively-finetuning-transformers/lxmert/src/lxrt/modeling.py community (archive-listed) unverified no licence file found · pointer only · 041610d8fd391e5c · report
BertLayer ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · 2f7d2c26e185cb3f · report
BertPreTrainedModel ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · 805f9fc004ffa11b · report
LXRTEncoder ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · eec3a5ce59023166 · report
LXRTEncoder itsShnik/adaptively-finetuning-transformers/lxmert/src/lxrt/modeling.py community (archive-listed) unverified no licence file found · pointer only · b2d464cb37f35db7 · report
LXRTModel ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · 69076d81f02f197f · report
LXRTXLayer ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · 0b1bea7c4d0afd60 · report
LXRTXLayer itsShnik/adaptively-finetuning-transformers/lxmert/src/lxrt/modeling.py community (archive-listed) unverified no licence file found · pointer only · 22162f5bca31d93a · report
cached_path ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · a4e8483353cec520 · report
get_from_cache ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · 242c3c3d7e930e18 · report
load_tf_weights_in_bert ghazaleh-mahmoodi/lxmert_compression/lxmert/src/lxrt/modeling.py community (archive-listed) unverified MIT (permissive) · 7099305544368003 · report

Tasks

Language ModelingLanguage ModellingMasked Language ModelingQuestion AnsweringSentenceVisual Question AnsweringVisual Question Answering (VQA)Visual Reasoning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Visual Question Answering (VQA) A-OKVQA LXMERT DA VQA Score 25.9 #10 of 15 Archive leaderboard report
Visual Question Answering (VQA) A-OKVQA LXMERT MC Accuracy 41.6 #10 of 15 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Ensemble Accuracy 62.71 #15 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Ensemble Binary 79.79 #15 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Ensemble Consistency 93.1 #15 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Ensemble Distribution 6.42 #15 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Ensemble Open 47.64 #15 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Ensemble Plausibility 85.21 #15 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Ensemble Validity 96.36 #15 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Single Model Accuracy 60.33 #36 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Single Model Binary 77.16 #36 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Single Model Consistency 89.59 #36 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Single Model Distribution 5.69 #36 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Single Model Open 45.47 #36 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Single Model Plausibility 84.53 #36 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA Test2019 LXR955, Single Model Validity 96.35 #36 of 127 Archive leaderboard report
Visual Question Answering (VQA) GQA test-dev LXMERT (Pre-train + scratch) Accuracy 60.0 #7 of 17 Archive leaderboard report
Visual Question Answering (VQA) GQA test-std LXMERT Accuracy 60.3 #4 of 7 Archive leaderboard report
Visual Question Answering (VQA) VQA v2 test-dev LXMERT (Pre-train + scratch) Accuracy 69.9 #32 of 56 Archive leaderboard report
Visual Question Answering (VQA) VQA v2 test-std LXMERT overall 72.5 #21 of 38 Archive leaderboard report
Visual Question Answering (VQA) VizWiz 2018 LXR955, No Ensemble number 24.76 #1 of 10 Archive leaderboard report
Visual Question Answering (VQA) VizWiz 2018 LXR955, No Ensemble other 39.0 #1 of 10 Archive leaderboard report
Visual Question Answering (VQA) VizWiz 2018 LXR955, No Ensemble overall 55.4 #1 of 10 Archive leaderboard report
Visual Question Answering (VQA) VizWiz 2018 LXR955, No Ensemble unanswerable 82.26 #1 of 10 Archive leaderboard report
Visual Question Answering (VQA) VizWiz 2018 LXR955, No Ensemble yes/no 74.0 #1 of 10 Archive leaderboard report
Visual Reasoning NLVR2 Dev LXMERT (Pre-train + scratch) Accuracy 74.9 #14 of 15 Archive leaderboard report
Visual Reasoning NLVR2 Test LXMERT Accuracy 76.2 #13 of 14 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: LXMERT

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLXMERTLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerReLUResidual ConnectionSoftmaxTransformer

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