Home

logits

Logits are the raw, unnormalized scores produced by a classifier before a normalization step such as softmax. In binary classification, a single logit z corresponds to the log-odds of the positive class: p = sigmoid(z) = 1/(1+exp(-z)); equivalently z = log(p/(1-p)). In multi-class classification with K classes, the model outputs a vector z in R^K of logits. The predicted class probability is obtained by applying the softmax function: p_i = exp(z_i) / sum_j exp(z_j). The logits therefore encode relative evidence for each class; only their relative values matter for the final decision, while probabilities are obtained after normalization.

From a training perspective, using logits directly with cross-entropy loss is common: the loss computes the

Important distinctions include that logits are not probabilities themselves; they are real-valued scores. They can be

negative
log-likelihood
of
the
true
class
given
the
softmax
of
the
logits.
Numerically
stable
implementations
often
combine
softmax
and
cross-entropy,
or
apply
log_softmax
to
produce
log-probabilities.
Negative
or
positive
values
are
both
common,
and
the
scale
of
logits
can
affect
training
dynamics,
but
only
their
relative
differences
influence
outcomes.
In
neural
networks,
logits
are
typically
the
output
of
the
final
linear
layer
before
a
softmax
(or
sigmoid)
activation.
interpreted
as
log-odds
in
the
binary
case
and
as
unnormalized
log-probabilities
in
the
multiclass
case.