When LLMs are Unfit Use FastFit: Fast and Effective Text Classification with Many Classes (2404.12365v1)
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 LLMs 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.
- Stance classification of context-dependent claims. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 251–261, Valencia, Spain. Association for Computational Linguistics.
- Efficient intent detection with dual sentence encoders. arXiv preprint arXiv:2003.04807.
- Fine-tuning pretrained language models: Weight initializations, data orders, and early stopping.
- Massive: A 1m-example multilingual natural language understanding dataset with 51 typologically-diverse languages.
- SimCSE: Simple contrastive learning of sentence embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6894–6910, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
- A large-scale dataset for argument quality ranking: Construction and analysis.
- Zero-shot topical text classification with LLMs - an experimental study. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 9647–9676, Singapore. Association for Computational Linguistics.
- Mistral 7b.
- Omar Khattab and Matei Zaharia. 2020. Colbert: Efficient and effective passage search via contextualized late interaction over bert.
- Supervised contrastive learning.
- An evaluation dataset for intent classification and out-of-scope prediction. arXiv preprint arXiv:1909.02027.
- Xin Li and Dan Roth. 2002. Learning question classifiers. In COLING 2002: The 19th International Conference on Computational Linguistics.
- Selective in-context data augmentation for intent detection using pointwise v-information. In Conference of the European Chapter of the Association for Computational Linguistics.
- Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. ArXiv, abs/2205.05638.
- Lost in the middle: How language models use long contexts.
- Benchmarking natural language understanding services for building conversational agents. arXiv preprint arXiv:1903.05566.
- Roberta: A robustly optimized bert pretraining approach.
- Making llms worth every penny: Resource-limited text classification in banking. Proceedings of the Fourth ACM International Conference on AI in Finance.
- In-context learning for text classification with many labels. ArXiv, abs/2309.10954.
- Gpt-4 technical report.
- Nils Reimers and Iryna Gurevych. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks.
- Multitask prompted training enables zero-shot task generalization. ArXiv, abs/2110.08207.
- Mpnet: Masked and permuted pre-training for language understanding.
- Ul2: Unifying language learning paradigms.
- Llama 2: Open foundation and fine-tuned chat models.
- Efficient few-shot learning without prompts.
- Finetuned language models are zero-shot learners.
- Huggingface’s transformers: State-of-the-art natural language processing. ArXiv, abs/1910.03771.
- Qaid: Question answering inspired few-shot intent detection.
- Bertscore: Evaluating text generation with bert.
- Revisiting few-sample {bert} fine-tuning. In International Conference on Learning Representations.