Papers › Escaping the Big Data Paradigm with Compact Transformers

Escaping the Big Data Paradigm with Compact Transformers

12 Apr 2021arXiv:2104.05704archive 2025-07-28

Ali Hassani, Steven Walton, Nikhil Shah, Abulikemu Abuduweili, Jiachen Li, Humphrey Shi

With the rise of Transformers as the standard for language processing, and their advancements in computer vision, there has been a corresponding growth in parameter size and amounts of training data. Many have come to believe that because of this, transformers are not suitable for small sets of data. This trend leads to concerns such as: limited availability of data in certain scientific domains and the exclusion of those with limited resource from research in the field. In this paper, we aim to present an approach for small-scale learning by introducing Compact Transformers. We show for the first time that with the right size, convolutional tokenization, transformers can avoid overfitting and outperform state-of-the-art CNNs on small datasets. Our models are flexible in terms of model size, and can have as little as 0.28M parameters while achieving competitive results. Our best model can reach 98% accuracy when training from scratch on CIFAR-10 with only 3.7M parameters, which is a significant improvement in data-efficiency over previous Transformer based models being over 10x smaller than other transformers and is 15% the size of ResNet50 while achieving similar performance. CCT also outperforms many modern CNN based approaches, and even some recent NAS-based approaches. Additionally, we obtain a new SOTA result on Flowers-102 with 99.76% top-1 accuracy, and improve upon the existing baseline on ImageNet (82.71% accuracy with 29% as many parameters as ViT), as well as NLP tasks. Our simple and compact design for transformers makes them more feasible to study for those with limited computing resources and/or dealing with small datasets, while extending existing research efforts in data efficient transformers. Our code and pre-trained models are publicly available at https://github.com/SHI-Labs/Compact-Transformers.

PaperPDFCodeCode 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="2104.05704")

Code

Syntology Ran 3 of 6 code samples harvested from 2 repositories linked to this paper; 3 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · fixture could not drive it.

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

SHI-Labs/Compact-Transformers officialmentioned in papermentioned on GitHubpytorch report
ahmedelmahy/myownvit mentioned on GitHubpytorch report
brohrer/sharpened-cosine-similarity mentioned on GitHubjaxMIT report
rishikksh20/compact-convolution-transformer mentioned on GitHubpytorchMIT report
stevenwalton/scs-cct mentioned on GitHubpytorch 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

6 samples harvested; 3 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
2ran · fixture could not drive it
3unverified

Licence: 1 of the 6 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. “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.

accuracy stevenwalton/scs-cct/examples/evaluate.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · d5edbca041111ce3 · report
cls_validate stevenwalton/scs-cct/examples/evaluate.py community (archive-listed) ran · honoured contract Apache-2.0 (permissive) · 3bca64f194bf9a4c · report
scaled_dot_product_attention Ryul0rd/compact-convolutional-transformer/compact_conv_transformer.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · f35b452496f8552c · report
cct_2 stevenwalton/scs-cct/src/cct.py community (archive-listed) unverified Apache-2.0 (permissive) · 66362160f2422779 · report
cct_4 stevenwalton/scs-cct/src/cct.py community (archive-listed) unverified Apache-2.0 (permissive) · 00acf5cbe25911ad · report
cct_6 stevenwalton/scs-cct/src/cct.py community (archive-listed) unverified Apache-2.0 (permissive) · b2d66a4b96979e50 · report

Tasks

Fine-Grained Image ClassificationImage ClassificationSuperpixel Image Classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Fine-Grained Image Classification Oxford 102 Flowers CCT-14/7x2 FLOPS 15G #24 of 25 Archive leaderboard report
Fine-Grained Image Classification Oxford 102 Flowers CCT-14/7x2 PARAMS 22.5M #24 of 25 Archive leaderboard report
Image Classification CIFAR-10 CCT-7/3x1* Percentage correct 98 #60 of 265 Archive leaderboard report
Image Classification CIFAR-10 CCT-6/3x1 Percentage correct 95.29 #139 of 265 Archive leaderboard report
Image Classification CIFAR-100 CCT-7/3x1* Percentage correct 82.72 #98 of 211 Archive leaderboard report
Image Classification CIFAR-100 CCT-6/3x1 PARAMS 3.17M #142 of 211 Archive leaderboard report
Image Classification CIFAR-100 CCT-6/3x1 Percentage correct 77.31 #142 of 211 Archive leaderboard report
Image Classification Flowers-102 CCT-14/7x2 Accuracy 99.76 #1 of 52 Archive leaderboard report
Image Classification ImageNet CCT-14/7x2 GFLOPs 11.06 #1056 of 1060 Archive leaderboard report
Image Classification ImageNet CCT-14/7x2 Number of params 22.36M #1056 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

Absolute Position EncodingsCCTConvolutionDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerTransformer

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