Introduction
Energy-Based Models (EBMs) offer a compelling alternative to standard autoregressive models (like GPT) by assigning a global "energy" or weight to an entire sequence rather than predicting it token by token. However, converting these raw energy scores into valid probabilities requires dividing them by a normalization constant known as the partition function ($Z$)—the sum of weights over all possible sequences.
In this theoretical study, the authors demonstrate a fundamental limitation of highly expressive energy-based sequence models, such as Transformers and Recurrent Neural Networks (RNNs). They prove that calculating the partition function for these models is not merely computationally expensive—it is mathematically undecidable. Because modern neural networks are Turing-complete, determining their normalization constant or comparing two models is equivalent to solving the Halting Problem. Consequently, no algorithm can guarantee an accurate estimate of $Z$ in finite time.
The Core Problem: The Expressiveness Trap
In sequence modeling, the space of possible strings is infinite. For an EBM to be valid, the sum of weights over all possible sequences ($Z$) must converge. The authors investigate whether the sheer representational power of modern neural networks creates a theoretical trap where standard statistical tools for learning and model selection break down.
The central finding is the Expressiveness Trap: there is a fundamental trade-off between a model's expressiveness and its computability. If a model is powerful enough to simulate a Turing machine, computing its partition function becomes impossible.
Theoretical Methodology
As a theoretical work focused on proofs of uncomputability, the paper relies on tools from computability theory and formal language theory rather than empirical datasets.
- EC-Complete Families: The authors define "Efficiently Computable" (EC) parametric families as model classes capable of representing any weighting function computable in polynomial time.
- Reductions from the Halting Problem: The main proofs rely on reducing the Halting Problem to the calculation of $Z$. If a "magic box" could calculate $Z$ for these models, it could also determine if any computer program will eventually halt—a known impossibility.
- Transformer Construction: The authors prove that standard Transformer architectures (with specific tweaks to positional encodings) are EC-complete, meaning these theoretical dangers apply directly to modern AI architectures.
- Derandomization: To address randomized estimators (like Monte Carlo sampling), the authors use derandomization techniques to prove that randomness cannot guarantee a bounded approximation of $Z$ in pathological cases.
Key Insights and Results
The paper outlines several striking theoretical results that challenge common assumptions in machine learning:
- Exact Computation is Impossible (Theorem 2): No exact algorithm exists to compute the partition function for EC-complete sequence models.
- Randomization is Not a Silver Bullet (Theorem 4): A common assumption is that Monte Carlo sampling (e.g., Importance or Rejection Sampling) can approximate $Z$ well enough in practice. The authors prove this false for expressive EBMs: no randomized algorithm can provide a high-confidence multiplicative approximation of $Z$, nor can it guarantee finite variance or bounded bias.
- Model Selection is Undecidable (Theorem 8): Reliably performing model selection—such as deciding if Model A is better than Model B on held-out data—is generally impossible. Calculating the likelihood of the data requires $Z$, which cannot be computed.
- Fixed-Size Transformers are Vulnerable (Theorem 11): These uncomputability problems are not restricted to models with infinite parameters. They apply to fixed-size Transformers once the embedding dimension ($d$) reaches a certain threshold.
- ZFC Consistency: In a particularly profound proof, the authors construct a pathological EBM where determining the value of its partition function is mathematically equivalent to proving the consistency of Zermelo-Fraenkel set theory with the Axiom of Choice (ZFC). Following Gödel's Incompleteness Theorems, this cannot be proven from within the system itself.
Limitations and Future Directions
While the paper establishes strict theoretical boundaries, it leaves several practical questions open:
- Existence vs. Prevalence: The proofs rely on the existence of pathological cases where $Z$ is uncomputable. The paper does not address how frequently these cases arise in natural language modeling, or whether standard training dynamics (like Stochastic Gradient Descent) naturally steer models away from these uncomputable regions of the parameter space.
- The "Safe" Boundary: The authors identify palliative solutions—such as restricting sequence length, enforcing autoregressive structures, or limiting treewidth in factor graphs—but the exact threshold of expressiveness we can maintain before hitting the "uncomputability wall" remains an open question.
- Practical Heuristics: The success of current EBMs may rely on sheer, finite amounts of compute rather than asymptotic guarantees. Future work could explore "approximate" computability frameworks that better describe the empirical success of deep learning despite these theoretical limits.
Summary updated