Repairing LLM-Generated Specifications with Deterministic Diagnosis
Giovanni Vaccarino, Emanuele La Malfa, Dehai Min, Hanrong Zhang, Pier Luca Lanzi, Lu Cheng, Michael J. Wooldridge, Philip S. Yu, Sara Bernardini
Abstract
Large language models (LLMs) are increasingly used as formalizers: given a reasoning problem expressed in natural language, they produce a formal specification that a symbolic solver can then solve, with guarantees relative to that specification. Many specifications are runnable yet semantically wrong, encoding incorrect constraints, domains, objectives, predicates, or goals, and solver-error feedback dries up once execution succeeds. Purely LLM-based diagnosis, lacking a formal ground truth, often fails to spot these errors, and its ungrounded critiques cause regressions in 11.8% of initially correct specifications in our experiments. We propose DRAGO, a repair framework that replaces this ungrounded critique with deterministic, formalism-specific diagnosis, and retains a rewrite only when the diagnosed error weight strictly decreases under a reference-free acceptance predicate. Across five benchmarks spanning logical reasoning (SMT-LIB2), constraint programming (MiniZinc), and planning (PDDL), DRAGO cuts regressions by nearly an order of magnitude, to 1.3%, while improving answer accuracy by 12.9 percentage points over zero-shot formalization and 8.7 percentage points over LLM-diagnostic repair, averaged across benchmarks. We also uncover two rendering defects in Planetarium that cause 50% (3,086 instances) of its floor-tile split to be inconsistent with the reference formalizations, and release a corrected split.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL
Related papers
LocalIntent: Outcome-Specific Structured Generation for Backend-Compatible Smart Building Automation with Local LLMs
Shared title terminologycs.AITianyang Liu, Jiayue Wang, Zhanhao Cheng et al.
Causal Value Attribution of Marketing Labels in LLM-Generated Ads: A Deconfounder Approach
Shared title terminologycs.AIDanhong You, Wei Jiang, Zhiqiang et al.
Wactorz: Self-Writing LLM Agents That Discover, Repair, and Migrate at the Edge
Shared title terminologycs.AIPanagiotis Kasnesis, Lazaros Toumanidis, Amalia Contiero Syropoulou et al.
Scalar Tuned Lens Summaries Offer Limited Incremental Value for Mid-Generation Abstention
Shared title terminologycs.AIKhurram Khalil, Khaza Anuarul Hoque
VeriLadder: A Multi-Agent Specification Refinement System for Tool-Verified Verilog Datasets
Shared title terminologycs.AISaeid Rajabi, Chengmo Yang, Satwik Patnaik
The Effect of Security-Focused Prompts on Reported Findings: A Controlled Experiment on 400 AI-Generated Web Applications
Shared title terminologycs.AIDarko Andročec