Database
Post-SQLFix: Property-Guided Repair of LLM-Generated SQL with Runtime Verification
arXiv cs.SE0 views
arXiv:2610.41472v1 Announce Type: new Abstract: Large Language Models (LLMs) for Text-to-SQL frequently generate queries with syntax errors, invalid identifier references, or violations of SQL scoping and typing rules. Repairing these errors is a program correctness problem, yet existing approaches rely on Execution Feedback (EF), whose symptom-level, dialect-specific error messages force the LLM to speculate on root causes. We identify an Arbitration Paradox in this paradigm: the system relies on unverified models both to propose repairs and to make the final judgment on whether those repairs satisfy the required properties. We resolve this paradox by reformulating Text-to-SQL repair as property-guided program repair. Our framework, Post-SQLFix, canonicalizes SQL into a dialect-aware Canonical Query Structure (CQS) and validates it through a hierarchical static analyzer with three stratified property layers (Syntactic, Context-Free Structural, Context-Sensitive Semantic). The analyzer produces precise, schema-aware violation diagnostics to guide the LLM's repair proposals. A Verify-Before-Apply Temporal Monitor then accepts only repairs that reduce the violation count, do not reintroduce resolved violations, and satisfy the operator contracts. These runtime invariants are bounded by the declared rule family and operator contracts, while a finite retry budget ensures halting. On three established benchmarks (BIRD, Spider, Mini-Dev) spanning over 3,000 evaluation instances, three SQL dialects (SQLite, MySQL, PostgreSQL), and six model configurations, Post-SQLFix resolves 77.8% of the execution errors that EF leaves unrepaired, while requiring less than half as many repair iterations and 30% fewer tokens. Crucially, accepted transitions under the monitor introduce no statically detectable structural regressions in our evaluation, translating checked repair fidelity into absolute accuracy improvements of up to +11.6 percentage points.
Source:https://arxiv.org/abs/2610.41472PreviousWhat Does a Repair Agent Gain from Remembering Its Failure? An Exploratory Study on Real Python BugsNextSCRBench: Beyond Equivalence Checking for Semantic Change Reasoning in Code
Related posts
SOLID Principles Explained: 5 Essential Principles for Writing Clean, Maintainable Code
0dev.to Tutorial
How to Build a Professional Resume in 2026: Best Resume Formats, Templates, and ATS Tips
0dev.to Career
How to Explain Your Project in a Technical Interview
0dev.to Career
Stop Calling It "Refactoring" When You Are Just Moving The Bugs Around
0dev.to Career
PostgreSQL migrations that lock a busy table
0dev.to Testing

🧠 Do Prompt ao RAG: como fazer um LLM responder sem inventar (e sem processo do cliente)
0dev.to Java