Dial: A Knowledge-Grounded Dialect-Specific NL2SQL System
Dial 面向不同数据库的 SQL 方言,将规划、检索、生成、执行反馈和语义校验串联起来,无需模型微调即可生成跨环境代码,减少知识幻觉、方言干扰和不可执行的输出。NL-LQP 把自然语言需求分解为带依赖关系的 DAG Macro-Operators;分层知识库 HINT-KB 从官方文档整理函数知识与隐式执行约束,为各个步骤提供面向意图的 Structured RAG。
生成后,系统根据真实执行反馈检索约束并定向修复,用 Logical Plan 检查语义偏移(Semantic Drift),再将验证后的经验写回知识库。我们构建了覆盖 6 个数据库、2,218 个样例的 DS-NL2SQL Benchmark;相比最强标准 Baseline,执行准确率平均提升 10.25%,方言特征覆盖率平均提升 15.77%。
Dial combines planning, retrieval, generation, execution feedback, and semantic validation to generate SQL across database dialects without model fine-tuning, addressing knowledge hallucinations, dialect interference, and non-executable outputs. NL-LQP decomposes a natural-language request into DAG macro-operators with dependencies. The hierarchical HINT-KB organizes function knowledge and implicit execution constraints from official documentation to support intent-oriented structured RAG.
The system retrieves constraints and makes targeted repairs using actual execution feedback, checks logical plans for semantic drift, and writes validated experience back to the knowledge base. We built DS-NL2SQL with 2,218 test cases across 6 databases. Compared with the strongest standard baseline, Dial improves average execution accuracy by 10.25% and dialect feature coverage by 15.77%.


