about
Grammars of Formal Uncertainty (arxiv.org)
34 points by barthelomew on May 27, 2025 | hide | past | pdf | 5 comments on HN

In plain words: Instead of trusting the model's own confidence scores, which miss its mistakes, this study measures uncertainty from the grammar of the formal logic code it writes. Combining those signals and checking only shaky cases cut errors 14 to 100% while rarely skipping any.

Abstract · Grammars of Formal Uncertainty: When to Trust LLMs in Automated Reasoning Tasks

Large language models (LLMs) show remarkable promise for democratizing automated reasoning by generating formal specifications. However, a fundamental tension exists: LLMs are probabilistic, while formal verification demands deterministic guarantees. This paper addresses this epistemological gap by comprehensively investigating failure modes and uncertainty quantification (UQ) in LLM-generated formal artifacts. Our systematic evaluation of five frontier LLMs reveals Satisfiability Modulo Theories (SMT) based autoformalization's domain-specific impact on accuracy (from +34.8% on logical tasks to -44.5% on factual ones), with known UQ techniques like the entropy of token probabilities failing to identify these errors. We introduce a probabilistic context-free grammar (PCFG) framework to model LLM outputs, yielding a refined uncertainty taxonomy. We find uncertainty signals are task-dependent (e.g., grammar entropy for logic, AUROC>0.93). Finally, a lightweight fusion of these signals enables selective verification, drastically reducing errors (14-100%) with minimal abstention, transforming LLM-driven formalization into a reliable engineering discipline.

Debargha Ganguly, Vikash Singh, Sreehari Sankar, Biyao Zhang, Xuecen Zhang, Srinivasan Iyengar, Xiaotian Han, Amit Sharma, Shivkumar Kalyanaraman, Vipin Chaudhary
arXiv:2505.20047 · cs.CL, cs.AI, cs.LO, cs.SE · submitted May 26, 2025
abstract · pdf · html

add comment on HN

This seems like the type of work that, whether or not it itself is profound (which I believe it seems it is), will accelerate the forthbringing of derivative works that will definitely be profound.
Elegant indeed. Bridges the formal and probabilistic paradigms
I do not see much backing to the claim LLMs can "democratize" formal methods, given that their specifications likely still have to be proof-read by an actual expert. There's also the issue that plain assertion-checking will only take you so far: formal specifications typically need to account for the passing of time, and then the tailoring of the verification platform to the system, rather than property specification, is what usually takes the most effort.

But the general approach to uncertainty and connections to OoD detection do sound interesting.

Great breakdown—PCFG-based uncertainty metrics seem like exactly what we need to make LLM-SMT pipelines robust and reliable!
Brings out a refreshing perspective to LLM guarantees. Very good work.