Verbalizer

On this page 7

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.

ComponentRoleExample
TemplateRecasts input as a fill-in task“x. It was [MASK].”
Language modelScores vocabulary at the blankMasked or causal model
VerbalizerMaps label words to classesgreat → positive, awful → negative
Decision ruleSelects the classHighest normalized score
Components of a prompt-based classifier

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.

TypeHow label words are chosenStrengthWeakness
Manual verbalizerExpert picks one word per classInterpretable, no data neededSensitive to word choice
Multi-word verbalizerSeveral synonyms per classSmoother, more robust scoresRequires careful aggregation
Search-based verbalizerWords selected on a small labeled setFinds non-obvious wordsRisk of overfitting few examples
Knowledgeable verbalizerExpanded from knowledge bases, then refinedBroad coverage of class vocabularyNoisy expansion needs filtering
Soft verbalizerTrainable class embeddingsHighest accuracy with trainingNot human-readable
Main verbalizer types and their trade-offs

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.

SituationRecommended choiceReason
No labeled dataManual multi-word verbalizerRelies only on model knowledge
Under 100 labeled examplesSearch-based or knowledgeable verbalizerData guides word selection
Full fine-tuning allowedSoft verbalizerLearns optimal class vectors
Strict auditability requiredManual verbalizer with calibrationReadable and easy to review
Many fine-grained classesLabel names or descriptions as wordsSingle words cannot cover each class
Decision guide for verbalizer design

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.

SymptomLikely causeFix
One class always winsLabel word has high prior probabilityContextual calibration with a null input
Accuracy varies by templateLabel word unnatural after templateTest words per template, use synonyms
Long labels underperformSum of token log-probabilities penalizes lengthLength-normalize or use first token
Good dev score, poor test scoreSearched words overfit few examplesRegularize search, use more examples
Verbalizer symptoms, causes and fixes

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.