Semantic Layer vs. Text-to-SQL: 2026 Benchmark Update
This article reruns a 2023 benchmark with the latest LLMs, comparing direct SQL generation against querying through a structured dbt Semantic Layer. It finds that while text-to-SQL accuracy has jumped, a modeled Semantic Layer still delivers near-perfect, deterministic results for covered queries, making it ideal for complex or critical use cases.
- Top 2026 LLMs (Opus 4.6, Sonnet 4.6, GPT-5.3 Codex, GPT-5.2) now hit 80%+ accuracy on raw text-to-SQL, up sharply from the GPT-4 era's ~60%
- A fully modeled dbt Semantic Layer still reaches near-100% accuracy on in-scope queries, versus ~95% for a minimal semantic layer and ~60-80% for plain text-to-SQL
- Data modeling matters more than model choice: basic modeling boosted accuracy 15-20 points, while swapping between top-tier LLMs or reasoning settings only shifted results by single digits
- Semantic layers pay off for complex, messy, enterprise-scale data, while raw LLM text-to-SQL remains a fine low-setup option for one-off or small-dataset analysis
In tests against the ACME Insurance benchmark’s 11 analytical questions (each run 20 times), large language models have closed much of the gap on text-to-SQL since the GPT-4 era. When given full schema context, today’s best models—Opus 4.6, Sonnet 4.6, GPT-5.3 Codex and GPT-5.2—hit solid accuracy, often well above 80%. Improvements came fastest on straightforward joins and filters, where models learned to recognize common naming patterns and foreign-key relations.
Still, the dbt Semantic Layer keeps a clear edge on reliability. With a minimal layer built on raw, normalized tables, accuracy jumped from roughly 60% (plain text-to-SQL) to nearly 95%. A fully modeled layer—metrics and dimensions defined per dbt best practices—reached close to 100% for questions within its scope. That deterministic query generation via MetricFlow prevents subtle mistakes: join logic, aggregations and edge-case filters won’t silently slip even if the LLM mislabels a metric.
Model quality and data modeling both matter. Adding basic modeling to raw tables boosted text-to-SQL results by 15–20 percentage points. But real-world enterprises face complex, messy data at scale; there the up-front cost of building and maintaining a semantic ontology pays off in accuracy and repeatability. For one-off analysis or small datasets, on the other hand, letting a powerful LLM write queries directly still delivers strong results with minimal setup.
Finally, choice of LLM or prompting intensity barely moved the needle once you’re past a certain capability level. In permutations across four top-tier models and multiple “reasoning” settings, accuracy swings stayed within single digits. That suggests you’ll get more mileage from improving your data models and semantic definitions than from chasing the latest API version or tuning temperature settings.