TL;DR
Text-to-SQL systems often fail not because they can't write SQL, but because they fail to "ground" the question in the underlying data schema. The authors introduce GRIPS, a three-stage framework that makes this grounding explicit through a structured pre-SQL record, resulting in an average accuracy boost of 11.8 percentage points and a massive 47.8% reduction in token costs.
What Problem Does This Paper Address?
While Large Language Models (LLMs) have become remarkably good at generating code, the "Text-to-SQL" task—converting a natural language question into a database query—remains a significant challenge. The authors argue that the primary bottleneck isn't SQL syntax, but grounding: the process of correctly linking mentions in a question to specific tables, columns, values, and relations.
Current systems often treat this as an implicit step within a single prompt or a complex multi-agent chain. However, when a model links a question to the wrong column, even a syntactically perfect SQL query will return the wrong answer. This paper seeks to answer: What specific pre-SQL information actually helps a generator, and at what point does providing more context start to hurt?
Methods
The authors propose GRIPS (Grounding Representation and Input Processing for SQL generation), a three-stage architecture designed to decouple data interpretation from query generation:
- Stage I: Schema and Question Processing: A deterministic, rule-based stage that maps the question and context to a structured JSON record. This record includes
grounded_slots(the specific matches found) and aprediction_trace(a summary of the input's complexity, like record counts or foreign-key distances). - Stage II: LLM Prompt Construction: The LLM receives the original question, the schema, and the Stage I JSON record. The authors tested two versions: GRIPS-Static (fixed demonstrations) and GRIPS-Adaptive (which uses Stage I info to select the most relevant few-shot examples).
- Stage III: SQL Execution: The generated SQL is normalized and executed in SQLite to produce the final answer.
By making the "handoff" between grounding and generation explicit and inspectable, GRIPS allows developers to diagnose exactly where a failure occurred.
Datasets
The framework was evaluated across two structurally diverse benchmarks:
- TempTabQA-C: A benchmark focused on temporal reasoning over semi-structured tables (e.g., Olympic medal tables). It includes variants for difficulty, table size, and counterfactual content.
- BIRD: A large-scale, real-world relational database benchmark spanning 11 different domains. The authors used the Mini-Dev split for their analysis.
Key Insights and Ideas
- Grounding is the Primary Culprit: An audit of existing failures showed that grounding errors (linking to the wrong field, value, or join path) represent the largest category of errors—53.9% in TempTabQA-C and 64.7% in BIRD.
- The "Less is More" Paradox: Interestingly, providing too much internal structural information can degrade performance. The authors found that a compact, targeted representation of grounding performed better than an "expanded" profile that included every possible internal pattern.
- Explicit Handoffs Save Tokens: By providing the LLM with a pre-processed grounding record, the model doesn't have to "think" as hard (or use as much context) to figure out the schema links, leading to significant efficiency gains.
Key Results
The researchers tested GRIPS using GPT-5-nano and Llama-3.3-70B. The results were striking:
- Accuracy: GRIPS-Adaptive improved over the "SQL Static" baseline in 18 out of 20 experimental settings, with an average gain of 11.8 percentage points.
- Efficiency: The framework reduced model-call token usage by an average of 47.8%.
- Robustness: The gains held steady across different difficulty levels and even when the underlying table data was perturbed (counterfactual tests).
As seen in the figure above, accuracy generally peaks with "Guided" or "G+P" (grounding + profile) information, but starts to drop when the profile is "Expanded" with too much detail.
Limitations and Future Work
The current implementation of Stage I relies on benchmark-specific rules and aliases. While this makes the system highly reproducible, it limits its immediate transferability to entirely new, unseen schemas without some manual configuration.
The authors suggest that future work should focus on:
- Integrating semantic retrieval or automated entity resolution into Stage I to handle noisier inputs.
- Testing the framework on unseen schemas to evaluate how well the rule-based grounding generalizes.
- Exploring how this explicit handoff can be used in high-stakes domains (like medicine or finance) where query interpretability is a hard requirement.
Summary updated