A verbalizer is the mapping that connects label words in a language model’s vocabulary to the classes of a downstream task, so that a word predicted inside a prompt can be read as a classification decision. In prompting, and in prompt-based learning more broadly, it is the component that turns a model’s answer such as “great” or “terrible” into the labels positive or negative.
The verbalizer works together with the prompt template. The template rephrases the input as a cloze or completion task, the model scores candidate words for the blank, and the verbalizer aggregates those scores into class probabilities. Its design often moves accuracy as much as the template wording itself.
How a verbalizer converts predictions into labels
A verbalizer defines a function from each class to one or more label words. Given an input wrapped in a template such as “Review: x. Overall, it was [MASK].”, a masked language model produces a probability distribution over its vocabulary at the blank. The verbalizer reads only the probabilities of its label words and normalizes them across classes, which yields a classifier without adding a new output layer.
With generative models, the same idea applies to the next token or to a short continuation. The model is asked to complete “Sentiment:” and the system compares the log-probabilities of the candidate words, rather than parsing free text. This scoring approach is more robust than reading a generated answer, because it cannot produce an out-of-vocabulary label.
The following table shows how the three parts of a prompt-based classifier divide the work.
| Component | Role | Example |
|---|---|---|
| Template | Recasts input as a fill-in task | “x. It was [MASK].” |
| Language model | Scores vocabulary at the blank | Masked or causal model |
| Verbalizer | Maps label words to classes | great → positive, awful → negative |
| Decision rule | Selects the class | Highest normalized score |
Types of verbalizers
Verbalizers range from hand-written word lists to learned continuous vectors. The choice depends on how much labeled data is available, whether the model weights can be updated and how important interpretability is.
| Type | How label words are chosen | Strength | Weakness |
|---|---|---|---|
| Manual verbalizer | Expert picks one word per class | Interpretable, no data needed | Sensitive to word choice |
| Multi-word verbalizer | Several synonyms per class | Smoother, more robust scores | Requires careful aggregation |
| Search-based verbalizer | Words selected on a small labeled set | Finds non-obvious words | Risk of overfitting few examples |
| Knowledgeable verbalizer | Expanded from knowledge bases, then refined | Broad coverage of class vocabulary | Noisy expansion needs filtering |
| Soft verbalizer | Trainable class embeddings | Highest accuracy with training | Not human-readable |
Pattern-Exploiting Training (PET) popularized the manual pattern-verbalizer pair, while later work showed that automatic label word search and soft class vectors can match or exceed hand design. Knowledgeable prompt-tuning expands each class into dozens of related words, then removes low-frequency or ambiguous terms before averaging their scores.
Choosing good label words
A good label word is frequent, unambiguous and natural after the template. If the word rarely appears in that position in pretraining text, the model assigns it a low prior, and the classifier becomes biased toward other classes regardless of the input.
- Prefer single-token words, because multi-token labels need extra scoring rules.
- Avoid words with strong sentiment in unrelated senses, such as “sick” in casual usage.
- Check that label words have similar prior probabilities with an empty or neutral input.
- Use several synonyms per class when the class covers a broad meaning, such as sports news.
The table lists practical decisions and the recommended verbalizer strategy for each.
| Situation | Recommended choice | Reason |
|---|---|---|
| No labeled data | Manual multi-word verbalizer | Relies only on model knowledge |
| Under 100 labeled examples | Search-based or knowledgeable verbalizer | Data guides word selection |
| Full fine-tuning allowed | Soft verbalizer | Learns optimal class vectors |
| Strict auditability required | Manual verbalizer with calibration | Readable and easy to review |
| Many fine-grained classes | Label names or descriptions as words | Single words cannot cover each class |
Verbalizers in modern instruction-tuned models
In instruction-tuned and chat models, the verbalizer often becomes implicit. The prompt lists allowed labels and an output format instruction, and the model writes one of them. Many production systems still score each allowed label explicitly, which is a verbalizer in all but name, because it gives calibrated probabilities and avoids malformed outputs.
Verbalizers also matter for evaluation harnesses. Multiple-choice benchmarks frequently compare the likelihood of answer options, and changing the option text from “yes” to “true” can shift scores by several percentage points. Reported results are therefore only comparable when the same label words and normalization are used.
Common problems and fixes
Most verbalizer failures show up as systematic bias toward one class or as unstable accuracy across seeds and templates. The table links typical symptoms to their causes.
| Symptom | Likely cause | Fix |
|---|---|---|
| One class always wins | Label word has high prior probability | Contextual calibration with a null input |
| Accuracy varies by template | Label word unnatural after template | Test words per template, use synonyms |
| Long labels underperform | Sum of token log-probabilities penalizes length | Length-normalize or use first token |
| Good dev score, poor test score | Searched words overfit few examples | Regularize search, use more examples |
Contextual calibration is the most widely used correction: the system measures label probabilities for a content-free input such as “N/A” and divides them out, which removes much of the prior bias of the label words.
A plain-language summary
A language model does not know your categories. It only knows words. A verbalizer is a small dictionary that links words to categories. If the model fills in “great”, the dictionary says this means positive. If it fills in “awful”, that means negative.
The choice of words matters. A rare or odd word can confuse the model. Good verbalizers use common, clear words, and sometimes several words for each category.
An example from practice
A support team wants to route incoming tickets into four classes: billing, technical, account and other. It has only 60 labeled tickets, so it uses a prompt-based classifier with the template “Ticket: x. This ticket is about [MASK].” and a manual verbalizer with words such as payment, error, login and general.
The first test reaches 68% accuracy, but nearly every unclear ticket lands in the technical class, because “error” has a high prior probability after the template. The team adds three synonyms per class, applies contextual calibration with an empty ticket and replaces “general” with “question”. Accuracy rises to 81%, and the class distribution of predictions now matches the real ticket mix closely enough for automatic routing with human review of low-confidence cases.