liveBook · Manning

Mode

As explained in Prompt Engineering in Practice

The mode is the most frequently occurring value in a set of categorical or numerical observations.

Mode selects the label that appears most often across multiple independent generations. It is equivalent to majority voting and is suited to tasks that require one categorical output, such as a severity label or routing decision. section 8.3

Use a repeatable voting workflow:

  • Define a classification prompt that returns exactly one label from a fixed set. section 8.3.1
  • Generate multiple independent classifications, count votes for each label, and select the most frequent. section 8.3.1
  • Treat the vote split as confidence context. For a tie, generate more responses or send the item for human review. section 8.3.1

Alert severity routing

A platform team classifies an alert as P1, P2, or P3. Four independent generations produce P1 three times and P2 once, so the mode is P1; the 3–1 split provides context for escalation. A 2–2 split would call for more generations or human review. section 8.3.1

Generation

Label

1

P1

2

P2

3

P1

4

P1

The generation-by-generation labels show how the P1 mode is obtained from the votes. section 8.3.1

Choose another technique when the output type differs: use the mean for numerical outputs, and self-consistency or best-of-N for complete responses rather than single labels. section 8.3

How Prompt Engineering in Practice covers it

How deep it goes
Defines majority voting and gives a workflow for counting labels, reading vote splits, and handling ties.
Examples
Demonstrates P1/P2/P3 alert classification with four generations, a 3–1 vote, and a possible 2–2 tie.
What you can do after
Apply mode to repeated label classifications, then use the vote split to inform routing or escalation.
How it connects
Contrasts mode with mean, self-consistency, and best-of-N according to output type.

Also explained in

Compare how 8 books explain mode →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Prompt Engineering in Practice. The section links point to the parts of the book it draws on.