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 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

No sample from the archive's official repository (SHI-Labs/Compact-Transformers) is linked to this paper; the 6 samples below come from 2 community repositories. Syntology harvested code from SHI-Labs/Compact-Transformers for another paper.

SHI-Labs/Compact-Transformers: Syntology's graph links these samples to An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (arXiv:2010.11929; that paper's own run record: 307 ran (of which 165 constructed an object rather than computing a result; 286 with no instrument failure: 8 honoured, 2 violated, 276 with no contract checked; 21 where Syntology's instrument failed) · 112 unverified); nothing checks that they implement this paper's method.

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

By repository: community (archive-listed): 6 samples from 2 repositories, 3 ran (1 with no instrument failure; 2 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 3 of its repositories that Syntology harvested for other papers:

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

SHI-Labs/Compact-Transformers officialmentioned in papermentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (arXiv:2010.11929; that paper's own run record: 307 ran (of which 165 constructed an object rather than computing a result; 286 with no instrument failure: 8 honoured, 2 violated, 276 with no contract checked; 21 where Syntology's instrument failed) · 112 unverified); nothing checks that they implement this paper's method. report
Ryul0rd/compact-convolutional-transformer mentioned on GitHubpytorchSyntology: 1 sample, 1 ran (1 instrument-failed) · 0 unverified report
Shreyas-Bhat/CompactTransformers mentioned on GitHubSyntology: not harvested report
ahmedelmahy/myownvit mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet (arXiv:2101.11986; that paper's own run record: 21 ran (of which 16 constructed an object rather than computing a result; 21 with no instrument failure: 1 honoured, 0 violated, 20 with no contract checked; 0 where Syntology's instrument failed) · 5 unverified), CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification (arXiv:2103.14899; that paper's own run record: 17 ran (of which 10 constructed an object rather than computing a result; 17 with no instrument failure: 0 honoured, 1 violated, 16 with no contract checked; 0 where Syntology's instrument failed) · 9 unverified), CvT: Introducing Convolutions to Vision Transformers (arXiv:2103.15808; that paper's own run record: 39 ran (of which 19 constructed an object rather than computing a result; 36 with no instrument failure: 2 honoured, 0 violated, 34 with no contract checked; 3 where Syntology's instrument failed) · 8 unverified) and 2 more (every one in this page's JSON twin); nothing checks that they implement this paper's method. report
brohrer/sharpened-cosine-similarity mentioned on GitHubjaxMITSyntology: not harvested report
rishikksh20/compact-convolution-transformer mentioned on GitHubpytorchMITSyntology: not harvested report
stevenwalton/scs-cct mentioned on GitHubpytorchSyntology: 5 samples, 2 ran (1 instrument-failed) · 3 unverified report
2024-MindSpore-1/Code7 mindsporeSyntology: not harvested report
keras-team/keras-io tfSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to The Forward-Forward Algorithm: Some Preliminary Investigations (arXiv:2212.13345; that paper's own run record: 18 ran (of which 0 constructed an object rather than computing a result; 11 with no instrument failure: 0 honoured, 2 violated, 9 with no contract checked; 7 where Syntology's instrument failed) · 2 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

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

1ran · honoured contract
2ran; the contract check could not run
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; 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”. “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. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

Ryul0rd/compact-convolutional-transformer community (archive-listed) 1 sample, 1 ran (1 instrument-failed) · 0 unverified
scaled_dot_product_attention in 43 papers compact_conv_transformer.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted no licence file found · pointer only · f35b452496f8552c · report fixture: signature q:Tensor/3/float, k:Tensor/3/float, v:Tensor/3/float · returned Tensor · level recorded 2026-09-22
stevenwalton/scs-cct community (archive-listed) 5 samples, 2 ran (1 instrument-failed) · 3 unverified
accuracy in 872 papers
census: 8 implementations from 7 papers, 7 distinct outputs across 6 buckets, one shared input per bucket
examples/evaluate.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted Apache-2.0 (permissive) · d5edbca041111ce3 · report fixture: signature output:Tensor/2/float, target:Tensor/1/int · returned list · level recorded 2026-09-22
cls_validate examples/evaluate.py ran · honoured contract Apache-2.0 (permissive) · 3bca64f194bf9a4c · report fixture: signature val_loader:list/1/tuple, model:callable/0/?, args:Args/0/?, time_begin:NoneType/0/? · returned float · level recorded 2026-09-22
cct_2 src/cct.py unverified Apache-2.0 (permissive) · 66362160f2422779 · report
cct_4 src/cct.py unverified Apache-2.0 (permissive) · 00acf5cbe25911ad · report
cct_6 src/cct.py 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