Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact Transformer #20133

Open
2 tasks done
astariul opened this issue Nov 9, 2022 · 2 comments
Open
2 tasks done

Compact Transformer #20133

astariul opened this issue Nov 9, 2022 · 2 comments

Comments

@astariul
Copy link
Contributor

astariul commented Nov 9, 2022

Model description

Escaping the Big Data Paradigm with Compact Transformers

Abstract :

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.

Open source status

  • The model implementation is available
  • The model weights are available

Provide useful links for the implementation

Paper : https://arxiv.org/pdf/2104.05704.pdf
Github repository : https://github.com/SHI-Labs/Compact-Transformers

@navinelahi
Copy link

Are you willing to collaborate to make this available at HF transformers? @astariul . If so, please connect with me

@atharvakavitkar
Copy link

atharvakavitkar commented Apr 5, 2023

Hi @astariul and @navinelahi, are there any updates on this issue? May I start working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants