Adaptable and Reliable Text Classification using Large Language Models
Zhiqiang Wang, Yiran Pang, Yanbin Lin, Xingquan Zhu
TL;DR
This work addresses the challenge of adaptable and reliable text classification across diverse domains by leveraging Large Language Models (LLMs) as the core classifier. It introduces a streamlined, domain-agnostic pipeline that supports zero-shot, few-shot prompting or fine-tuning, with optional domain knowledge and an evaluation subsystem, plus a novel Uncertainty/Error Rate ($U/E$) metric alongside standard $ACC$ and $F1$. Across four varied datasets, LLMs often outperform traditional ML and NN baselines, with fine-tuned LLMs (notably Qwen-7B(F)) achieving top performance and dramatically reducing unreliability. The findings suggest LLM-based classification can be deployed with reduced preprocessing and domain expertise, offering practical benefits for small businesses and broad NLP applications, while also highlighting limitations related to outputs, accessibility, and compute requirements.
Abstract
Text classification is fundamental in Natural Language Processing (NLP), and the advent of Large Language Models (LLMs) has revolutionized the field. This paper introduces an adaptable and reliable text classification paradigm, which leverages LLMs as the core component to address text classification tasks. Our system simplifies the traditional text classification workflows, reducing the need for extensive preprocessing and domain-specific expertise to deliver adaptable and reliable text classification results. We evaluated the performance of several LLMs, machine learning algorithms, and neural network-based architectures on four diverse datasets. Results demonstrate that certain LLMs surpass traditional methods in sentiment analysis, spam SMS detection, and multi-label classification. Furthermore, it is shown that the system's performance can be further enhanced through few-shot or fine-tuning strategies, making the fine-tuned model the top performer across all datasets. Source code and datasets are available in this GitHub repository: https://github.com/yeyimilk/llm-zero-shot-classifiers.
