atlas

Research map / Large language models / Agents, code and math

Enhancing SQL Query Generation with Neurosymbolic Reasoning

AAAI 2025 · Large language models › Agents, code and math · approach: LLM-guided program synthesis · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Xander, a neurosymbolic best-first search framework that wraps a fine-tuned LM with symbolic partial-query checking, fuzzing-based repair, and a Normalized SQL format to generate SQL from questions plus I/O examples.

Problem

Generating SQL queries from natural language questions plus user-provided input/output examples, where LMs make syntax, runtime and example errors and the solution space is large.

Approach

Explores a solution tree with Best-First Search and backtracking over LM token continuations, pruning partial queries with a symbolic checker (vocabulary, scope, type checks), repairing complete queries via Hamming-distance-one fuzzing, and using Normalized SQL to reduce stylistic variation.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add XanderCodeT5 small · Spider validationexecution accuracy: 69.9 -> 78.6Helped
Add XanderCodeT5 base · Spider validationexecution accuracy: 73.6 -> 80.5Helped
Add XanderBART · Spider validationexact match accuracy: 51.5 -> 39.0Hurt
Add XanderMicrosoft Phi-1.5 · Spider validationexecution accuracy: 42.3 -> 72.0Helped
Use Normalized SQL instead of SQL (ablation)CodeT5 small, one attempt · Spider validationexecution accuracy: 48.7 -> 58.4Helped
Add examples to the input specification (ablation)CodeT5 small with Normalized SQL, one attempt · Spider validationexecution accuracy: 58.4 -> 59.7Helped
Add PQC (ablation)CodeT5 small with Normalized SQL and examples, one attempt · Spider validationexecution accuracy: 59.7 -> 63.9Helped
Allow multiple attempts instead of one attempt (ablation)CodeT5 small with Normalized SQL and examples · Spider validationexecution accuracy: 59.7 -> 76.0Helped
Add PQC (ablation)CodeT5 small with Normalized SQL and examples, multiple attempts · Spider validationexecution accuracy: 76.0 -> 78.4Helped
Add enumerative repair (ablation)CodeT5 small with PQC and multiple attempts · Spider validationexecution accuracy: 78.4 -> 78.6No clear effect
Add enumerative repair (ablation)CodeT5 base with PQC and multiple attempts · Spider validationexecution accuracy: 80.4 -> 80.5No clear effect
Add enumerative repair (ablation)CodeT5 small with PQC and multiple attempts · Spider validationvalidation time per sample: 10.2 -> 9.1Helped

Surprising findings

Limitations

Experimental setup

Datasets: Spider

Benchmarks: Spider validation set

Metrics: execution accuracy exact match accuracy validation time per sample

Baselines: CodeT5 small CodeT5 base BART CodeGen Microsoft Phi-1.5 ChatGPT-3.5 Picard Duoquest RASAT REDSQL

Builds on: Picard CodeRL Byte-Pair Encoding Distilled Test Suites

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy