Home / Insights / AI and Machine Learning
AI and Machine Learning
Classic NLP Models or LLMs for Text Classification and Extraction? A Practical Decision Guide
Large language models can classify tickets and extract fields with almost no training data, but they are not always the best tool. This guide compares rules, fine-tuned classic models and LLMs for classification and extraction, and explains how to combine them.
TopicsAI and Machine LearningGenerative AI and LLMsSoftware Costs and Budgets
Key takeaways
- Rules and patterns remain the right answer for rigid formats such as order numbers, dates and reference codes.
- Fine-tuned smaller models are fast, cheap and consistent for stable, well-defined categories with enough labelled examples.
- LLMs handle nuance, new categories and messy text with little training data, at higher per-item cost and latency.
- Hybrid pipelines are common: rules first, a classic model for the bulk, an LLM for uncertain or novel cases, and people for low-confidence items.
- Decide with an evaluation set from your own data, not with general benchmarks.
On this page
Before large language models, building a text classifier meant collecting and labelling thousands of examples, training a model and maintaining it. Now a team can describe categories in a prompt and get reasonable results the same day. That has led many organisations to send every classification and extraction task to an LLM by default.
Sometimes that is the right call. Often it is more expensive, slower and less consistent than it needs to be. PoliteTech’s NLP work combines classic techniques with language models: classic models are fast and cheap for well-defined tasks, while language models handle nuance and new categories. This article explains how we choose between them for the most common jobs, such as routing emails and tickets, tagging documents and pulling fields from free text. If you need background on how the models themselves work, see transformers and language models explained for product teams.
The three main options
Rules and patterns
Regular expressions, keyword lists, lookup tables and pattern matchers. They are transparent, cost almost nothing to run and behave identically every time. They work well for structured fragments inside text: order numbers, postcodes, dates, currency amounts, known product codes. They break down when the same meaning is expressed in many different ways.
Fine-tuned classic models
Smaller models, often transformer-based encoders such as DistilBERT or statistical pipelines such as spaCy, trained on labelled examples of your categories or entities. The Hugging Face text classification guide, for example, fine-tunes DistilBERT on labelled reviews with a classification head and evaluates accuracy on a held-out set. Once trained, these models are fast, cheap to run at volume, can run in your own environment, and return consistent outputs with confidence scores.
spaCy’s statistical named entity recogniser is another example: it labels spans such as organisations, places and monetary values, and its documentation notes that new entity classes can be added and the model updated with examples, but that results are not always perfect and may need tuning for your use case.
Large language models
General-purpose models prompted with instructions, category definitions and a few examples, often asked to return structured output. They understand context, sarcasm, mixed languages and unusual phrasing, and they can handle categories you add tomorrow without retraining. They cost more per item, respond more slowly, and their outputs can vary between runs unless carefully constrained.
How they compare
| Factor | Rules | Fine-tuned classic model | LLM |
|---|---|---|---|
| Labelled data needed | None, but expert time to write rules | Hundreds to thousands of examples per task | A few examples and clear definitions |
| Handling nuance and new phrasing | Poor | Good within trained categories | Strong |
| Adding a new category | Write new rules | Label data and retrain | Update the prompt and re-evaluate |
| Cost per item at volume | Negligible | Low | Higher, scales with text length |
| Latency | Very low | Low | Higher |
| Consistency | Deterministic | Deterministic for a given model | Can vary; needs constraints and validation |
| Explainability | High | Moderate | Explanations available but not guaranteed faithful |
| Private deployment | Easy | Easy | Possible with open models; more infrastructure |
Matching the approach to the task
| Task | Usually best starting point | Reason |
|---|---|---|
| Extracting order numbers, dates, amounts | Rules, with model fallback | Formats are predictable; rules are exact |
| Routing support tickets into stable categories at high volume | Fine-tuned classic model | Cheap, fast, consistent once trained on historical tickets |
| Detecting urgency or priority | Classic model or LLM | Depends on how subtle the signals are and how much labelled history exists |
| Tagging feedback into themes that change over time | LLM | Categories evolve; nuance matters |
| Extracting clauses and obligations from contracts | LLM with validation and review | Long, varied language; errors are costly, so people review |
| Low-volume classification with no labelled data | LLM | Training a model is not worth it |
| Very high volume, cost-sensitive, stable | Classic model, possibly trained on LLM-labelled data | Moves per-item cost down once categories settle |
A useful pattern for the last row is to use an LLM to pre-label a large set of historical items, have people correct a sample, then train a smaller model on the result. You get the LLM’s flexibility during development and the classic model’s economics in production.
Hybrid pipelines in practice
Most production systems we build combine approaches in a cascade. For example, a team routing inbound customer emails might use:
- Rules to extract order numbers and detect known senders such as courier notifications.
- A fine-tuned classifier to assign the main category and return a confidence score.
- An LLM only for emails where the classifier’s confidence is low, the text is in an unexpected language, or the category looks new.
- Human review for items that remain uncertain after the LLM, which also creates new labelled examples.
This matches the processing stages PoliteTech uses for NLP work: ingestion, processing (cleaning, language detection and model-based analysis), validation with confidence scores and review for uncertain items, and delivery into CRMs, helpdesks, databases or dashboards. The cascade keeps cost and latency low for the bulk of traffic while preserving quality on the hard cases. For the cost side of LLM usage, see reducing LLM token and cloud costs.
Deciding with your own data
General benchmarks say little about your categories, your customers’ language or your documents. Build a decision on a small, representative evaluation set:
- Collect a few hundred real items per task, covering common and awkward cases.
- Have two people label them independently; disagreements reveal unclear category definitions to fix before any model work.
- Run each candidate approach and measure precision and recall per category, not just overall accuracy. A routing model that is accurate overall but misses most urgent complaints is not acceptable.
- Measure cost and latency per item at your expected volume.
- Check behaviour on the languages you need; accuracy should be tested per language.
Keep the evaluation set and rerun it whenever you change a prompt, retrain a model or add a category. Our MLOps and LLMOps guide covers how to manage this in production.
Common pitfalls
- Vague categories. If people disagree on labels, no model will do well. Fix definitions first.
- Ignoring confidence. Every approach should return a confidence or validation signal so uncertain items can go to review.
- Unvalidated LLM output. Require structured output and validate it in code; reject or retry anything outside allowed values.
- Drift. Products, policies and customer language change. Monitor category distributions and sample items regularly.
- Over-engineering early. For a first version at low volume, an LLM with good evaluation is often the fastest route to value. Optimise once volume and categories stabilise.
If you are deciding how to approach a classification or extraction problem, PoliteTech’s natural language processing service can run a short comparison on your own data before you commit to an architecture.
Frequently asked questions
Are LLMs always more accurate than fine-tuned models for classification?
No. For stable, well-defined categories with enough labelled data, a fine-tuned smaller model can match or outperform an LLM while being faster and cheaper. Test both on your own evaluation set.
How much labelled data does a fine-tuned classifier need?
It depends on the number of categories and how distinct they are. Many teams start with a few hundred examples per category and add more where errors concentrate. LLM pre-labelling with human correction can speed this up.
Can we run these models in our own environment?
Yes. Rules and classic models run easily on your own infrastructure, and open language models can also be deployed privately when data cannot leave your environment.
What about languages other than English?
Both classic models and LLMs support many languages, but quality varies. Measure accuracy separately for each language you need, including Vietnamese or other Asian languages where tokenisation and training data differ.
Sources and methodology
Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.
- Hugging Face Transformers: Text classification task guide — Supported the description of fine-tuning a DistilBERT classifier on labelled examples and evaluating with accuracy on held-out data.
- spaCy: Linguistic Features (named entity recognition) — Supported the description of statistical NER, adding new entity classes and the note that results may need tuning for specific use cases.
Related reading
Continue your research
Should your text classification run on an LLM or a smaller model?
We can benchmark rules, classic models and LLMs on a sample of your emails, tickets or documents and recommend a pipeline.
