liveBook · Manning

Token probability

As explained in LLM Evaluation and Alignment, The Foundational Ideas

A token probability is the probability that a language model assigns to a particular token at a given generation step.

Token probability is the probability a language model assigns to a particular token at one generation step. Low-probability tokens can signal uncertainty or possible hallucinated content, but they cannot establish that a claim is false: models may produce high-probability hallucinations that match strong patterns in training data. section 5.3.2

A practical token-probability workflow is:

  • Request token log probabilities when the model endpoint exposes them. section 5.3.2
  • Mark tokens below a chosen threshold for inspection, then combine this signal with broader hallucination checks. section 5.3.2
  • Use monitoring during production rather than treating low probability alone as an automatic blocking rule. section 5.4.2

Comparing factual confidence

For “Einstein was born in 1879,” a probability of 0.98 for “1879” indicates greater model confidence than a probability of 0.15 for “1876.” The scores still require verification because confidence is not factual support. section 5.3.2

How LLM Evaluation and Alignment, The Foundational Ideas covers it

How deep it goes
Explains log-probability conversion and thresholding, but stops short of treating scores as standalone factual verification.
Examples
Contrasts probabilities for Einstein’s birth year and demonstrates token scoring with log probabilities and an uncertainty threshold.
What it assumes
Assumes basic probability and model-endpoint usage while teaching log-probability conversion from the implementation.
What you can do after
Diagnose potentially uncertain generated tokens through an endpoint that exposes log probabilities.
How it connects
Connects token probability with hallucination detection, self-consistency, semantic entropy, and natural language inference.

Also explained in

Compare how 2 books explain token probability →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLM Evaluation and Alignment, The Foundational Ideas. The section links point to the parts of the book it draws on.