LLMs versus the Halting Problem: Revisiting Program Termination Prediction
Oren Sultan, Jordi Armengol-Estape, Pascal Kesseli, Julien Vanegue, Dafna Shahaf, Yossi Adi, Peter O'Hearn
TL;DR
This paper investigates whether large language models (LLMs) can reliably predict program termination, a problem rooted in the undecidability of the Halting Problem. By evaluating open and proprietary LLMs on the SV-Comp 2025 Termination dataset, the authors show that models like GPT-5 and Claude Sonnet-4.5 achieve performance near top symbolic tools, though generating valid non-termination witnesses remains challenging and performance degrades with longer code. The study also introduces a domain-witness alternative for interpretability and demonstrates that LLMs can reason about undecidable properties to a practical degree, suggesting a promising direction for neuro-symbolic termination reasoning. Overall, the results motivate integrating LLMs into termination analysis workflows and exploring hybrid approaches for robust, real-world termination reasoning.
Abstract
Determining whether a program terminates is a central problem in computer science. Turing's foundational result established the Halting Problem as undecidable, showing that no algorithm can universally determine termination for all programs and inputs. Consequently, automatic verification tools approximate termination, sometimes failing to prove or disprove; these tools rely on problem-specific architectures and abstractions, and are usually tied to particular programming languages. Recent success and progress in large language models (LLMs) raises the following question: can LLMs reliably predict program termination? In this work, we evaluate LLMs on a diverse set of C programs from the Termination category of the International Competition on Software Verification (SV-Comp) 2025. Our results suggest that LLMs perform remarkably well at predicting program termination, where GPT-5 and Claude Sonnet-4.5 would rank just behind the top-ranked tool (using test-time-scaling), and Code World Model (CWM) would place just behind the second-ranked tool. While LLMs are effective at predicting program termination, they often fail to provide a valid witness as a proof. Moreover, LLMs performance drops as program length increases. We hope these insights motivate further research into program termination and the broader potential of LLMs for reasoning about undecidable problems.
