arXiv ScienceSearch

arXiv · 2512.16083

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

Abstract

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Thanh Dat Hoang, Thanh Tam Nguyen, Thanh Trung Huynh, Hongzhi Yin, Quoc Viet Hung Nguyen. 2025-12-18. Scaling Text2SQL via LLM-efficient Schema Filtering with Functional Dependency Graph Rerankers. https://arxiv.org/abs/2512.16083

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

OmniTable: A Unified Wide-Table System for Petabyte-Scale LLM Data Curation and Exploration

Data curation is a critical bottleneck in industrial-grade LLM development, where petabyte-scale unstructured corpora are scattered across hundreds of physical tables, feature engineering relies on manual, table-centric pipeline orchestration, and data lineage is largely absent. We present OmniTable as an architecture blueprint for a unified wide-table layer built on Logical Unification, Physical Separation, targeting petabyte-scale LLM data curation and exploration. OmniTable makes four contributions: (1) a unified wide-table abstraction that consolidates multi-source heterogeneous data and thousands of derived features under a single logical schema via logical-physical mapping; (2) declarative feature lifecycle management that automates dependency resolution, execution planning, operator fusion, and lineage tracking, replacing manual pipeline orchestration with a "declare-and-execute" paradigm; (3) an adaptive execution engine with autonomous governance that achieves stable PB-scale feature backfill through heterogeneous compute routing (CPU/GPU), adaptive tuning, UDF-level fault tolerance, and automated storage layout optimization; and (4) hybrid-accelerated data exploration combining a global ID index, transparent OLAP offloading, and background materialized views to deliver second-level point lookups and filtered exports exceeding 20 TB/hour. In production, OmniTable manages over 35 PB of training data across web, code, PDF, and SFT domains, reducing the human-in-the-loop curation cycle from approximately 14 days to approximately 2.5 days (5.6x over the pre-OmniTable production workflow), with consistent feature versioning, auditable lineage, and minimal manual intervention.

cs.DB

A Theoretical Study of DBLog: Certified Virtual Cuts for a Snapshot-Equivalent Replay of Live Databases

DBLog is a change-data-capture (CDC) mechanism for copying a table or selected keys from a source database while continuing to stream new changes from its commit log. It reads a table in primary-key ordered chunks and brackets each read with low and high watermarks in the source log. A chunk row is discarded if a log event for the same key appears anywhere in that window. The remaining rows are emitted as refresh events after the high watermark. DBLog allows backfills to run at any time during normal operation, rather than only as an initial bootstrap, while writes and live capture continue. It was introduced in the 2019 Netflix Tech Blog post and further discussed in the 2020 DBLog paper. The mechanism has since been adopted by open-source projects, including Debezium and Apache Flink CDC. The original blog post and paper explained this mechanism but did not provide a formal correctness proof or a precise description of its replay result. In this paper, we formalize how chunk reads and log events are combined and prove that their replay reconstructs the source state up to a specific log position for the keys being copied. We define this as a virtual cut, representing a snapshot-equivalent replay without requiring a physical snapshot. DBLog emits the events needed to reconstruct the source state downstream, without storing that state itself. To verify executions independently, we provide a certificate that validates this equivalence from recorded log evidence and chunk observations. Once chunk processing completes and covers all keys, this guarantee extends to the whole table. Furthermore, appending subsequent change-stream events advances the cut forward, formalizing the seamless transition from historical backfill to live streaming. All definitions and proofs are mechanized in Isabelle/HOL.

cs.DB

When Does Low-Bit Quantization Preserve the Decisions of Vector Search?

Low-bit quantization can achieve high recall on some vector representations and fail sharply on others, while average distortion and global rank correlation do not explain the difference. We study quantized vector search at the level of the comparisons consumed by ranking and graph-pruning algorithms. Our first result is a distribution-free decomposition: the probability that a comparison flips is bounded by the probability mass of exact margins near zero plus the tail probability of the calibrated residual. We then account for dependence between residuals that share a query or graph node, and derive covariance-aware second-moment identities and tail bounds under a joint MGF proxy. For a frozen candidate permutation, we prove a deterministic coupling theorem for Vamana neighbour selection: the approximate replay returns the exact neighbour list exactly when all candidate-level pruning actions agree on the frozen exact states. We connect these results to representation geometry through an exact Gaussian oracle, establish a strict correlation gain from a deterministic magnitude bit in an aligned bilinear model, and give a rare-contamination construction showing why marginal Gaussian diagnostics do not imply the required residual tails. When analytical assumptions are unavailable, a held-out block certificate bounds the selective failure risk of a frozen quantized rule. Across learned, classical, and synthetic embeddings, standardized exact margins predict held-out ranking and pruning flip rates substantially better than global rank correlation. The framework applies to coordinate binary codes, RaBitQ, Lucene BBQ, and product quantizers through a common decision interface.

cs.DB