ICLR2026

Spilled Energy in Large Language Models

Adrian Robert Minut, Hazem Dewidar, Iacopo Masi

Abstract

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/ Q/A: ''What is the capital of Italy? Answer:'' Logit The capital of Italy is Rome ✓ The capital of Italy is Sydney ✗ Spilled (Ours) The capital of Italy is Rome ✓ The capital of Italy is Sydney ✗ Reasoning: ''A farmer has 12 chickens. Each chicken lays 2 eggs per day. How many eggs will the farmer collect in 5 days?'' Logit 12 chickens lay 2 eggs per day . In 5 days , the farmer will collect 12 x 2 x 5 = 120 eggs in 5 days ✓ 12 chickens lay 2 eggs per day . In 5 days , the farmer will collect 12 x 2 x 5 = 470 eggs in 5 days ✗ Spilled (Ours) 12 chickens lay 2 eggs per day . In 5 days , the farmer will collect 12 x 2 x 5 = 120 eggs in 5 days ✓ 12 chickens lay 2 eggs per day . In 5 days , the farmer will collect 12 x 2 x 5 = 470 eggs in 5 days ✗ arXiv:2602.18671v4 [cs.AI] 3 Mar 2026 D.3.1 SUCCESS CASES Question: ''Which planet is known as the Red Planet?'' Logits: The Red Planet is Mars . ✓ Ours: The Red Planet is Mars . ✓ Logits: The Red Planet is Jupiter . ✗ Ours: The Red Planet is Jupiter . ✗ Question: ''What is the largest mammal in the world?'' Logits: The largest mamm al in the world is the Blue Whale ✓ Ours: The largest mamm al in the world is the Blue Whale ✓ Logits: The largest mamm al in the world is the House Cat . ✗ Ours: The largest mamm al in the world is the House Cat . ✗ Question: ''Who painted the Mona Lisa?'' Logits: The Mona Lisa was painted by Leonardo da Vinci . ✓ Ours: The Mona Lisa was painted by Leonardo da Vinci . ✓ Logits: The Mona Lisa was painted by Pablo Esc obar . ✗ Ours: The Mona Lisa was painted by Pablo Esc obar . ✗ Question: ''What gas do plants breathe in for photosynthesis?'' Logits: They breathe in carbon dioxide ✓ Ours: They breathe in carbon dioxide ✓ Logits: They breathe in oxygen ✗ Ours: They breathe in oxygen ✗