TL;DR
Translating messy English requirements into strict mathematical logic—autoformalization—is finally practical thanks to LLMs, yet inherently dangerous because LLMs guess without formal guarantees. Rather than blindly trusting an LLM's most popular answer, this paper arranges multiple LLM-generated candidate formulas into a solver-verified hierarchy of logical strength called an Entailment Graph. By navigating this graph, we can safely bracket the true intent of an English statement—guaranteeing we never let a security violation slip through, even when the human prompt is ambiguous.
What Problem Does This Paper Address?
Suppose you want to verify that a cloud configuration obeys the rule: "All requests to the payment service must be authenticated." To use an automated verifier or theorem prover, you first have to translate that English sentence into formal logic.
LLMs are great at drafting these translations, but natural language is notoriously ambiguous. Does "authenticated" mean a simple API key, mutual TLS, or mTLS plus a signed token? If you ask an LLM ten times, you might get several logically distinct formulas. Standard selection tricks—like taking a majority vote—rely on statistical popularity, not logical safety. In verification, a formula that is too weak lets unsafe bugs slip into production; one that is too strong rejects valid setups.
Crucially, you don't always need an exact match—you need one-sided safety. If you are enforcing a security rule, your formula must be sufficient (at least as strict as the true intent). If you are relying on a rule as an assumption, it must be necessary (claiming no more than the intent guarantees).
Methods
The authors introduce a neurosymbolic division of labor that pairs an LLM with an SMT solver (like cvc5):
- Build the Entailment Graph (Symbolic): An LLM generates a pool of candidate formulas in SMT-LIB format. The SMT solver groups equivalent formulas and orders the clusters into a Directed Acyclic Graph from logically strongest (most restrictive) to weakest (most permissive), completed with universal
False($\bot$) at the top andTrue($\top$) at the bottom.
- Compute Edge Deltas (Symbolic): For every edge from a stronger formula $u$ to a weaker formula $v$, the solver defines the exact mathematical gap between them: the co-residual ($v \land \neg u$, the extra cases $v$ permits) and the residual ($v \Rightarrow u$, the extra constraint needed to recover $u$). Notice that no background context is needed yet—one graph serves any context.
- Frontier Searches (Neurosymbolic): Given a natural-language statement and context, two searches walk the graph using an LLM entailment oracle to make localized, inspectable
yes/nojudgments on edges: - Downward search starts strong and weakens across edges as long as the extra cases permitted ($v \land \neg u$) still satisfy the English rule, halting at the sufficient frontier ($F_\downarrow$).
- Upward search starts weak and strengthens across edges as long as the English rule guarantees the added constraint ($v \Rightarrow u$), halting at the necessary frontier ($F_\uparrow$).
Everything trapped between these two frontiers is captured as a single formula called the ambiguity residue—pinpointing the exact scenarios left undecided. All theoretical guarantees are machine-checked in the Lean 4 proof assistant.
Datasets
There is no model training here; evaluation uses Claude Opus 4.6 and cvc5 on AWS Cloud Security properties (Infrastructure-as-Code rules over CloudFormation schemas):
- Expert-Adjudicated Benchmark: 64 established natural-language properties across 20 AWS resource types (e.g., S3, EC2, IAM), validated by deploying real conforming and violating templates to AWS. 20 of these produced non-equivalent candidate pools (non-zero semantic entropy) and form the core benchmark.
- Scale Study: A newly constructed set of 192 statements (152 with non-zero entropy) created by mutating the original 64 properties and prompting for 10 distinct formalizations without background briefings.
Key Insights and Ideas
- Asymmetric Error Makes Imperfect Oracles Safe: Breaking one global "is this formula right?" question into step-by-step edge checks changes what happens when the LLM errs. If the oracle wrongly rejects an edge, the search simply stops early, returning a conservative—but still 100% safe—formula. Only wrongly accepting a weakening compromises safety.
- Safety Regardless of Pool Quality: Even if the LLM generates a terrible pool of candidates that misses the true intent, a sound oracle will never pick an unsafe formula—at worst, it collapses to $\bot$ and explicitly reports "no sufficient formalization."
- Ambiguity as a Formula, Not a Score: Unlike semantic entropy, which outputs a single number (e.g.,
1.846 bitsof uncertainty), the ambiguity residue is an actual logical formula (like "stages with zero configured methods"). It tells you what clarifying question to ask next.
Key Results
- 100% Safety on Expert Benchmark: Across the 20 non-trivial AWS properties, Entailment Graph (EG) selection was safe in 20/20 cases (matching the exact expert reference in 18, conservative in 2, and 0% unsafe). Meanwhile, Majority Vote (MV) was unsafe in 25% (5/20) of cases, and Universal Self-Consistency (USC) was unsafe in 10% (2/20).
- The Graph Is Doing the Heavy Lifting: In an ablation ("flat filter") where the exact same LLM oracle judged each candidate globally without the graph, it made unsafe picks in 25% (5/20) of cases, rejected every candidate in 30% (6/20), and contradicted basic logic in 3/20 cases.
- Scale Study & Soundness: Across 152 scale-study statements, MV and USC picked formulas weaker than EG's certified frontier 23.7% and 22.4% of the time. Manual audit of LLM-flagged EG selections found at least 98.0% safety (149/152, with 3 oracle misses). Direct solver verification of accepted edge checks showed the oracle was sound on 22 of 23 decidable checks.
Limitations and Future Work
- Shared Model Blind Spots: Candidate generation, the entailment oracle, and the scale-study audit judge all used Claude Opus 4.6, meaning a shared misreading of an English rule can slip past all stages (and unflagged scale-study cases were not manually inspected).
- Root-Seeding Shortcut: While the theory starts unconditionally from $\bot$, the implementation seeds searches directly at the graph's roots without an initial oracle check—causing false selections when no candidate in the pool is strong enough (spotted 10 times in the scale study).
- Informal Context Limits Disambiguation Checks: When frontiers don't overlap and background context exists only in English, the solver returns
unknownon whether the ambiguity residue is satisfiable (7/20 benchmark cases). - Future Directions: Using the ambiguity residue to automatically ask humans targeted clarifying questions, and extending Entailment Graphs from single formulas to two-sided $(P, Q)$ assume-guarantee contracts.
Summary updated