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

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Hoang, Thanh Dat, Nguyen, Thanh Tam, Huynh, Thanh Trung, Yin, Hongzhi, Nguyen, Quoc Viet Hung
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866915684285415424
author Hoang, Thanh Dat
Nguyen, Thanh Tam
Huynh, Thanh Trung
Yin, Hongzhi
Nguyen, Quoc Viet Hung
author_facet Hoang, Thanh Dat
Nguyen, Thanh Tam
Huynh, Thanh Trung
Yin, Hongzhi
Nguyen, Quoc Viet Hung
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2512_16083
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankers
Hoang, Thanh Dat
Nguyen, Thanh Tam
Huynh, Thanh Trung
Yin, Hongzhi
Nguyen, Quoc Viet Hung
Databases
Artificial Intelligence
Human-Computer Interaction
Machine Learning
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.
title Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankers
topic Databases
Artificial Intelligence
Human-Computer Interaction
Machine Learning
url https://arxiv.org/abs/2512.16083