Skip to content

Main content

Log Probability Nats Bits Crosswalk Tool

Calculate log probability nats bits crosswalk from explicit caller-supplied inputs.

Loading tool…

Description

Convert a nonpositive log probability from nats to bits.

Log probabilities, logits, guidance scales and sequence scores use different conventions. Temperature changes logit scale, an additive bias changes odds, and a sequence-length penalty changes ranking. One supplied scalar contribution can be checked independently of a complete probability distribution or model-generation process.

Convert a nonpositive log probability from nats to bits.

When to use this tool

Use Log Probability Nats Bits Crosswalk when checking the stated probability, score, guidance or scale contribution.

How to use the tool and how it works

  1. Enter logProbabilityNats. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read logProbabilityBits, surprisalBits, probability. Use the output convention below.

Convert a nonpositive log probability from nats to bits. logProbabilityBits = logProbabilityNats/ln(2), surprisalBits negates it, probability = exp(logProbabilityNats).1

Input fieldMeaning and unitsAccepted input
logProbabilityNatsLog Probability NatsRequired. Finite number; maximum 0.
Output fieldInterpretationReturned shape
logProbabilityBitsLog Probability BitsRequired. Finite number.
surprisalBitsSurprisal BitsRequired. Finite number.
probabilityProbabilityRequired. Finite number.
json
{
  "input": {
    "logProbabilityNats": -0.6931471805599453
  },
  "output": {
    "logProbabilityBits": -1,
    "surprisalBits": 1,
    "probability": 0.5
  }
}

Limitations and assumptions

  • Extremely negative values may underflow to probability zero; this is one supplied log probability, not sequence likelihood or calibrated uncertainty.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use the full distribution and model-specific decoding or training objective for normalized probabilities, preference optimization or actual generation.

References

  1. Calculation and input contract: artificial-intelligence/log-probability-nats-bits-crosswalk — tool.io

Similar or alternative tools