Abstract
We present FastFit, a method, and a Python package design to provide fast andaccurate few-shot classification, especially for scenarios with manysemantically similar classes. FastFit utilizes a novel approach integratingbatch contrastive learning and token-level similarity score. Compared toexisting few-shot learning packages, such as SetFit, Transformers, or few-shotprompting of large language models via API calls, FastFit significantlyimproves multiclass classification performance in speed and accuracy acrossFewMany, our newly curated English benchmark, and Multilingual datasets.FastFit demonstrates a 3-20x improvement in training speed, completing trainingin just a few seconds. The FastFit package is now available on GitHub and PyPi,presenting a user-friendly solution for NLP practitioners.