arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2512.16083cs.DBcs.AIcs.HCcs.LG
收藏

通过LLM高效模式过滤实现Text2SQL扩展

Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankers

Griffith University(格里菲斯大学);VinUniversity(VinUniversity大学);The University of Queensland(昆士兰大学)

Thanh Dat Hoang, Thanh Tam Nguyen, Thanh Trung Huynh, Hongzhi Yin, Quoc Viet Hung Nguyen

AI总结:

通过LLM高效模式过滤框架提升Text2SQL系统在大规模模式下的性能与效率

摘要:

大多数现代Text2SQL系统会将整个模式(主要是列信息)与用户的问题一起提示给大型语言模型(LLMs)。虽然在小型数据库上有效,但这种方法在现实世界中超过LLM上下文限制的模式上失效,即使对于商业模型也是如此。最近的Spider 2.0基准测试就体现了这一点,其中数百张表和数万列的模式使现有系统经常崩溃。当前的缓解措施要么依赖于昂贵的多步骤提示管道,要么通过将列独立地与用户的问题进行排名来过滤列,忽略了列之间的结构关系。为了扩展现有系统,我们引入了\toolname,一个开源的LLM高效模式过滤框架,通过(i)使用增强值和元数据的查询感知LLM编码器对列进行排名,(ii)通过轻量级图变压器在函数依赖上重新排名互连列,以及(iii)使用Steiner树启发式方法选择保持连接性的子模式来压缩Text2SQL提示。在真实数据集上的实验表明,\toolname在召回率接近完美且比CodeS、SchemaExP、Qwen重新排名器和嵌入检索器的精度更高,同时保持亚秒级的中位延迟,并能扩展到具有23000+列的模式。我们的源代码可在https://github.com/thanhdath/grast-sql上获得。

英文摘要:

Most modern Text2SQL systems prompt large language models (LLMs) with entire schemas -- mostly column information -- alongside the user's question. While effective on small databases, this approach fails on real-world schemas that exceed LLM context limits, even for commercial models. The recent Spider 2.0 benchmark exemplifies this with hundreds of tables and tens of thousands of columns, where existing systems often break. Current mitigations either rely on costly multi-step prompting pipelines or filter columns by ranking them against user's question independently, ignoring inter-column structure. To scale existing systems, we introduce \toolname, an open-source, LLM-efficient schema filtering framework that compacts Text2SQL prompts by (i) ranking columns with a query-aware LLM encoder enriched with values and metadata, (ii) reranking inter-connected columns via a lightweight graph transformer over functional dependencies, and (iii) selecting a connectivity-preserving sub-schema with a Steiner-tree heuristic. Experiments on real datasets show that \toolname achieves near-perfect recall and higher precision than CodeS, SchemaExP, Qwen rerankers, and embedding retrievers, while maintaining sub-second median latency and scaling to schemas with 23,000+ columns. Our source code is available at https://github.com/thanhdath/grast-sql.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑