Classification predicts a discrete label for each input—text, images, audio, or any data you can describe in a prompt.

Classification Types

TypeExampleOutputUse Cases
Binaryspam / not-spam, approve / rejectSingle label (2 options)Content moderation, fraud detection, A/B testing
Multi-Classnews topic → Politics / Sports / TechSingle label (3+ options)Document routing, sentiment analysis, intent detection
Multi-Labelarticle tags → AI + Healthcare + EthicsMultiple labelsProduct tagging, skill extraction, content categorization

Why Use LLMs for Classification?

Why LLMs for Classification?

  • Zero-shot: No training data needed—just describe your labels and go. Great for quick prototyping and new domains.
  • Few-shot: Add 2–5 examples to boost accuracy, especially for niche or tricky cases.
  • Multilingual: One model, all languages. Handles code-switching and mixed content out of the box.
  • Reasoning: Understands nuance, context, and even sarcasm. Can explain its decisions if you need transparency.

Common Use Cases

DomainTaskTraditional ML ChallengeLLM Advantage
Customer SupportIntent classificationRequires large labeled datasetWorks with just intent descriptions
Content ModerationToxicity detectionStruggles with context/sarcasmUnderstands nuanced harmful content
E-commerceProduct categorizationNeeds product-specific trainingGeneralizes across product types
HR/RecruitingResume screeningBiased on historical dataCan focus on skills vs. demographics
FinanceDocument classificationRegulatory compliance complexityAdapts to new regulations quickly
HealthcareSymptom triageRequires medical expertiseLeverages medical knowledge from training

When to Use LLMs vs. Traditional ML

Choose LLMs when:

  • Limited labeled data (< 1,000 examples)
  • Rapid iteration needed on label definitions
  • Complex reasoning required (context, tone, implications)
  • Multilingual support needed
  • Explainable decisions are important

Choose Traditional ML when:

  • Massive labeled datasets available (> 10,000 examples)
  • Ultra-low latency required (< 10ms)
  • Extreme cost sensitivity (millions of predictions/day)
  • Simple pattern matching sufficient

Hybrid Approach: LLM → Small Model Distillation

  1. Use LLM to generate training data and initial predictions
  2. Fine-tune a smaller, faster model on LLM outputs
  3. Get 80-90% of LLM accuracy at 10x lower cost/latency

Need multiple labels per input? See our Multi-Label guide for handling non-exclusive categories.