Papers › CoCa: Contrastive Captioners are Image-Text Foundation Models

CoCa: Contrastive Captioners are Image-Text Foundation Models

4 May 2022arXiv:2205.01917archive 2025-07-28

Jiahui Yu, ZiRui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, Yonghui Wu

Exploring large-scale pretrained foundation models is of significant interest in computer vision because these models can be quickly transferred to many downstream tasks. This paper presents Contrastive Captioner (CoCa), a minimalist design to pretrain an image-text encoder-decoder foundation model jointly with contrastive loss and captioning loss, thereby subsuming model capabilities from contrastive approaches like CLIP and generative methods like SimVLM. In contrast to standard encoder-decoder transformers where all decoder layers attend to encoder outputs, CoCa omits cross-attention in the first half of decoder layers to encode unimodal text representations, and cascades the remaining decoder layers which cross-attend to the image encoder for multimodal image-text representations. We apply a contrastive loss between unimodal image and text embeddings, in addition to a captioning loss on the multimodal decoder outputs which predicts text tokens autoregressively. By sharing the same computational graph, the two training objectives are computed efficiently with minimal overhead. CoCa is pretrained end-to-end and from scratch on both web-scale alt-text data and annotated images by treating all labels simply as text, seamlessly unifying natural language supervision for representation learning. Empirically, CoCa achieves state-of-the-art performance with zero-shot transfer or minimal task-specific adaptation on a broad range of downstream tasks, spanning visual recognition (ImageNet, Kinetics-400/600/700, Moments-in-Time), crossmodal retrieval (MSCOCO, Flickr30K, MSR-VTT), multimodal understanding (VQA, SNLI-VE, NLVR2), and image captioning (MSCOCO, NoCaps). Notably on ImageNet classification, CoCa obtains 86.3% zero-shot top-1 accuracy, 90.6% with a frozen encoder and learned classification head, and new state-of-the-art 91.0% top-1 accuracy on ImageNet with a finetuned encoder.

PaperPDFCodeCode Syntology ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 17 code samples harvested from 2 repositories linked to this paper: 10 ran (of which 5 constructed an object rather than computing a result; 9 with no instrument failure: 2 honoured, 0 violated, 7 with no contract checked; 1 where Syntology's instrument failed) · 7 unverified. Where Syntology's instrument failed: 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 17 samples from 2 repositories, 10 ran (9 with no instrument failure; 1 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 4 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

Chaolei98/FreeZAD mentioned on GitHubpytorchMITSyntology: 4 samples, 3 ran (1 instrument-failed) · 1 unverified report
amitakamath/hard_positives mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to The Hard Positive Truth about Vision-Language Compositionality (arXiv:2409.17958; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 3 where Syntology's instrument failed) · 1 unverified); nothing checks that they implement this paper's method. report
amitakamath/whatsup_vlms mentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to What's "up" with vision-language models? Investigating their struggle with spatial reasoning (arXiv:2310.19785; that paper's own run record: 5 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 5 where Syntology's instrument failed) · 4 unverified); nothing checks that they implement this paper's method. report
facebookresearch/multimodal mentioned on GitHubpytorchSyntology: 13 samples, 7 ran (0 instrument-failed) · 6 unverified report
lucidrains/CoCa-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to PaLM: Scaling Language Modeling with Pathways (arXiv:2204.02311; that paper's own run record: 32 ran (of which 16 constructed an object rather than computing a result; 24 with no instrument failure: 2 honoured, 1 violated, 21 with no contract checked; 8 where Syntology's instrument failed) · 5 unverified); nothing checks that they implement this paper's method. report
mlfoundations/open_clip mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Sigmoid Loss for Language Image Pre-Training (arXiv:2303.15343; that paper's own run record: 14 ran (of which 3 constructed an object rather than computing a result; 11 with no instrument failure: 0 honoured, 0 violated, 11 with no contract checked; 3 where Syntology's instrument failed) · 15 unverified), DisCo-CLIP: A Distributed Contrastive Loss for Memory Efficient CLIP Training (arXiv:2304.08480; that paper's own run record: 1 ran (of which 1 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified; the one sample that ran constructed an object rather than computing a result) and Fine-tuning CLIP Text Encoders with Two-step Paraphrasing (arXiv:2402.15120; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

17 samples harvested: 10 ran (of which 5 constructed an object rather than computing a result; 9 with no instrument failure: 2 honoured, 0 violated, 7 with no contract checked; 1 where Syntology's instrument failed) · 7 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · honoured contract
1ran; the contract check could not run
7ran
7unverified

Licence: 2 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. For 2 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. 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; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 1 sample that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

Chaolei98/FreeZAD community (archive-listed) 4 samples, 3 ran (1 instrument-failed) · 1 unverified
compute_average_precision_detection in 10 papers evaluate.py ran MIT (permissive) · 320499e20591d89f · report fixture: signature ground_truth:DataFrame/0/?, prediction:DataFrame/0/?, tiou_thresholds:ndarray/1/float · returned tuple · level recorded 2026-09-24
interpolated_prec_rec in 14 papers evaluate.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) here; the stored copy is pointer only · 1fc3d3455e5edcbb · report fixture: signature prec:ndarray/1/float, rec:ndarray/1/float · returned float64 · level recorded 2026-09-24
segment_iou in 15 papers evaluate.py ran · honoured contract fingerprinted MIT (permissive) here; the stored copy is pointer only · d0744a2fe3151508 · report fixture: signature target_segment:ndarray/1/float, candidate_segments:ndarray/2/float · returned ndarray · level recorded 2026-09-22
get_video_info in 5 papers extract_features.py unverified MIT (permissive) · f6224c8305205872 · report
facebookresearch/multimodal community (archive-listed) 13 samples, 7 ran (0 instrument-failed) · 6 unverified
CoCaTextEmbeddings torchmultimodal/models/coca/coca_model.py ran · metamorphic tier: deterministic BSD-3-Clause (permissive) · 38c836510c2b097d · report fixture: returned CoCaTextEmbeddings · level recorded 2026-09-22
Fp32LayerNorm torchmultimodal/models/coca/coca_model.py ran BSD-3-Clause (permissive) · 1851c02d87765a1f · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-24
MHAWithCacheOutput torchmultimodal/models/coca/coca_model.py ran · metamorphic tier: deterministic BSD-3-Clause (permissive) · c3bf9823eb334b94 · report fixture: returned MHAWithCacheOutput · level recorded 2026-09-22
MLP in 375 papers torchmultimodal/models/coca/coca_model.py ran · metamorphic tier: deterministic BSD-3-Clause (permissive) · 69bbd7902f886836 · report fixture: returned MLP · level recorded 2026-09-22
MultimodalOutput torchmultimodal/models/coca/coca_model.py ran · metamorphic tier: deterministic BSD-3-Clause (permissive) · c48e25a9b1ad8b20 · report fixture: returned MultimodalOutput · level recorded 2026-09-22
TransformerOutput in 5 papers torchmultimodal/models/coca/coca_model.py ran · metamorphic tier: deterministic BSD-3-Clause (permissive) · 16907aa066126740 · report fixture: returned TransformerOutput · level recorded 2026-09-22
get_causal_attention_mask torchmultimodal/models/coca/coca_model.py ran · honoured contract BSD-3-Clause (permissive) · e35be5f71f1604be · report fixture: signature tgt_seq_len:int/0/int, src_seq_len:int/0/int · returned Tensor · level recorded 2026-09-22
CoCaModel torchmultimodal/models/coca/coca_model.py unverified BSD-3-Clause (permissive) · c3f20e8434033e06 · report
CoCaMultimodalDecoder torchmultimodal/models/coca/coca_model.py unverified BSD-3-Clause (permissive) · d39521c69dad724c · report
CoCaTextDecoder torchmultimodal/models/coca/coca_model.py unverified BSD-3-Clause (permissive) · 378d7fee25d36766 · report
MultiHeadAttentionWithCache torchmultimodal/models/coca/coca_model.py unverified BSD-3-Clause (permissive) · a73d62315a5ca5ca · report
TransformerDecoder in 49 papers torchmultimodal/models/coca/coca_model.py unverified BSD-3-Clause (permissive) · a241668983092d20 · report
TransformerDecoderLayer in 45 papers torchmultimodal/models/coca/coca_model.py unverified BSD-3-Clause (permissive) · 3624eeb428e322e8 · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for CoCa (graph method: CoCa). 13 bricks; individually on a fixture: 7 ran (of which 5 constructed an object rather than computing a result; 7 with no instrument failure: 1 honoured, 0 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 6 unverified. The assembly has not been run end-to-end.

  1. CoCaModel entry · level 0 · unverified · c3f20e8434033e06
  2. CoCaMultimodalDecoder model · level 0 · unverified · d39521c69dad724c
  3. CoCaTextDecoder model · level 0 · unverified · 378d7fee25d36766
  4. MultimodalOutput helper · level 1 · ran · c48e25a9b1ad8b20
  5. TransformerOutput helper · level 1 · ran · 16907aa066126740
  6. TransformerDecoder helper · level 0 · unverified · a241668983092d20
  7. get_causal_attention_mask helper · level 1 · ran · honoured contract · e35be5f71f1604be
  8. CoCaTextEmbeddings helper · level 1 · ran · 38c836510c2b097d
  9. Fp32LayerNorm helper · level 1 · ran · 1851c02d87765a1f
  10. TransformerDecoderLayer helper · level 0 · unverified · 3624eeb428e322e8
  11. MHAWithCacheOutput helper · level 1 · ran · c3bf9823eb334b94
  12. MLP helper · level 1 · ran · 69bbd7902f886836
  13. MultiHeadAttentionWithCache helper · level 0 · unverified · a73d62315a5ca5ca

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2205.01917") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

Action ClassificationDecoderImage CaptioningImage ClassificationRepresentation LearningRetrievalVideo RetrievalVisual EntailmentVisual Question AnsweringVisual Question Answering (VQA)Visual ReasoningZero-Shot Cross-Modal RetrievalZero-Shot Transfer Image Classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Action Classification Kinetics-400 CoCa (finetuned) Acc@1 88.9 #20 of 207 Archive leaderboard report
Action Classification Kinetics-400 CoCa (frozen) Acc@1 88.0 #28 of 207 Archive leaderboard report
Action Classification Kinetics-600 CoCa (finetuned) Top-1 Accuracy 89.4 #16 of 65 Archive leaderboard report
Action Classification Kinetics-600 CoCa (frozen) Top-1 Accuracy 88.5 #19 of 65 Archive leaderboard report
Action Classification Kinetics-700 CoCa (finetuned) Top-1 Accuracy 82.7 #9 of 36 Archive leaderboard report
Action Classification Kinetics-700 CoCa (frozen) Top-1 Accuracy 81.1 #10 of 36 Archive leaderboard report
Action Classification Moments in Time CoCa (finetuned) Top 1 Accuracy 49.0 #3 of 4 Archive leaderboard report
Action Classification Moments in Time CoCa (frozen) Top 1 Accuracy 47.4 #4 of 4 Archive leaderboard report
Image Captioning COCO Captions CoCa BLEU-4 40.9 #16 of 41 Archive leaderboard report
Image Captioning COCO Captions CoCa CIDER 143.6 #16 of 41 Archive leaderboard report
Image Captioning COCO Captions CoCa METEOR 33.9 #16 of 41 Archive leaderboard report
Image Captioning COCO Captions CoCa SPICE 24.7 #16 of 41 Archive leaderboard report
Image Classification ImageNet CoCa (finetuned) Number of params 2100M #1 of 1060 Archive leaderboard report
Image Classification ImageNet CoCa (finetuned) Top 1 Accuracy 91.0% #1 of 1060 Archive leaderboard report
Image Classification ObjectNet CoCa Top-1 Accuracy 82.7 #1 of 106 Archive leaderboard report
Video Retrieval MSR-VTT CoCa (zero-shot) text-to-video R@1 30.0 #25 of 40 Archive leaderboard report
Video Retrieval MSR-VTT CoCa (zero-shot) text-to-video R@10 61.6 #25 of 40 Archive leaderboard report
Video Retrieval MSR-VTT CoCa (zero-shot) text-to-video R@5 52.4 #25 of 40 Archive leaderboard report
Video Retrieval MSR-VTT CoCa (zero-shot) video-to-text R@1 49.9 #25 of 40 Archive leaderboard report
Video Retrieval MSR-VTT CoCa (zero-shot) video-to-text R@10 81.4 #25 of 40 Archive leaderboard report
Video Retrieval MSR-VTT CoCa (zero-shot) video-to-text R@5 73.4 #25 of 40 Archive leaderboard report
Visual Entailment SNLI-VE test CoCa Accuracy 87.1 #3 of 8 Archive leaderboard report
Visual Entailment SNLI-VE val CoCa Accuracy 87.0 #3 of 9 Archive leaderboard report
Visual Question Answering VQA v2 test-dev CoCa Accuracy 82.3 #2 of 11 Archive leaderboard report
Visual Reasoning NLVR2 Dev CoCa Accuracy 86.1 #5 of 15 Archive leaderboard report
Visual Reasoning NLVR2 Test CoCa Accuracy 87.0 #4 of 14 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval COCO 2014 CoCa Image-to-text R@1 66.3 #9 of 18 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval COCO 2014 CoCa Image-to-text R@10 91.8 #9 of 18 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval COCO 2014 CoCa Image-to-text R@5 86.2 #9 of 18 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval COCO 2014 CoCa Text-to-image R@1 51.2 #9 of 18 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval COCO 2014 CoCa Text-to-image R@10 82.0 #9 of 18 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval COCO 2014 CoCa Text-to-image R@5 74.2 #9 of 18 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval Flickr30k CoCa Image-to-text R@1 92.5 #5 of 22 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval Flickr30k CoCa Image-to-text R@10 99.9 #5 of 22 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval Flickr30k CoCa Image-to-text R@5 99.5 #5 of 22 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval Flickr30k CoCa Text-to-image R@1 80.4 #5 of 22 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval Flickr30k CoCa Text-to-image R@10 97.7 #5 of 22 Archive leaderboard report
Zero-Shot Cross-Modal Retrieval Flickr30k CoCa Text-to-image R@5 95.7 #5 of 22 Archive leaderboard report
Zero-Shot Transfer Image Classification ImageNet CoCa Accuracy (Private) 86.3 #3 of 23 Archive leaderboard report
Zero-Shot Transfer Image Classification ImageNet V2 CoCa Accuracy (Private) 80.7 #3 of 13 Archive leaderboard report
Zero-Shot Transfer Image Classification ImageNet-A CoCa Accuracy (Private) 90.2 #1 of 13 Archive leaderboard report
Zero-Shot Transfer Image Classification ImageNet-R CoCa Accuracy 96.5 #2 of 12 Archive leaderboard report
Zero-Shot Transfer Image Classification ImageNet-Sketch CoCa Accuracy (Private) 77.6 #1 of 7 Archive leaderboard report
Zero-Shot Transfer Image Classification ObjectNet CoCa Accuracy (Private) 82.7 #3 of 9 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

CLIPSimVLM

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