Abstract
Reinterpreting LLM softmax classifiers as energy-based models enables hallucination detection through energy spill tracking without training overhead.
We reinterpret the final Large Language Model (LLM) softmax classifier as an Energy-Based Model (EBM), decomposing the sequence-to-sequence probability chain into multiple interacting EBMs at inference. This principled approach allows us to track "energy spills" during decoding, which we empirically show correlate with factual errors, biases, and failures. Similar to Orgad et al. (2025), our method localizes the exact answer token and subsequently tests for hallucinations. Crucially, however, we achieve this without requiring trained probe classifiers or activation ablations. Instead, we introduce two completely training-free metrics derived directly from output logits: spilled energy, which captures the discrepancy between energy values across consecutive generation steps that should theoretically match, and marginalized energy, which is measurable at a single step. Evaluated on nine benchmarks across state-of-the-art LLMs (including LLaMA, Mistral, and Gemma) and on synthetic algebraic operations (Qwen3), our approach demonstrates robust, competitive hallucination detection and cross-task generalization. Notably, these results hold for both pretrained and instruction-tuned variants without introducing any training overhead. Code available at: github.com/OmnAI-Lab/spilled-energy
Community
We introduce a zero-shot, training-free method to detect LLM hallucinations by quantifying violations of the probability chain rule as an "energy spill" derived directly from output logits. We reinterpret the standard LLM softmax classifier as an energy-based model (EBM), decomposing the standard sequence-to-sequence probability chain into multiple interacting EBMs during inference. We treat token generation analogously to a physical system settling into a stable state. When a model hallucinates or makes a factual mistake, it creates a mathematical mismatch between the energy of the current generation step and its theoretical value.
We extract this signal natively from the output logits using two new metrics. Spilled Energy captures the discrepancy across consecutive generation steps, and Marginalized Energy measures the energy state at a single isolated step.
Our work demonstrates that the logit-derived energy distribution inherently holds these truthfulness signals. Our method effectively localizes the exact answer token and tests for hallucinations entirely at inference time without requiring external models or labeled training data.
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper