Even when an AI knows exactly what a question means, writing the right database query can still trip it up — why?
How do schema complexity and query structure affect parsing under gold interpretations?
This explores what still goes wrong when a model turns a question into a database query (text-to-SQL) even after it has been told which reading of the question is correct, and how much of that comes from large or tangled database schemas versus complicated query structure.
This explores what still goes wrong when a model turns a question into a database query (text-to-SQL) even after it has been told which reading of the question is correct, and whether larger database schemas or more complicated query shapes are to blame. First, a limit on what the collection covers: it has no paper that directly measures parsing accuracy against schema size or query depth with the correct interpretation held fixed. What it does have is one study that separates the two problems, plus several findings from nearby areas that suggest where the leftover difficulty probably sits.
The most direct material is Can resolving ambiguity in natural language first improve SQL parsing?. It splits the work into two steps: first write out each possible meaning of the question in plain English, then translate each one into SQL. That split is the useful idea. Once ambiguity has been resolved in English, turning a meaning into SQL becomes a separate and easier task, and errors that used to look like parsing failures turn out to have been interpretation failures. The approach also takes advantage of a known quirk: LLMs lean toward one default reading. The researchers let the model produce that default, then used a second model to fill in the readings it missed. So 'parsing under gold interpretations' is roughly what this pipeline isolates. Whatever errors survive belong to the translation step, not to understanding the question.
The collection does say something about why that translation step gets harder as structure grows. Why do large language models fail at complex linguistic tasks? finds that even strong models misread embedded clauses and complex noun phrases, and that accuracy drops steadily as sentences nest more deeply. A question that needs nested subqueries or several joins has the same nested shape. A plausible inference, not tested in the collection for SQL, is that query depth hurts in a predictable way rather than at random. Schema size could add a second burden. Does reasoning ability actually degrade with longer inputs? shows reasoning accuracy falling from 92% to 68% with only about 3,000 tokens of padding, so a large schema pasted into the prompt may hurt simply by being long, before any of it gets complicated.
There is also a less obvious factor: wording. Do language models really understand meaning or just surface frequency? finds that models do better on common phrasings than on rare ones that mean the same thing, and tool calling is one of the cases it tests. That suggests a gold interpretation written in unusual wording, or a schema with odd column names, could fail even when the logic is simple. Some of what looks like structural difficulty may really be unfamiliar vocabulary. On the design side, Do hierarchical retrieval architectures outperform flat ones on complex queries? shows that keeping planning apart from execution helps on multi-step queries. That points toward breaking a complex query into a plan before writing the SQL.
Finally, Why do readers interpret the same sentence so differently? questions the starting assumption. 'Gold interpretation' assumes each question has one correct meaning, but for many real questions people reasonably disagree. A benchmark that tests parsing against a single gold reading may count reasonable alternative readings as errors. If you're digging into this topic, a key question is how much 'parsing difficulty' is really disagreement about meaning that was settled too early.
Sources 6 notes
A two-stage approach that first produces unambiguous natural-language readings, then maps each to SQL, reached 92% single-interpretation coverage on AmbiQT by exploiting LLMs' known bias toward default readings and using an infilling model to recover missed readings. Execution-verified interpretations provided training signal without manual annotation.
Top-tier LLMs like Llama3-70b consistently misidentify embedded clauses, verb phrases, and complex nominals. Performance degrades predictably as syntactic depth increases, revealing that statistical learning captures surface patterns but not deep grammatical rules.
FLenQA shows reasoning accuracy drops from 92% to 68% at just 3000 tokens of padding, far below context window capacity. The degradation is task-agnostic, uncorrelated with language modeling performance, and persists even with chain-of-thought prompting.
LLMs show consistent preference for higher-frequency surface forms over semantically equivalent rare paraphrases across math, machine translation, commonsense reasoning, and tool calling. This suggests models track statistical mass from pretraining rather than meaning-recognition as their primary mechanism.
Separating query planning from answer synthesis into distinct components reduces interference and improves multi-hop query performance. This architectural principle mirrors documented benefits of separating planning from execution in agent design.
Show all 6 sources
Interpretation Modeling research shows that disagreement on socially embedded sentences reflects valid differences in reader perspective, not annotation failure. Structured human disagreement in NLI benchmarks confirms that interpretation distributions carry meaningful information.
Papers this line draws on 8
The research behind the notes this line reads — ranked by how closely each paper relates.
- Beyond Accuracy: Evaluating the Reasoning Behavior of Large Language Models -- A Survey
- Disambiguate First, Parse Later: Generating Interpretations for Ambiguity Resolution in Semantic Parsing
- Simple Linguistic Inferences of Large Language Models (LLMs): Blind Spots and Blinds
- Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models
- Longer Context, Deeper Thinking: Uncovering the Role of Long-Context Ability in Reasoning
- PleaSQLarify: Visual Pragmatic Repair for Natural Language Database Querying
- Linguistic Blind Spots of Large Language Models
- Think Deep, Not Just Long: Measuring LLM Reasoning Effort via Deep-Thinking Tokens