提出语义感知的文本转SQL数据生成框架,解决生成查询执行成功但语义错误的问题。
SemanticAgent: A Semantics-Aware Framework for Text-to-SQL Data Synthesis

- 分三阶段:语义分析、逐步合成、诊断优化,实现可追溯推理
- 生成数据在语义质量上优于现有方法,下游微调性能更强
- 适合需要高语义准确率的文本转SQL任务研究者
现有的文本转SQL合成流程仍将可执行性与语义正确性混为一谈:仅依赖语法检查和执行验证会保留那些能运行但违背数据库语义的查询。为解决这一问题,我们提出SemanticAgent,一个语义感知的合成框架。该框架由分析器、合成器和验证器三个专用模块组成,通过语义分析、逐步合成与诊断优化的三阶段协议,将仅依赖执行结果的验证转变为可追溯的推理过程。实验表明,该框架生成的合成数据在语义质量评估中持续优于先前方法,尤其在语义要求高的基准测试上显著提升下游微调性能。
原文摘要 · Abstract (English)
Existing text-to-SQL synthesis pipelines still conflate executability with semantic validity: syntactic checks and execution-based validation can retain queries that execute successfully while violating database semantics. To address these limitations, we propose SemanticAgent, a semantic-aware synthesis framework. SemanticAgent organizes synthesis around three specialized modules: an analyzer, a synthesizer, and a verifier. Through a three-stage protocol of semantic analysis, stepwise synthesis, and diagnostic refinement, SemanticAgent transforms execution-based validation alone into a traceable reasoning process. Our framework generates synthetic data that consistently outperforms prior synthesis methods under semantic-quality evaluation, leading to stronger downstream fine-tuning performance, especially on semantically demanding benchmarks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。