Disentangling Structure and Semantics: How Schema Representation Affects LLM-Based SQL Generation
Daniel Yitian Su, Sophie Yiran Su, Qiang Sun, Yihao Ding, Wei Liu
Abstract
LLM-based text-to-SQL pipelines read the database schema as text, which carries both structural cues (tables, keys, relationships) and semantic cues (table and column names); prior work has studied each axis in isolation, leaving open how they compare in magnitude and whether they substitute for one another. We present a controlled 6 times 3 factorial design crossing structural levels L1--L6 (from a denormalised wide table to a 3NF schema with foreign keys and explicit join paths) with semantic levels S1--S3 (anonymous, abbreviated, descriptive identifiers), evaluated on 397 corrected BIRD questions with identical gold queries throughout; we materialise 1NF and 2NF variants for nine BIRD databases to support the lowest structural levels. Across nine models from 0.5B to flagship scale we find an asymmetric substitution between the two axes, meaningful names compensate for missing structure but richer structural metadata does not recover performance when names are opaque, which reproduces in 8 of 9 databases and emerges with model scale (negligible below 3B). Within the structural axis the dominant lever is normalisation itself, not metadata layered on top of 3NF, suggesting that for current LLM-based text-to-SQL the practical bottleneck is semantic grounding rather than relational exposure.
Create a lesson
Metadata
- Comments
- Work in progress
Related papers
SignalCount: Approximate Counts with Structured and Semantic Predicates in Seconds
Shared title terminologycs.DBMatteo Agius-D'Arrigo, Zachary Zelner, Harrison Ju et al.
Towards Online Adaptive LLM-based Semantic Filtering
Shared title terminologycs.DBZiqi Zou, Zhenyan Nie, Kangfei Zhao et al.
Beyond Foreign-Key Connectivity: Semantic Relationship Representation for Relational Deep Learning
Shared title terminologycs.DBNoy Cohen-Shapira
GenTUS: Table Union Search via Constrained Generation of Semantic Table Identifiers
Shared title terminologycs.DBShulun Zhang, Linting Wang, Yuwei Xu et al.
On the Semantics of Generative SPARQL
Shared title terminologycs.DBRatan Bahadur Thapa, Steffen Staab
Fast LLM-Based Semantic Filtering: From a Unified Framework to an Adaptive Two-Phase Method
Shared title terminologycs.DBKyoungmin Kim, Martin Catheland, Anastasia Ailamaki