A team building a customer-feedback dashboard reaches for an LLM to score sentiment on every review. It works in the demo. Then the bill arrives, the latency spikes past two seconds per call, and the scores wobble between runs on identical text. The mistake was upstream of the model: sentiment analysis was scoped as a generation problem when it is a classification problem. That scoping error is common precisely because sentiment analysis and generative AI both touch text. The surface similarity hides a structural difference. A generative model produces new text conditioned on a prompt. A sentiment model maps input text to a fixed label — positive, negative, neutral, or a score on a continuous scale. The first is a generation task; the second is a supervised prediction task. Confusing the two is where the cost, latency, and reliability problems begin. Is sentiment analysis a generative AI task or a predictive one? It is predictive. A sentiment analyser takes a piece of text and returns a category or a number. There is a correct answer for any given input — a labelled dataset can say this review is negative, that one is positive — and the model’s job is to reproduce those labels on text it has not seen. That is the definition of supervised classification (or regression, if the output is a continuous polarity score). Generation is a different shape of problem. When you ask a large language model to write, summarise, or reason, there is no single correct output, and the model samples from a distribution over possible continuations. That flexibility is exactly what you do not want when scoring sentiment. You want the same input to produce the same score every time, so downstream analytics stay stable and any drift you observe is real drift in the data rather than noise from the model. This is the divergence point that matters. Reach for a generative model to classify sentiment and you inherit properties you did not ask for: non-determinism unless you pin temperature to zero, multi-second round-trips, per-token billing, and outputs you have to parse and validate because the model might answer “This review seems fairly positive overall” instead of a clean label. A supervised classifier or a fine-tuned encoder sidesteps all of that. This is the same scoping discipline we apply across machine learning approaches to sentiment analysis — decide what kind of problem you have before you decide which model solves it. How machine learning approaches to sentiment analysis actually work There is a spectrum of techniques, and they trade accuracy against cost and data requirements. Understanding where each fits keeps you from over-engineering a problem that a smaller model already solves. At the lightest end sit lexicon methods — VADER, SentiWordNet, and similar rule-and-dictionary approaches. They assign polarity scores to words and aggregate them. No training data required, they run in microseconds, and they are surprisingly hard to beat on short, direct text like tweets or star-review snippets. Their weakness is context: negation, sarcasm, and domain-specific language (“this drug had no adverse effects” reads negative to a naive lexicon) trip them up. Next come classical supervised classifiers — logistic regression, linear SVMs, or gradient-boosted trees over TF-IDF or bag-of-words features. Trained on a few thousand labelled examples, they are cheap to run, easy to interpret, and often within a few points of far heavier models on in-domain text. In our experience, a well-tuned linear model over TF-IDF features is the pragmatic default for a bounded domain — it is fast, auditable, and the failure modes are legible (observed pattern across engagements, not a benchmarked figure). At the heavy end sit fine-tuned transformer encoders — a BERT, RoBERTa, or DistilBERT model with a classification head, fine-tuned on your labelled data. These capture context, negation, and nuance that lexicons and bag-of-words models miss, and they set the accuracy bar for most sentiment tasks. A distilled encoder still runs comfortably under 100ms on a single GPU and often on CPU, which is why it, not an LLM, is the right tool when accuracy matters and latency budgets are tight. The sentiment analysis with deep learning path is where this fits, and it is where most production systems land. Approach comparison: lexicon vs classical ML vs fine-tuned encoder vs LLM Approach Training data needed Typical latency Relative cost/inference Context handling Best fit Lexicon (VADER, SentiWordNet) None Microseconds Negligible Weak (misses negation, sarcasm) Short, direct text; cold-start baseline Classical ML (LogReg/SVM + TF-IDF) ~1k–10k labels Sub-millisecond Very low Moderate Bounded, stable domain; auditability matters Fine-tuned encoder (BERT/RoBERTa/DistilBERT) ~5k–50k labels Typically <100ms Low Strong Accuracy-critical, latency-bound production LLM prompt (GPT-class) None (zero/few-shot) Multi-second High (per-token) Strong Prototyping; novel domains with no labels Latency and cost figures are order-of-magnitude planning heuristics for CPU/single-GPU deployments, not a published benchmark. When should you use a classifier versus calling an LLM? Use a lightweight classifier when the domain is bounded and stable, when you have (or can create) labelled data, and when the volume is high enough that per-inference cost matters. That covers most production sentiment work: product reviews, support-ticket triage, social monitoring, call-transcript scoring. Correctly scoping these as classification rather than generation typically cuts per-inference cost by an order of magnitude and pulls latency to sub-100ms, versus the multi-second round-trips of an LLM call (order-of-magnitude planning estimate, not a benchmarked rate). Reach for an LLM when you have no labelled data and need a prototype tomorrow, when the domain is genuinely novel and you have not yet established what “positive” even means in it, or when sentiment is entangled with a task the LLM is already doing — for example, an agent that reads a support thread, judges the customer’s mood, and drafts a reply in one pass. In that last case the “sentiment scoring” is not a separate step you would optimise; it is an emergent property of a generation the model is already producing. The trap is using an LLM for high-volume, stable-domain classification because it was easy to stand up. It is easy — and then it is expensive, slow, and non-deterministic at scale. The cost of a labelled dataset and a fine-tune is paid once; the cost of an LLM call is paid on every inference, forever. Whether that trade is worth making is exactly the kind of question a feasibility assessment is built to answer before a model is chosen. How a sentiment model fits inside an agentic or generative pipeline The distinction becomes sharpest when sentiment scoring is one step inside a larger system. Here the sentiment classifier is a tool the orchestration layer calls, not the system itself. An agent handling customer conversations might call a fast sentiment classifier to decide whether to escalate, route to a human, or continue — and only then invoke a generative model to draft a response. Architecting it this way keeps each component doing what it is good at. The classifier gives a deterministic, sub-100ms score the orchestration logic can branch on. The generative model does the open-ended work. Collapsing both into a single LLM call couples a decision that should be cheap and reproducible to one that is expensive and probabilistic — and it makes the whole pipeline harder to monitor, because you can no longer isolate whether a bad outcome came from the sentiment judgment or the generation. This mirrors the broader pattern in AI agents orchestrating production pipelines: the orchestration layer composes specialised tools rather than asking one model to do everything. How do you measure and monitor sentiment quality in production? Because sentiment analysis is a classification task, it is measurable against a labelled validation set with the standard metrics — precision, recall, and F1 per class. That is the deep reason to keep it a classification task: you get a ground truth to check against. An LLM’s free-text sentiment judgment, by contrast, often forces you into subjective output review because there is no clean label to score. Track a few things once the model is live: Per-class precision, recall, and F1 on a held-out labelled set, refreshed periodically — aggregate accuracy hides collapse on a minority class (e.g. “negative” recall dropping while overall accuracy looks fine). Prediction distribution drift — if the share of “positive” predictions shifts sharply without a real-world cause, either the input distribution moved or the model is degrading. Confidence calibration — a classifier that returns probabilities lets you flag low-confidence predictions for human review, which a bare LLM label does not. Monitoring a classifier is a solved discipline, and it connects to the broader practice of monitoring ML models in production. Deterministic scores you can diff against ground truth are what make drift detection possible at all — another reason the classification framing pays off long after deployment. FAQ What matters most about machine learning and sentiment analysis in practice? A sentiment model is a supervised classifier: it maps input text to a fixed label (positive/negative/neutral) or a polarity score, learned from labelled examples. In practice this means you train on data where the correct sentiment is known, then run the model on unseen text to reproduce those judgments deterministically and at scale. Is sentiment analysis a generative AI task, a predictive task, or something an agent orchestrates? It is a predictive (classification) task — there is a correct label for any input, unlike open-ended generation. When it appears inside a larger system, an agent orchestrates it: the sentiment classifier is a fast, deterministic tool the orchestration layer calls, not the generative system itself. What machine learning approaches are used for sentiment analysis — from lexicon methods to fine-tuned transformers? The spectrum runs from lexicon methods (VADER, SentiWordNet) that need no training and run in microseconds, through classical supervised classifiers (logistic regression or SVM over TF-IDF features), to fine-tuned transformer encoders (BERT, RoBERTa, DistilBERT) that capture context and negation. Each trades accuracy against cost and data requirements. When should you use a lightweight classifier versus calling a large language model for sentiment scoring? Use a lightweight classifier for high-volume, bounded, stable domains where you have or can create labelled data — it is cheaper, sub-100ms, and deterministic. Reach for an LLM only when you lack labels, need a fast prototype, face a genuinely novel domain, or when sentiment is already entangled in a generation the model is producing anyway. How does a sentiment analysis model fit as a tool inside a larger agentic or generative pipeline? The classifier is a tool the orchestration layer calls to make a cheap, deterministic decision — for example, whether to escalate a conversation — before invoking a generative model for open-ended work. Keeping it separate lets each component do what it is good at and makes the pipeline auditable, because you can isolate a sentiment judgment from a generation. How do you measure and monitor sentiment analysis quality (precision, recall, F1, drift) once it’s in production? Score the model against a held-out labelled validation set using per-class precision, recall, and F1, refreshed periodically so minority-class collapse does not hide behind aggregate accuracy. Track prediction-distribution drift and confidence calibration to catch degradation early — deterministic, labelled outputs are what make this measurable at all. The scoping question comes first The recurring failure here is not choosing the wrong model — it is choosing a model before answering what kind of problem sentiment analysis is for your use case. Predictive classification, orchestrated tool call, or genuinely a generation step where sentiment falls out for free. Those three answers point at three different architectures with order-of-magnitude different cost and latency profiles. Getting the scoping right is exactly the feasibility question worth resolving before a single line of the pipeline is written.