Inference
The log probabilities of the tokens a model generated, returned by the API alongside the text.
The log probabilities of the tokens a model generated, returned by the API alongside the text. A logprob is log(p), where p is the probability of that token given everything before it, so values closer to zero mean higher confidence. In OpenAI's Chat Completions API you enable them with logprobs: true and can request up to 20 alternative tokens per position with top_logprobs. Developers use them for classification confidence thresholds, autocomplete decisions, and calculating perplexity.
Primary source: developers.openai.com
Example
In practice, developers reach for Logprobs when they need the capability described above as part of an AI feature or workflow.
Hands-on guides, comparisons, and tutorials that cover Inference.
FAQ
The log probabilities of the tokens a model generated, returned by the API alongside the text.
Logprobs sits in the Inference part of the AI stack. Understanding it helps you make better decisions when building, debugging, and shipping AI features.
Developers Digest publishes tutorials and videos that cover Inference topics including Logprobs. Check the blog and YouTube channel for hands-on walkthroughs.
Related
The raw, unnormalized scores a language model's output layer assigns to every token in its vocabulary at each step, before softmax turns them into probabilities.
The standard loss function for classification and language model training, measuring how much probability the model gave to the correct answer.
The split pricing model where LLM APIs charge one rate per million tokens you send (input) and a higher rate per million tokens the model generates (output).

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.