core-ai
Glossary ↗Logprobs (Log Probabilities)
Logprobs are the log-probabilities a model assigns to each token it considers when generating text — essentially, how likely the model thought each word was. Many LLM APIs can return them alongside the output, and they're a practical window into the model's internal confidence that the visible text alone doesn't give you. Builders use logprobs for real jobs: estimating how sure the model is about an answer, building classifiers by comparing the probabilities of candidate labels rather than parsing free text, and flagging low-confidence generations for review or a fallback. Because they reflect the model's own probability estimates, they're often a better confidence signal than asking the model "how sure are you?" Practical note: availability and format vary by provider, so check whether your model exposes logprobs before designing around them. And remember token probabilities measure the model's confidence, not truth — a model can be highly confident and wrong, so use logprobs as one input to a decision, not a guarantee of correctness.
Related terms