📄 中文摘要
程序终止性判断是计算机科学中的核心难题。图灵奠基性工作证明了停机问题不可判定,即不存在通用算法能判断所有程序及其输入的终止性。因此,自动验证工具只能近似判断程序终止性,有时无法给出确定性证明或反证。这些工具通常依赖于特定问题架构和抽象,且通常与具体技术紧密耦合。大型语言模型(LLMs)的兴起及其在复杂推理任务上的卓越表现,为重新审视程序终止性预测提供了新的视角。尽管LLMs本质上是概率模型,不具备图灵机那样的确定性计算能力,但其强大的模式识别和泛化能力可能在特定场景下提供有用的启发式预测。
📄 English Summary
LLMs versus the Halting Problem: Revisiting Program Termination Prediction
Determining program termination is a fundamental problem in computer science. Turing's seminal work established the Halting Problem as undecidable, proving that no universal algorithm can determine termination for all programs and inputs. Consequently, automated verification tools approximate termination, sometimes failing to prove or disprove; these tools rely on problem-specific architectures and abstractions and are usually tightly coupled with particular technologies. The advent of Large Language Models (LLMs) and their remarkable performance in complex reasoning tasks offers a new perspective on program termination prediction. Although LLMs are inherently probabilistic models, lacking the deterministic computational capabilities of a Turing machine, their powerful pattern recognition and generalization abilities might provide useful heuristic predictions in specific scenarios. For instance, LLMs could learn patterns from vast amounts of program code and their execution traces, identifying common loop structures, recursive calls, and conditions that might lead to non-terminating behavior. Through semantic understanding of program code, LLMs might infer variable value ranges and function call depth limits, thereby assisting in determining whether a program will complete within a finite number of steps. However, LLM predictions are not rigorous mathematical proofs; they may exhibit limitations when confronting complex, non-linear program logic, especially with unseen program structures or adversarial inputs. Furthermore, the 'black-box' nature of LLMs poses challenges regarding the reliability and interpretability of their predictions. Integrating LLMs with traditional symbolic logic reasoning methods to form hybrid systems could potentially enhance trustworthiness while maintaining prediction accuracy.