arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.18987cs.CLcs.AIcs.PL
收藏

LLMs 与停机问题:程序终止推理的特征化

LLMs versus the Halting Problem: Characterizing Program Termination Reasoning

FAIR Team, Meta AI(Meta AI FAIR 团队);The Hebrew University of Jerusalem, Israel(耶路撒冷希伯来大学);Bloomberg, New York, USA(彭博社,纽约,美国);Imperial College London, UK(伦敦帝国理工学院,英国);University College London, UK(伦敦大学学院,英国)

Oren Sultan, Jordi Armengol-Estape, Pascal Kesseli, Julien Vanegue, Dafna Shahaf, Yossi Adi, Peter O'Hearn

AI总结:

本文评估了前沿LLMs在程序终止推理上的能力,发现GPT-5和Claude Sonnet 4.5在C程序终止判断上达到顶级验证工具水平,但无法生成形式化证明,并引入分歧前置条件形式化描述非终止条件。

摘要:

判断程序是否终止是计算机科学中的一个核心问题。图灵的停机问题确立了终止的不可判定性,表明没有算法能普遍确定所有程序和输入的终止性。因此,验证工具近似地处理终止问题,有时无法证明或反驳;这些工具依赖于特定问题的架构,并且通常与特定的编程语言绑定。LLMs的最新进展提出了一个自然的问题:它们在多大程度上能够推理程序终止?我们在2025年国际软件验证竞赛(SV Comp)的一组多样化C程序上评估了前沿LLMs。我们的结果表明,GPT-5和Claude Sonnet 4.5(通过测试时缩放)达到了与顶级验证工具相当的分数。然而,尽管模型通常能正确推断程序是否终止,但它们经常无法构造一个见证作为形式化证明,揭示了语义识别与符号证明生成之间的差距。随着代码长度的增加,性能进一步下降。为了分析这一差距,我们引入了一个分歧前置条件形式化方法,将非终止条件描述为逻辑约束。我们希望这些发现能激励未来在现实世界终止基准测试、结合LLMs与符号验证方法的神经符号方法,以及更广泛地关于LLMs在其他不可判定问题上推理的研究。

英文摘要:

Determining whether a program terminates is a central problem in computer science. Turing's Halting Problem established termination as undecidable, showing that no algorithm can universally determine termination for all programs and inputs. Hence, verification tools approximate termination, sometimes failing to prove or disprove; these tools rely on problem-specific architectures and are usually tied to particular programming languages. Recent advances in LLMs raise a natural question: To what extent can they reason about program termination? We evaluate frontier LLMs on a diverse set of C programs from the International Competition on Software Verification (SV-Comp) 2025. Our results show that GPT-5 and Claude Sonnet-4.5 achieve scores comparable to top-ranked verification tools (with test-time scaling). However, while models often correctly infer whether programs terminate, they frequently fail to construct a witness as formal proof, revealing a gap between semantic recognition and symbolic proof generation. Performance further degrades as code length increases. Beyond witness automaton graphs, we introduce a divergence-precondition formulation that characterizes non-termination conditions as logical constraints. We hope these findings motivate future research on real-world termination benchmarks, neuro-symbolic approaches that combine LLMs with symbolic verification methods, and, more broadly, LLM reasoning on other undecidable problems.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑