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

Asaf Yehudai, Elron Bendel
4/18/2024
cs.CLcs.AIcs.IR

No official code found. Best implementation: IBM/fastfit (220 stars, Apache-2.0, last commit 2025-09-18).

Abstract

We present FastFit, a method, and a Python package design 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 multiclass classification performance in speed and accuracy across FewMany, our newly curated English benchmark, 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 and PyPi, presenting a user-friendly solution for NLP practitioners.

View on arXivView PDF

Code Implementations(1)

IBM/fastfitCommunity100%
Apache-2.0

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

22023PythonJan 18, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{yehudai2024when,
  title  = {When LLMs are Unfit Use FastFit: Fast and Effective Text Classification with Many Classes},
  author = {Asaf Yehudai and Elron Bendel},
  year   = {2024},
  eprint = {2404.12365},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.12365v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.12365.svg)](https://codeofpaper.com/paper/2404.12365)

Discussion