Abstract
We present FastFit, a Python package designed to provide fast and accurate few-shot classification, especially for scenarios with many semantically similar classes. FastFit utilizes a novel approach integrating batch contrastive learning and token-level similarity score. Compared to existing few-shot learning packages, such as SetFit, Transformers, or few-shot prompting of large language models via API calls, FastFit significantly improves multi-class classification performance in speed and accuracy across various English and Multilingual datasets. FastFit demonstrates a 3-20x improvement in training speed, completing training in just a few seconds. The FastFit package is now available on GitHub, presenting a user-friendly solution for NLP practitioners.- Anthology ID:
- 2024.naacl-demo.18
- Volume:
- Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 3: System Demonstrations)
- Month:
- June
- Year:
- 2024
- Address:
- Mexico City, Mexico
- Editors:
- Kai-Wei Chang, Annie Lee, Nazneen Rajani
- Venue:
- NAACL
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 174–184
- Language:
- URL:
- https://aclanthology.org/2024.naacl-demo.18
- DOI:
- Cite (ACL):
- Asaf Yehudai and Elron Bandel. 2024. FastFit: Fast and Effective Few-Shot Text Classification with a Multitude of Classes. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 3: System Demonstrations), pages 174–184, Mexico City, Mexico. Association for Computational Linguistics.
- Cite (Informal):
- FastFit: Fast and Effective Few-Shot Text Classification with a Multitude of Classes (Yehudai & Bandel, NAACL 2024)
- PDF:
- https://preview.aclanthology.org/naacl24-info/2024.naacl-demo.18.pdf