Maximum Likelihood

Maximum likelihood chooses model parameters that make the observed data likely under the model.

For independent examples:

It is usually optimized as log-likelihood:

or negative log-likelihood:

As an empirical expectation:

where is the empirical data distribution.

For supervised learning, the conditional version is:

This can be written as an empirical risk:

where is the empirical distribution induced by the dataset and sampling rule.

For sequence modeling with the chain rule:

If sequences have different lengths, the denominator is part of the claim:

where is the set of valid non-padding positions. Token-average and sequence-average likelihood optimize different populations.

Why It Matters

  • Cross-entropy classification is conditional maximum likelihood.
  • Autoregressive language modeling minimizes next-token negative log-likelihood.
  • Density estimation and many generative models are likelihood-based.
  • Likelihood is not always aligned with sample quality or downstream utility.
  • Maximizing likelihood is equivalent to minimizing cross-entropy from the data distribution to the model distribution.

Likelihood Claim Map

ClaimLikelihood FormWatch
classifier probabilitycalibration, class prevalence, label noise
autoregressive modeltokenization, length normalization, teacher forcing
density modelexact vs approximate normalization
latent-variable model or ELBObound tightness and posterior approximation
conditional generationcondition leakage and sampling metric
regression as likelihood with Gaussian/Laplace/etc.noise model, target scale, censoring

Likelihood vs Utility

Likelihood is a proper training objective for probability models, but it may not be the final utility:

SettingLikelihood Can Miss
generationsample validity, novelty, diversity, and constraint satisfaction
rankingtop-k retrieval or enrichment under a candidate corpus
molecular modelingchemical validity, assay utility, pose geometry, or downstream screening value
long sequencessequence-level success when token-level loss is dominated by easy positions
imbalanced classificationdecision utility under deployment prevalence

Checks

  • What probability is being maximized: , , or ?
  • Is the likelihood exact, approximated, bounded, or implicit?
  • Does high likelihood correspond to the task metric?
  • Are examples assumed independent when they are grouped or duplicated?
  • Is the objective token-level, example-level, trajectory-level, or structure-level?
  • What is the averaging denominator: example, token, atom, residue, edge, pair, trajectory, or batch?
  • Is model selection based on likelihood, downstream metric, or a separate validation utility?
  • Does the reported likelihood use the same preprocessing, tokenization, masking, and support as training?