Skip to main content
QUICK REVIEW

[Paper Review] Large Language Models Are Zero-Shot Text Classifiers

Zhiqiang Wang, Yiran Pang|arXiv (Cornell University)|Dec 2, 2023
Topic ModelingComputer Science16 citations
TL;DR

The paper assesses zero-shot text classification performance of GPT-based models and other baselines across multiple datasets, showing LLMs can function as zero-shot classifiers in three of four tasks.

ABSTRACT

Retrained large language models (LLMs) have become extensively used across various sub-disciplines of natural language processing (NLP). In NLP, text classification problems have garnered considerable focus, but still faced with some limitations related to expensive computational cost, time consumption, and robust performance to unseen classes. With the proposal of chain of thought prompting (CoT), LLMs can be implemented using zero-shot learning (ZSL) with the step by step reasoning prompts, instead of conventional question and answer formats. The zero-shot LLMs in the text classification problems can alleviate these limitations by directly utilizing pretrained models to predict both seen and unseen classes. Our research primarily validates the capability of GPT models in text classification. We focus on effectively utilizing prompt strategies to various text classification scenarios. Besides, we compare the performance of zero shot LLMs with other state of the art text classification methods, including traditional machine learning methods, deep learning methods, and ZSL methods. Experimental results demonstrate that the performance of LLMs underscores their effectiveness as zero-shot text classifiers in three of the four datasets analyzed. The proficiency is especially advantageous for small businesses or teams that may not have extensive knowledge in text classification.

Motivation & Objective

  • Evaluate zero-shot text classification using GPT, Llama2, GPT-3.5, and GPT-4 across multiple datasets.
  • Compare zero-shot LLMs with traditional ML, DL, and ZSL methods under standardized prompts and inputs.
  • Provide practical insights for small teams to deploy zero-shot text classification.
  • Open-source the codebase to enable reproducibility and community impact.

Proposed method

  • Describe traditional text classification workflow and contrast with zero-shot prompting using GPT models.
  • Standardize prompts and sampling parameters (temperature=0.01, top_p=0.9) across LLM experiments.
  • Use raw test data for LLMs while traditional ML/DL models use standardized preprocessed input.
  • Evaluate models on four datasets: COVID-19 tweets, economic text, e-commerce text, and SMS spam.
  • Compare with MNB, LG, RF, DT, KNN, RNN, LSTM, GRU, BART, DeBERTa, and LLMs (Llama2, GPT-3.5, GPT-4).
  • Report ACC, F1, and AUC metrics and analyze zero-shot performance.
Figure 1: Traditional text classification flow
Figure 1: Traditional text classification flow

Experimental results

Research questions

  • RQ1Can zero-shot LLMs achieve competitive text classification performance relative to traditional ML/DL methods?
  • RQ2How do zero-shot LLMs compare to ZSL baselines on sentiment, topic, and spam tasks?
  • RQ3What prompting and input-processing choices maximize zero-shot text classification performance?
  • RQ4Are LLMs more advantageous for small teams or businesses with limited labeling capabilities?
  • RQ5What are the limitations and biases observed in zero-shot LLM classifications across datasets?

Key findings

  • LLMs achieve strong performance as zero-shot text classifiers in three out of four datasets.
  • GPT-4 generally outperforms other baselines across datasets, especially in economic text and SMS tasks.
  • Llama2 and GPT-3.5 show strengths in sentiment analysis and e-commerce classification, while LLMs lag behind in some COVID-19 sentiment cases.
  • Traditional ML methods often underperform compared to DL and LLM-based zero-shot approaches in several tasks.
  • Prompting strategy and data preprocessing (e.g., cleaning tweets) significantly affect model outputs and accuracy.
  • Open-sourced code and standardized evaluation enable reproducibility and broader adoption.
Figure 2: LLMs’ zero shot text classification flow
Figure 2: LLMs’ zero shot text classification flow

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.