NIFT-SQL: Customer-Supervised Table Scoring for Enterprise Text-to-SQL Retrieval

Arjun Rao, Nishant GopinatharXiv 2026 · arXiv

TL;DR

NIFT-SQL improves table retrieval for enterprise text-to-SQL by training small, customer-specific models on existing example questions. By fusing fine-tuned hybrid search with a cross-encoder scorer that evaluates every table in a schema, it achieves massive gains over generic zero-shot methods, especially for complex queries requiring multiple tables.

What Problem Does This Paper Address?

In the world of enterprise text-to-SQL, the biggest bottleneck isn't writing the SQL code—it's finding the right tables in the first place. Enterprise databases are often a "data swamp": schemas span dozens of databases, contain thousands of tables, and use cryptic naming conventions (like fclt_org_dlc_key) that generic embedding models have never seen.

Furthermore, enterprise questions are rarely simple. They often require joining four or five tables. If a retrieval system misses even one "bridge" table, the downstream LLM cannot generate a correct query. Standard retrieval methods struggle because they lack "local" knowledge of a specific company's data and often fail to find all necessary tables within a small enough context window for an LLM.

Methods

The authors introduce NIFT-SQL (Necessity-Informed Fusion for Text-to-SQL), a retrieval pipeline designed to be trained separately for each customer using their existing verified question-SQL pairs.

Figure 1: NIFT-SQL at inference: hybrid search with a retriever fine-tuned per customer, a per-customer scorer over every table, and a fusion fitted on held-out questions; the optional high-accuracy mode adds two features from a zero-shot reranker over the candidates

The system consists of three main components:

  1. Fine-tuned Hybrid Search: Combines BM25 (keyword search) with a BGE embedding model that has been fine-tuned on the customer's specific data.
  2. Per-Customer Scorer: A 560M parameter cross-encoder (BGE-reranker-large) fine-tuned to answer a binary question: "Is this table needed for this query?" Crucially, it scores every table in the schema, not just a shortlist.
  3. Learned Fusion: A logistic regression model that combines scores from the search and the scorer. It uses features like ranks, raw scores, and—importantly—database-level grouping to produce a final ranking.

For users who prioritize performance over compute cost, an Optional High-Accuracy Mode adds features from a zero-shot 8B reranker (Qwen3-Reranker-8B).

Datasets

The researchers evaluated NIFT-SQL on three challenging benchmarks derived from real-world and enterprise-style data:

  • BEAVER: Based on real enterprise data warehouses; it is the most difficult due to its cryptic names and the fact that 90% of queries require 3+ tables.
  • LiveSQLBench & LiveSQLBench-Large: Enterprise-style schemas. The "Large" version is particularly daunting, featuring 971 tables across 18 different databases.
Table 1. Datasets, schema cards in the names-and-keys setting.

Key Insights and Ideas

  • Supervision is the "Active Ingredient": The biggest performance jumps came from fine-tuning on customer-specific labels. A small 560M model with local training can outperform much larger general-purpose models.
  • Scoring the Whole Catalog: Unlike most systems that only rerank a "top 100" shortlist, NIFT-SQL's scorer looks at every table. This allows it to find "bridge" tables that might have zero keyword overlap with the question but are essential for joins.
  • Database Grouping is a Cheat Code: In large enterprise environments, tables are organized into databases. The authors found that teaching the fusion model to recognize which database is relevant is often more important than ranking individual tables within that database.
  • Efficiency Matters: NIFT-SQL is designed to be "cheaper and better." The fine-tuned 560M scorer can evaluate an entire 971-table schema in about 2 seconds—roughly the same time a large 8B reranker takes to score just 100 tables.

Key Results

The primary metric used is complete@K: the percentage of questions where all required tables are found within the top K results.

Main Results Table
  • Massive Gains over Search: On the 971-table LiveSQLBench-Large set, NIFT-SQL reached 85.6% complete@15, compared to a dismal 21.8% for standard hybrid search.
  • Beating the Giants: NIFT-SQL outperformed a zero-shot 8B reranker by a wide margin on the largest schemas.
  • Multi-Table Mastery: NIFT-SQL's advantage is most pronounced on complex queries. For questions requiring 5 or more tables, it outperformed the next best baseline by over 20 percentage points.

Limitations and Future Work

  • Retrieval vs. Execution: The paper focuses on finding the tables (coverage), not the final SQL accuracy. While good retrieval is a prerequisite for good SQL, it doesn't guarantee it.
  • Synthetic-to-Real Gap: When trained only on synthetic questions, the scorer's performance dropped when faced with real-world user logs. This suggests that high-quality, human-verified training data is still vital.
  • Independent Scoring: Currently, the model scores each table independently. It doesn't "reason" about the join path as a whole. Future work could involve joint table selection to ensure the retrieved set forms a valid, connected graph.
  • Metadata Constraints: The study intentionally limited itself to table names and keys. Incorporating column descriptions or sample rows (when available and trustworthy) could further boost accuracy.

Summary updated

Abstract

Enterprise text-to-SQL starts with finding the tables a question needs, which is hard when a schema spans several databases and hundreds of cryptic tables. We ask whether models trained separately on each customer's example questions, reading only table names, column names, and declared keys, improve table retrieval. NIFT-SQL (Necessity-Informed Fusion for Text-to-SQL) fuses hybrid search over a retriever fine-tuned on the customer's questions with a fine-tuned 560M cross-encoder that scores every table for whether the query needs it, through a logistic regression fitted on held-out questions. On BEAVER, LiveSQLBench, and LiveSQLBench-Large (244 to 971 tables; four splits, three trainings), NIFT-SQL places every reference table in the top 15 for 69.2%, 89.5%, and 85.6% of test questions, against 30.4%, 41.0%, and 21.8% for hybrid search and 61.1%, 81.7%, and 70.4% for the fine-tuned retriever with the same labels. With off-the-shelf search, the cross-encoder without fine-tuning is 21 points lower. A zero-shot 8B reranker needs no labels and, routed by database, shows no resolved complete@15 difference on two collections; adding its scores as two fusion features gives a high-accuracy mode that reaches 72.4%, 92.5%, and 88.6%, ahead of the validation-selected zero-shot reranker variant on two collections, with no resolved difference on the third. Rank fusion of the two trained parts, grouped by database, shows no resolved difference from the learned fusion. Scored once on a newer BEAVER release, NIFT-SQL beats search and leads the label-matched retriever at top 8 on the synthetic test, but trails it at top 15 on real questions.
BibTeX
@misc{rao2026nift,
  author = {Arjun Rao and Nishant Gopinath},
  title = {{NIFT-SQL: Customer-Supervised Table Scoring for Enterprise Text-to-SQL Retrieval}},
  year = {2026},
  eprint = {2611.12731},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.12731},
}
Figure