incerto.llm.NucleusSamplingUncertainty#
- class incerto.llm.NucleusSamplingUncertainty[source]#
Bases:
objectUncertainty for nucleus (top-p) sampling.
Analyzes the probability mass distribution to determine how concentrated or spread out the generation is.
- __init__()#
Methods
__init__()effective_vocabulary_size(logits[, p])Number of tokens needed to cover p probability mass.
probability_mass_concentration(logits[, top_k])Fraction of probability in top-k tokens.