- The conceptual difference between generative and predictive models
- Why request and response payloads differ
- How KServe keeps the InferenceService manifest stable across model types
- A brief introduction to model distillation and the DistilBERT sentiment classifier we’ll deploy

Generative vs Predictive — core concept
A generative model composes new content token-by-token. Example: you ask “Tell me about Kubernetes” and the model generates an explanatory paragraph. Its output space is effectively open-ended. A predictive model, by contrast, maps inputs to a predefined set of labels. It answers questions like “Which bucket does this input belong to?” or “Which label best describes this input?” The output is a discrete set (e.g., ) or a probability distribution over those labels.
- Spam filtering: label an email
spamornot_spam.

- Image classification: detect whether a photo contains a cat (
cat/no_cat). - Sentiment analysis: classify text as
positiveornegative.

Distillation — why DistilBERT?
Distillation trains a smaller “student” model to mimic a larger “teacher”. The result is a compact model that approximates the teacher’s behavior while using far less memory, CPU, and storage. Distilled models trade a small amount of accuracy for much lower inference cost — ideal for production classifiers.
- Name:
distilbert-base-uncased-finetuned-sst-2-english- DistilBERT: lighter, faster variant of BERT
uncased: ignores case differencesfinetuned SST-2 English: trained on the Stanford Sentiment Treebank (SST-2) for sentiment classification
hf://distilbert-base-uncased-finetuned-sst-2-english
KServe InferenceService — what stays the same
One of KServe’s strengths is that the InferenceService manifest and predictor spec look the same whether you deploy a large generative model or a compact classifier. Only a few fields change: most notably the InferenceServicemetadata.name and the storageUri (model identifier). Resource requests/limits typically shrink for distilled classifiers.
Example InferenceService manifest (Hugging Face model):
metadata.name— a descriptive name for the InferenceServicestorageUri— model identifier (e.g., the Hugging Face URI)resources— classifiers typically require smaller requests/limits than large generative LLMs
Request / Response shape — what changes
The primary runtime difference is the inference payload. Generative models accept chat-style prompts (a list of messages, system and user roles) and produce open-ended text. Classifiers accept a single input (text or data tensor) and return a label or a probability distribution over labels. Common payload examples (these are typical shapes — exact format depends on your predictor and KServe runtime configuration):- Simple instances-style request:
- Typical classifier response (probabilities for labels in fixed order
[negative, positive]):
- Alternatively, some Hugging Face-style APIs return labeled results:

instances vs inputs vs a Hugging Face-specific shape) can differ by predictor and the chosen protocol (V1/V2). KServe docs and your runtime configuration specify the exact expected format.
Key takeaway: predictive models select from a predefined set of labels (e.g., positive/negative). KServe uses the same InferenceService manifest and runtime for both generative and predictive models; only the inference payload shape changes.
Quick comparison: generative vs predictive
Summary
- Predictive models map inputs to predefined labels rather than generating free-form content.
- DistilBERT (fine-tuned on SST-2) is a compact, production-friendly sentiment classifier.
- KServe keeps the InferenceService manifest and runtime consistent across different model types; only the model URI and resource sizing change.
- The main difference is the runtime payload format: generative models accept prompts/messages, while classifiers expect a single input and return labels or probability distributions.
- KServe documentation: https://kserve.github.io
- Hugging Face models: https://huggingface.co
- Stanford Sentiment Treebank (SST-2): https://nlp.stanford.edu/sentiment/