AI engineering glossary · Prompt context engineering

What is logprobs?

Logprobs (also called Log probabilities): The logarithms of the probabilities a model assigns to the tokens it generates, and sometimes to the top alternatives at each position. They let you measure confidence, rank choices and build classifiers from a single-token answer.

Level: advancedTopic: Prompt context engineering

Logprobs: an example

A yes/no prompt returns logprob -0.05 for 'Yes' (about 95% probability) and -3.0 for 'No', suggesting high confidence.

Related terms

More Prompt context engineering terms

Where you learn it

Logprobs is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.