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.

arXiv.org

TIL:

  • There is a psychology.fandom.com wiki. someone made a wiki about psychology on fandom.com
  • It has an article about the Chomsky hierarchy (which is usually a programming/CS topic)
  • It has 34 thousand pages and is updated semi-regularily

Though it does seem quite a lot is taken from wikipedia.

#psychology #programming #formallanguages #wikipedia

Cactus Language • Overview 3.2
https://inquiryintoinquiry.com/2025/03/07/cactus-language-overview-3/

Given a body of conceivable propositions we need a way to follow the threads of their indications from their object domain to their values for the mind and a way to follow those same threads back again. Moreover, we need to implement both ways of proceeding in computational form. Thus we need programs for tracing the clues sentences provide from the universe of their objects to the signs of their values and, in turn, from signs to objects. Ultimately, we need to render propositions so functional as indicators of sets and so essential for examining the equality of sets as to give a rule for the practical conceivability of sets. Tackling that task requires us to introduce a number of new definitions and a collection of additional notational devices, to which we now turn.

Resources —

Cactus Language • Overview
https://oeis.org/wiki/Cactus_Language_%E2%80%A2_Overview

Survey of Animated Logical Graphs
https://inquiryintoinquiry.com/2024/03/18/survey-of-animated-logical-graphs-7/

Survey of Theme One Program
https://inquiryintoinquiry.com/2024/02/26/survey-of-theme-one-program-6/

#Peirce #Logic #Semiotics #LogicalGraphs #DifferentialLogic
#AutomataTheory #FormalLanguages #FormalGrammars #GraphTheory

Cactus Language • Overview 3

In the development of Cactus Language to date the following two species of graphs have been instrumental. Painted And Rooted Cacti (PARCAI). Painted And Rooted Conifers (PARCOI). It suffices to beg…

Inquiry Into Inquiry

Cactus Language • Overview 3.1
https://inquiryintoinquiry.com/2025/03/07/cactus-language-overview-3/

In the development of Cactus Language to date the following two species of graphs have been instrumental.

• Painted And Rooted Cacti (PARCAI).
• Painted And Rooted Conifers (PARCOI).

It suffices to begin with the first class of data structures, developing their properties and uses in full, leaving discussion of the latter class to a part of the project where their distinctive features are key to developments at that stage. Partly because the two species are so closely related and partly for the sake of brevity, we'll always use the genus name “PARC” to denote the corresponding cacti.

To provide a computational middle ground between sentences seen as syntactic strings and propositions seen as indicator functions the language designer must not only supply a medium for the expression of propositions but also link the assertion of sentences to a means for inverting the indicator functions, that is, for computing the “fibers” or “inverse images” of the propositions.

#Peirce #Logic #Semiotics #LogicalGraphs #DifferentialLogic
#AutomataTheory #FormalLanguages #FormalGrammars #GraphTheory

Cactus Language • Overview 2
https://inquiryintoinquiry.com/2025/03/06/cactus-language-overview-2/

In order to facilitate the use of propositions as indicator functions it helps to acquire a flexible notation for referring to propositions in that light, for interpreting sentences in a corresponding role, and for negotiating the requirements of mutual sense between the two domains. If none of the formalisms readily available or in common use meet all the design requirements coming to mind then it is necessary to contemplate the design of a new language especially tailored to the purpose.

In the present application, there is a pressing need to devise a general calculus for composing propositions, computing their values on particular arguments, and inverting their indications to arrive at the sets of things in the universe which are indicated by them.

For computational purposes it is convenient to have a middle ground or an intermediate language for negotiating between the “koine” of sentences regarded as strings of literal characters and the realm of propositions regarded as objects of logical value, even if that makes it necessary to introduce an artificial medium of exchange between the two domains.

If the necessary computations are to be carried out in an organized fashion, and ultimately or partially by familiar classes of machines, then the strings expressing logical propositions are likely to find themselves parsed into tree‑like data structures at some stage of the game. As far as their abstract structures as graphs are concerned, there are several species of graph‑theoretic data structures fitting the task in a reasonably effective and efficient way.

#Peirce #Logic #Semiotics #LogicalGraphs #DifferentialLogic
#FormalLanguages

Cactus Language • Overview 2

In order to facilitate the use of propositions as indicator functions it helps to acquire a flexible notation for referring to propositions in that light, for interpreting sentences in a correspond…

Inquiry Into Inquiry
Cactus Language • Overview 1

Thus, what looks to us like a sphere of scientific knowledge more accurately should be represented as the inside of a highly irregular and spiky object, like a pincushion or porcupine, with very sh…

Inquiry Into Inquiry

Cactus Language • Overview 1.1
https://inquiryintoinquiry.com/2025/03/01/cactus-language-overview-1/

❝Thus, what looks to us like a sphere of scientific knowledge more accurately should be represented as the inside of a highly irregular and spiky object, like a pincushion or porcupine, with very sharp extensions in certain directions, and virtually no knowledge in immediately adjacent areas. If our intellectual gaze could shift slightly, it would alter each quill’s direction, and suddenly our entire reality would change.❞

— Herbert J. Bernstein • “Idols of Modern Science”

The following report describes a calculus for representing propositions as sentences, that is, as syntactically defined sequences of signs, and for working with those sentences in light of their semantically defined contents as logical propositions. In their computational representation the expressions of the calculus parse into a class of graph‑theoretic data structures whose underlying graphs are called “painted cacti”.

Painted cacti are a specialization of what graph‑theorists refer to as “cacti”, which are in turn a generalization of what they call “trees”. The data structures corresponding to painted cacti have especially nice properties, not only useful in computational terms but interesting from a theoretical standpoint. The remainder of the present Overview is devoted to motivating the development of the indicated family of formal languages, going under the generic name of Cactus Language.

#Peirce #Logic #Semiotics #LogicalGraphs #DifferentialLogic
#Automata #FormalLanguages #FormalGrammars #GraphTheory

Cactus Language • Overview 1

Thus, what looks to us like a sphere of scientific knowledge more accurately should be represented as the inside of a highly irregular and spiky object, like a pincushion or porcupine, with very sh…

Inquiry Into Inquiry

Theme One Program • Motivation 1
https://inquiryintoinquiry.com/2024/06/03/theme-one-program-motivation-1-b/

The main idea behind the Theme One program is the efficient use of graph‑theoretic data structures for the tasks of “learning” and “reasoning”.

I am thinking of “learning” in the sense of learning about an environment, in essence, gaining information about the nature of an environment and being able to apply the information acquired to a specific purpose.

Under the heading of “reasoning” I am simply lumping together all the ordinary sorts of practical activities which would probably occur to most people under that name.

There is a natural relation between the tasks. Learning the character of an environment leads to the recognition of laws which govern the environment and making full use of that recognition requires the ability to reason logically about those laws in abstract terms.

Resources —

Theme One Program • Overview
https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_Overview

Theme One Program • Exposition
https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_Exposition

Theme One Program • User Guide
https://www.academia.edu/5211369/Theme_One_Program_User_Guide

Survey of Theme One Program
https://inquiryintoinquiry.com/2024/02/26/survey-of-theme-one-program-6/

#ThemeOneProgram #Learning #Reasoning
#Logic #LogicalGraphs #FormalLanguages
#Algorithm #DataStructure #GraphTheory
#Peirce #PragmaticSemioticInformation
#Empiricism #Rationalism #Pragmatism

Theme One Program • Motivation 1

The main idea behind the Theme One program is the efficient use of graph-theoretic data structures for the tasks of “learning” and “reasoning”. I am thinking of learnin…

Inquiry Into Inquiry

Today (3PM GMT, May 15), I will be hosting this week's Formal Language and Neural Networks (FLaNN - https://flann.super.site/) seminar.

The speaker is Frank Drewes from Umeå University, who will be talking about Graph Extension Grammars.

This is a fantastic weekly seminar focusing on the interpretability and computational power of neural language models, especially as related to formal languages.

Check out the site for past and future talks!

#ML #Interpretability #FormalLanguages

FLaNN Seminars

We organize a series of weekly online seminars on Formal Language Theory, Natural Language Processing, Machine Learning and Computational Linguistics in an informal setting.

FLaNN Seminars

OK one more #mathematics & #formalLanguages question, not unrelated to the stupid equations below:

Surely (he said, in the form of a question) somebody has explored the "compressibility" of random arithmetic, trigonometric and other symbolic math expressions under standard simplification rules. Right?

For example, here's a random S-expression, simplified by sage to something shorter (and with fewer terms).

Have we talked about probability distributions of simplified tree sizes?