Papers › CoAtNet: Marrying Convolution and Attention for All Data Sizes

CoAtNet: Marrying Convolution and Attention for All Data Sizes

9 Jun 2021NeurIPS 2021 12arXiv:2106.04803archive 2025-07-28

Zihang Dai, Hanxiao Liu, Quoc V. Le, Mingxing Tan

Transformers have attracted increasing interests in computer vision, but they still fall behind state-of-the-art convolutional networks. In this work, we show that while Transformers tend to have larger model capacity, their generalization can be worse than convolutional networks due to the lack of the right inductive bias. To effectively combine the strengths from both architectures, we present CoAtNets(pronounced "coat" nets), a family of hybrid models built from two key insights: (1) depthwise Convolution and self-Attention can be naturally unified via simple relative attention; (2) vertically stacking convolution layers and attention layers in a principled way is surprisingly effective in improving generalization, capacity and efficiency. Experiments show that our CoAtNets achieve state-of-the-art performance under different resource constraints across various datasets: Without extra data, CoAtNet achieves 86.0% ImageNet top-1 accuracy; When pre-trained with 13M images from ImageNet-21K, our CoAtNet achieves 88.56% top-1 accuracy, matching ViT-huge pre-trained with 300M images from JFT-300M while using 23x less data; Notably, when we further scale up CoAtNet with JFT-3B, it achieves 90.88% top-1 accuracy on ImageNet, establishing a new state-of-the-art result.

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="2106.04803")

Code

Syntology Ran 2 of 5 code samples harvested from 2 repositories linked to this paper; 3 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · our draft was wrong.

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

14 repositories listed; official and paper-mentioned ones first.

Burf/CoAtNet-Tensorflow2 mentioned on GitHubtfMIT report
LongLeCE/CoAtNet-PyTorch mentioned on GitHubpytorch report
chinhsuanwu/coatnet-pytorch mentioned on GitHubpytorch report
nqt228/CoAtNet-tensorflow mentioned on GitHubtf report
pranavsinghps1/dedl mentioned on GitHubpytorch report
rwightman/pytorch-image-models mentioned on GitHubpytorch report
hw666666666666/CoAtNet mindsporeNOASSERTION 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

5 samples harvested; 2 ran; 1 honoured the contract we drafted; 3 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.

1ran · honoured contract
1ran · our draft was wrong
3unverified

Licence: 1 of the 5 samples is 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. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “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.

conv_3x3_bn chinhsuanwu/coatnet-pytorch/coatnet.py community (archive-listed) ran · our draft was wrong MIT (permissive) · c825b672e6f0b3bc · report
coatnet Burf/CoAtNet-Tensorflow2/coatnet/coatnet.py community (archive-listed) unverified MIT (permissive) · 8aeee8782df9ac39 · report
coatnet0 Burf/CoAtNet-Tensorflow2/coatnet/coatnet.py community (archive-listed) unverified MIT (permissive) · 9dbc2c10a3104a03 · report
coatnet1 Burf/CoAtNet-Tensorflow2/coatnet/coatnet.py community (archive-listed) unverified MIT (permissive) · db9a51f9739f40ea · report
count_parameters identical code first harvested elsewhere ran · honoured contract licence of this copy not recorded · f6b944f50d3f15ae · report

Tasks

AllImage ClassificationInductive Bias

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification GasHisSDB CoAtNet-1 Accuracy 98.74 #1 of 8 Archive leaderboard report
Image Classification GasHisSDB CoAtNet-1 F1-Score 99.38 #1 of 8 Archive leaderboard report
Image Classification GasHisSDB CoAtNet-1 Precision 99.97 #1 of 8 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 @384 GFLOPs 114 #40 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 @384 Top 1 Accuracy 88.52% #40 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 (21k) Top 1 Accuracy 87.6% #78 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 (21k) Top 1 Accuracy 87.1% #103 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 GFLOPs 34.7 #314 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 Number of params 168M #314 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 Top 1 Accuracy 84.5% #314 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 GFLOPs 15.7 #358 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 Number of params 75M #358 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 Top 1 Accuracy 84.1% #358 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-1 GFLOPs 8.4 #443 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-1 Number of params 42M #443 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-1 Top 1 Accuracy 83.3% #443 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-0 GFLOPs 4.2 #627 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-0 Number of params 25M #627 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-0 Top 1 Accuracy 81.6% #627 of 1060 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

ConvolutionDepthwise Convolution

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