arXiv:2601.08838cs.CLcs.AI2026-01

让数据库自己找线索,提升无标注情况下的文本转SQL准确率。

Companion Agents: A Table-Information Mining Paradigm for Text-to-SQL

  • 提前在数据库侧挖掘表间关系与语义线索,构建可复用的知识库。
  • 在无证据条件下,多数据集上提升4.49至16.71个执行准确率点。
  • 适合工业场景中缺乏人工标注的文本转SQL应用。

大规模Text-to-SQL基准如BIRD通常假设数据库注释完整准确且外部知识易获取,这无法反映工业场景中注释缺失、不全或错误的现实。这种差异严重限制了当前先进Text-to-SQL系统的真实应用。为弥合这一差距,我们提出一种以数据库为中心的方法,利用关系数据库中固有的细粒度信息,在注释匮乏条件下自动构建缺失证据,提升Text-to-SQL准确性。核心假设是:当查询需基于大量表信息进行多步推理时,现有方法难以可靠识别并利用真正相关知识。因此我们提出将查询相关知识预先“缓存”于数据库侧,推理时选择性激活。基于此,引入同伴代理(Companion Agents, CA),一组伴随数据库模式运行的智能体,主动挖掘并整合隐藏的表间关系、值域分布、统计规律和潜在语义线索。在完全缺失证据设置下对BIRD的实验表明,CA在RSL-SQL / CHESS / DAIL-SQL上分别提升+4.49 / +4.37 / +14.13的执行准确率,挑战子集上提升更高,达+9.65 / +7.58 / +16.71。这些改进源于CA的自动数据库侧挖掘与证据构建,为无需依赖人工标注证据的工业级Text-to-SQL部署提供了可行路径。

原文摘要 · Abstract (English)

Large-scale Text-to-SQL benchmarks such as BIRD typically assume complete and accurate database annotations as well as readily available external knowledge, which fails to reflect common industrial settings where annotations are missing, incomplete, or erroneous. This mismatch substantially limits the real-world applicability of state-of-the-art (SOTA) Text-to-SQL systems. To bridge this gap, we explore a database-centric approach that leverages intrinsic, fine-grained information residing in relational databases to construct missing evidence and improve Text-to-SQL accuracy under annotation-scarce conditions. Our key hypothesis is that when a query requires multi-step reasoning over extensive table information, existing methods often struggle to reliably identify and utilize the truly relevant knowledge. We therefore propose to "cache" query-relevant knowledge on the database side in advance, so that it can be selectively activated at inference time. Based on this idea, we introduce Companion Agents (CA), a new Text-to-SQL paradigm that incorporates a group of agents accompanying database schemas to proactively mine and consolidate hidden inter-table relations, value-domain distributions, statistical regularities, and latent semantic cues before query generation. Experiments on BIRD under the fully missing evidence setting show that CA recovers +4.49 / +4.37 / +14.13 execution accuracy points on RSL-SQL / CHESS / DAIL-SQL, respectively, with larger gains on the Challenging subset +9.65 / +7.58 / +16.71. These improvements stem from CA's automatic database-side mining and evidence construction, suggesting a practical path toward industrial-grade Text-to-SQL deployment without reliance on human-curated evidence.

Text-to-SQL数据库智能知识挖掘

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。