I’ve been digging into the math behind LLM behavior recently, and one conclusion that keeps coming up is:
hallucination isn’t just a bug — it’s a consequence of the objective function.
At a high level, LLMs are trained to model:
P(x_t | x_<t)
using maximum likelihood. That means:
they optimize for probability , not truth
the learned distribution reflects the training data (which is incomplete + inconsistent)
softmax forces a normalized distribution → the model must always pick something
So when the model is uncertain, it doesn’t abstain — it still generates a high-probability continuation, which can look confident but be wrong.
From a more formal angle, hallucination can be seen as a combination of:
distribution approximation error (P_theta ≠ P*)
information loss (finite model capacity vs dataset entropy)
ambiguity in language (multiple valid continuations)
objective mismatch (likelihood vs factual correctness)
Even with perfect optimization, these don’t fully go away.
I wrote up a math-first…