Schema-Aware Localisation (SAL): Live Schema Grounding and Hallucination Validation for Oracle NL2SQL
- URL: http://arxiv.org/abs/2607.22572v1
- Date: Wed, 03 Jun 2026 03:12:18 GMT
- Title: Schema-Aware Localisation (SAL): Live Schema Grounding and Hallucination Validation for Oracle NL2SQL
- Abstract summary: Columns and aliases are hallucinated and dialect-specific syntax is missed, leading to ORA-00904 invalid-identifier errors.<n>This paper introduces-Aware Localisation (SAL), a lightweight layer for Oracle NL2 that requires no model retraining.<n>We evaluate SAL on 500 TPC-H natural language questions executed against a live Oracle Autonomous Database 23c instance.
- Score: 0.19116784879310023
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Large language models can generate fluent SQL from natural language, but on real enterprise Oracle databases they frequently fail at execution time: columns and aliases are hallucinated and dialect-specific syntax is missed, leading to ORA-00904 invalid-identifier errors. In this setting, failures are primarily due to missing schema grounding: the model cannot know which tables and columns actually exist. This paper introduces Schema-Aware Localisation (SAL), a lightweight middleware layer for Oracle NL2SQL that requires no model retraining. SAL queries Oracle's USER_TAB_COLUMNS catalog to build a live schema map, selects a relevant table subset for each question (falling back to the full schema for multi-table queries), and injects this ground-truth context into the LLM prompt. Generated SQL is then checked by the Hallucination Index (Hidx), which validates every alias.column reference against the live catalog, automatically rewrites predictable prefix errors, and otherwise triggers a structured retry with itemised corrections. We evaluate SAL on 500 TPC-H natural language questions executed against a live Oracle Autonomous Database 23c instance using GPT-4o-mini. Without any schema grounding, execution-grounded truth (EGT; executes and matches the reference result set) is 2.2% (12/500). A hand-written static schema hint brings EGT to 62.0%. SAL, with no manual schema curation, achieves 62.6% EGT (96% simple, 95% medium, 40.7% complex) while reducing execution failures from 97.6% to 2.6%.
Related papers
- DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generation [11.797290397638962]
This paper develops textscDexter, a prompting/non-fine-tuning text-based system for complex questions.<n>textscDexter achieves higher accuracy compared to the state-of-the-art using both open-source/weight models.
arXiv Detail & Related papers (2026-08-12T10:17:08Z) - DRL: A Deterministic Relational Middleware Layer for Transaction-Safe Enterprise NL2SQL Under Schema-Graph Scaling [0.19116784879310023]
Deploying natural-language interfaces over enterprise O fails scale because schemagraph fails to scale at scale.<n>We present DRL, a safe pipeline interposing between front-ends backends.<n>We evaluate DRL onop, a 1,000 scaling model, and an enterprise schema-linked NL2 taxonomy.<n>GPT-4o, Claude Sonnet 4.5, and Gemini 2.5 Flash achieve 52.9%, 54.5%, and 52.1% execution match under a corrected evaluation harness.
arXiv Detail & Related papers (2026-07-23T18:01:11Z) - Spider 2.0-AIFunc: Extending Real-World Text-to-SQL to AI-Native SQL Workflows [54.49251107006261]
We introduce Spider 2.0-AIFunc, a benchmark of 465 verified instances across 125 real-world databases covering six types of AI functions on the Snowflake platform.<n>We find that the strongest proprietary models reach 67-70% execution accuracy while the best open-source model achieves 58.1%.
arXiv Detail & Related papers (2026-07-07T12:54:08Z) - Schema-First Retrieval: Embedding Catalogs for Natural Language Analytics [0.10210859604701106]
Modern warehouses contain thousands of tables, abbreviated columns, informal metrics, hidden join conventions, and permission boundaries not captured by raw table names.<n>We introduce Enterprise-First Retrieval, a retrieval layer that embeds catalog metadata rather than warehouse rows.<n>The system indexes five typed catalog objects, tables, columns, metrics, relationships, and query history, using object-specific text templates.
arXiv Detail & Related papers (2026-06-23T02:20:36Z) - EviLink: Multi-Path Schema Linking with Uncertainty-Guided Evidence Acquisition for Large-Scale Text-to-SQL [53.116276478707626]
EviLink combines multi-hypothesis schema grounding with uncertainty-guided evidence acquisition.<n>On Spider2-Snow, EviLink achieves 90.15% field-level strict recall rate, uses 123.30K average tokens, and improves downstream SQL generation under a fixed generator.
arXiv Detail & Related papers (2026-05-28T09:32:38Z) - ErrorLLM: Modeling SQL Errors for Text-to-SQL Refinement [57.98138819417949]
We propose ErrorLLM, a framework that explicitly models text-to- querying.<n>We show that ErrorLLM achieves the most significant improvements over backbone initial generation.<n>ErrorLLM addresses both sides by high detection F1 score while maintaining refinement effectiveness.
arXiv Detail & Related papers (2026-03-04T05:27:20Z) - AutoLink: Autonomous Schema Exploration and Expansion for Scalable Schema Linking in Text-to-SQL at Scale [68.29002818359844]
Existing methods incur prohibitive costs, struggle to trade off recall and noise, and scale poorly to large databases.<n>We present textbfAutoLink, an autonomous agent framework that reformulates schema linking as an iterative, agent-driven process.<n>Experiments demonstrate AutoLink's superior performance, achieving state-of-the-art strict schema linking recall, i.e., textbf68.7% EX on Bird-Dev (better than CHESS) and textbf34.9% EX on Spider-2.0-Lite (ranking 2nd
arXiv Detail & Related papers (2025-11-21T12:12:17Z) - UNJOIN: Enhancing Multi-Table Text-to-SQL Generation via Schema Simplification [50.59009084277447]
We introduce UNJOIN, a framework that decouples the retrieval of schema elements from logic generation.<n>In the first stage, we merge the column names of all tables in the database into a single-table representation by prefixing each column with its table name.<n>In the second stage, the query is generated on this simplified schema and mapped back to the original schema by reconstructing JOINs, UNIONs, and relational logic.
arXiv Detail & Related papers (2025-05-23T17:28:43Z) - Extractive Schema Linking for Text-to-SQL [17.757832644216446]
Text-to-one is emerging as a practical interface for real world databases.<n>We introduce a new approach to adapt decoder-only LLMs to schema linking.
arXiv Detail & Related papers (2025-01-23T19:57:08Z) - RSL-SQL: Robust Schema Linking in Text-to-SQL Generation [51.00761167842468]
We propose a novel framework called RSL- that combines bidirectional schema linking, contextual information augmentation, binary selection strategy, and multi-turn self-correction.
benchmarks demonstrate that our approach achieves SOTA execution accuracy among open-source solutions, with 67.2% on BIRD and 87.9% on GPT-4ocorrection.
Our approach outperforms a series of GPT-4 based Text-to-Seek systems when adopting DeepSeek (much cheaper) with same intact prompts.
arXiv Detail & Related papers (2024-10-31T16:22:26Z) - The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Models [0.9149661171430259]
We revisit schema linking when using the latest generation of large language models (LLMs)
We find empirically that newer models are adept at utilizing relevant schema elements during generation even in the presence of large numbers of irrelevant ones.
Instead of filtering contextual information, we highlight techniques such as augmentation, selection, and correction, and adopt them to improve the accuracy of our Text-to-BIRD pipeline.
arXiv Detail & Related papers (2024-08-14T17:59:04Z) - SQL-to-Schema Enhances Schema Linking in Text-to-SQL [15.6857201570992]
In text-to-speech methods, there is a need to filter out unnecessary tables and columns.
Previous approaches have involved sorting tables and columns based on their relevance to the question.
We propose an inventive schema linking method in two steps.
arXiv Detail & Related papers (2024-05-15T12:22:48Z) - Analyzing the Effectiveness of Large Language Models on Text-to-SQL
Synthesis [4.412170175171256]
This study investigates various approaches to using Large Language Models for Text-to- program synthesis.
The goal was to input a natural language question along with the database schema and output the correct SELECT query.
arXiv Detail & Related papers (2024-01-22T22:05:42Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.