Token Probability Plot Calculator

Explore token probabilities, adjust decoding controls, compare distributions, inspect uncertainty, and export interactive language model analysis through one responsive calculator for clearer generation decisions.

Analysis results

Load data and calculate results.
Waiting for data

Distribution comparison

Two datasets at the same step are required for divergence statistics.

Interpretation

Sampling preview

Calculated token table

Sort by headers, search tokens, and paginate the processed results.
Token Token ID Dataset Step Raw logit Adjusted logit Original probability Adjusted probability Log probability Rank Cumulative Surprise Selected Filtered

Token data

Headers are optional. CSV and tab-separated values are supported.
Token Token ID Logit Probability Step Dataset Selected Category Frequency Remove

Sampling and decoding controls

Use zero to disable.

Plot configuration

Formula used

Stable softmax: pᵢ = exp((zᵢ − max(z))/T) ÷ Σⱼ exp((zⱼ − max(z))/T)
Entropy: H = −Σᵢ pᵢ ln(pᵢ)
Perplexity: PP = exp(H)
Negative log-likelihood: NLL = −ln(p selected)
KL divergence: DKL(P ∥ Q) = Σᵢ P(i) ln(P(i) ÷ Q(i))
Jensen–Shannon divergence: JSD(P,Q) = ½DKL(P ∥ M) + ½DKL(Q ∥ M)

How to use

  1. Enter tokens with logits or probabilities.
  2. Assign datasets and generation steps for comparisons.
  3. Choose temperature, filtering, penalties, and sampling settings.
  4. Select a plot type and display configuration.
  5. Calculate, inspect metrics, and export the analysis.

Example data

TokenLogitApproximate probabilitySelected
learning4.2042%Yes
model3.6524%No
system3.1014%No
network2.709%No
data2.306%No

Frequently asked questions

What is a token probability?

It is the model probability assigned to one candidate token. Higher values indicate stronger preference at that generation step.

What is a logit?

A logit is an unnormalized model score. Softmax converts all candidate logits into probabilities that sum to one.

Why use stable softmax?

Subtracting the largest logit prevents numerical overflow. It preserves the final probability distribution.

How does temperature change probabilities?

Lower temperature sharpens the distribution. Higher temperature spreads probability across more tokens.

What does top-k filtering do?

It keeps only the k highest-probability candidates. Remaining probabilities are normalized again.

What does top-p filtering do?

It keeps the smallest ranked token set reaching a chosen cumulative probability. This adapts candidate count to uncertainty.

What is typical-p filtering?

It favors tokens whose information content stays near distribution entropy. It can remove unusually surprising candidates.

What does entropy measure?

Entropy measures uncertainty across candidate tokens. Lower entropy indicates a more concentrated prediction.

How is perplexity interpreted?

Perplexity represents effective uncertainty. Smaller values mean fewer equally plausible token choices.

Why can the selected token differ from rank one?

Random sampling can select lower-ranked candidates. Filtering and temperature also change selection probabilities.

What are KL and Jensen–Shannon divergence?

They compare probability distributions. Jensen–Shannon divergence is symmetric and usually easier to interpret safely.

Can this calculator compare generation steps?

Yes. Add rows with matching datasets and different step numbers, then choose heatmap or trajectory plots.

Related Calculators

Word Frequency Bar ChartN-gram Frequency ChartDocument-Length HistogramSentiment Distribution PlotTopic Distribution ChartTopic-Term HeatmapWord-Embedding Scatter PlotConfusion Matrix for Text ClassesAttention MatrixVocabulary Coverage Curve

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.