When LLMs are Unfit Use FastFit: Fast and Effective Text Classification with Many Classes

  • 2024-04-18 18:48:05
  • Asaf Yehudai, Elron Bendel
  • 0

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.

 

Quick Read (beta)

loading the full paper ...