TL;DR
This paper introduces CORE-T, a novel framework for retrieving relevant tables for text-to-SQL queries in complex, open-book settings. CORE-T significantly improves table selection accuracy and downstream SQL execution by using LLM-generated table descriptions and a pre-computed compatibility cache, all while being training-free and efficient.
What Problem Does This Paper Address?
Text-to-SQL systems aim to make structured data accessible through natural language. A crucial step in modern pipelines is retrieving the correct set of tables from potentially vast and heterogeneous collections. This is particularly challenging in "open-book" scenarios where queries might span multiple databases or schemas without clear identifiers, and tables might be semantically similar but not joinable. Traditional dense retrieval methods excel at recall but return too many irrelevant tables, while existing join-aware methods often require extra assumptions (like database IDs) or are computationally expensive. The core problem is accurately identifying a coherent and joinable subset of tables that are relevant to a query, which is essential for generating correct SQL.
Methods
CORE-T tackles this by separating schema understanding into an offline phase and keeping the online inference lightweight.
Offline Processing: 1. Table Enrichment: Each table is serialized into a Markdown format with its schema and 5 sample rows. An LLM then generates a "purpose description" for each table, summarizing its content and typical use. This enriched text is embedded and indexed. 2. Compatibility Cache: A cache is pre-computed to estimate table-to-table joinability. This involves analyzing column header and value similarities, along with relational constraints (uniqueness, subset relation) to approximate key-foreign key relationships.
Online Processing (per query): 1. Table Retrieval: A dense retriever (DR) uses the query embedding to find a high-recall set of top-K candidate tables based on relevance. 2. Table Selection: A single LLM call, guided by a detailed prompt, selects a coherent and joinable subset from the top-K candidates. This LLM considers table relevance, pairwise compatibility scores from the cache, and aims to form connected groups. 3. Table Adjustment: A two-step additive process refines the LLM-selected subset. First, strongly compatible tables that might have been pruned are added back (seeded compatibility-based augmentation). Second, the set is greedily expanded with compatible and relevant tables until no further beneficial additions can be made.
Datasets
The paper evaluates CORE-T on several multi-table text-to-SQL benchmarks:
- BIRD (Li et al., 2023)
- SPIDER (Yu et al., 2018)
- MMQA (Wu et al., 2025)
- BEAVER (Chen et al., 2025a)
For BIRD, SPIDER, and MMQA, the authors simulate an open-book setting by pooling tables from multiple databases and removing database identifiers. BEAVER is already an open-book benchmark. For MMQA, a stratified subset of queries was used for efficiency.
Key Insights and Ideas
- LLM-generated purpose is key: Using LLMs to generate descriptive "purpose" metadata for tables significantly helps in disambiguating semantically similar tables and understanding their role, especially in large, pooled collections.
- Compatibility cache is crucial for coherence: Beyond simple relevance, pre-computing table-to-table compatibility scores allows the system to ensure that selected tables can actually be joined, leading to more coherent schemas for SQL generation.
- Training-free is a major advantage: CORE-T's ability to work without task-specific training makes it highly adaptable to new datasets and domains, a significant benefit for real-world applications.
- Lightweight LLM usage: By using a single LLM call for selection and a simple additive adjustment, CORE-T achieves strong performance with significantly fewer LLM tokens compared to iterative or multi-draft LLM approaches.
- Open-book challenges are real: The BEAVER dataset highlights the difficulties of real-world enterprise data, such as anonymized schemas, empty tables, and noisy data, which make robust table retrieval a persistent challenge.
Key Results
- Improved Table Selection: CORE-T significantly improves table-selection F1 scores, with gains of up to 22.7 points over dense retrieval (DR) on BIRD, SPIDER, and MMQA. It also retrieves fewer tables (up to 42% fewer), indicating better precision.
- Enhanced SQL Execution Accuracy: The improved table selection directly translates to better end-to-end SQL execution accuracy. CORE-T shows gains of up to 5.0 points on BIRD and 6.9 points on MMQA for multi-table queries.
- Efficiency: CORE-T uses substantially fewer LLM tokens (4-5x fewer) than LLM-intensive baselines like ARM, making it more scalable for open-book scenarios.
- Robustness: The method demonstrates robustness across different LLM selectors (Llama, Qwen) and datasets, showing consistent improvements.
Limitations and Future Work
- Limitations:
- The compatibility cache relies on key-foreign-key-like joins and might miss other complex join patterns (e.g., non-equi joins, multi-hop joins).
- Value-based signals in compatibility can be affected by sparse, skewed, or private data.
- The current approach is primarily for English-only text-to-SQL.
- The BEAVER dataset's noise (empty tables, empty execution results) makes evaluation challenging for all methods.
- Future Work:
- Extend compatibility modeling to richer join types (e.g., multi-column joins).
- Develop soft/ratio-based constraints to handle noisy data better.
- Implement incremental cache maintenance for evolving schemas.
- Explore multilingual settings and cross-modal retrieval (text and images).
Summary updated