通过探查与验证结合,提升复杂文本转SQL的准确率
PV-SQL: Synergizing Database Probing and Rule-based Verification for Text-to-SQL Agents

- 用探查查询获取数据库记录,澄清字段语义和表间关系
- 规则验证生成可执行检查清单,使SQL生成更完整准确
- 在BIRD基准上提升20.8%有效效率,减少错误约束缺失
文本转SQL系统常因深层上下文理解不足而失败,尤其面对复杂查询时。我们提出PV-SQL,一种由探查(Probe)和验证(Verify)两个互补组件构成的智能体框架。探查组件通过迭代生成探测查询,从数据库中获取具体记录,以澄清值格式、列语义及表间关系,增强上下文理解。验证组件采用基于规则的方法提取可验证条件,构建可执行检查清单,支持迭代式SQL修正,有效减少遗漏约束。在BIRD基准上的实验表明,PV-SQL比最优基线在执行准确率上提升5%,在有效效率得分上提升20.8%,且消耗更少的令牌。
原文摘要 · Abstract (English)
Text-to-SQL systems often struggle with deep contextual understanding, particularly for complex queries with subtle requirements. We present PV-SQL, an agentic framework that addresses these failures through two complementary components: Probe and Verify. The Probe component iteratively generates probing queries to retrieve concrete records from the database, resolving ambiguities in value formats, column semantics, and inter-table relationships to build richer contextual understanding. The Verify component employs a rule-based method to extract verifiable conditions and construct an executable checklist, enabling iterative SQL refinement that effectively reduces missing constraints. Experiments on the BIRD benchmarks show that PV-SQL outperforms the best text-to-SQL baseline by 5% in execution accuracy and 20.8% in valid efficiency score while consuming fewer tokens.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。