Core Concepts
FastFit, a novel method and Python package, provides fast and accurate few-shot text classification, especially for scenarios with many semantically similar classes, by integrating batch contrastive learning and token-level similarity score.
Abstract
The content presents FastFit, a method and Python package designed for fast and accurate few-shot text classification, particularly in scenarios with many semantically similar classes.
Key highlights:
- FastFit utilizes a novel approach that integrates batch contrastive learning and token-level similarity score to encode texts and class names into a shared embedding space.
- Experiments on the newly curated FewMany benchmark demonstrate that FastFit significantly outperforms existing few-shot learning packages, such as SetFit, Transformers, and few-shot prompting of large language models, in both speed and accuracy.
- FastFit achieves a 3-20x improvement in training speed, completing training in just a few seconds.
- The FastFit package is now available on GitHub and PyPi, providing a user-friendly solution for NLP practitioners.
- FastFit also exhibits strong performance on full-data training, outperforming larger classifiers.
- Ablation studies show the benefits of token-level similarity metrics and data augmentation techniques used in FastFit.
Stats
FastFit training is 3-20x faster than SetFit and standard classifiers.
FastFit achieves state-of-the-art results on the FewMany benchmark within 30 seconds of training.
Quotes
"FastFit significantly improves multi-class 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."