Semantic Layers Without Translation

Here's an idea: Semantic layers in data systems are moving away from having their own translation capabilities.

This restates key ideas from two of my previous posts: Activity Schemas, Funnel Tables, and Semantic Layers: My Preferred Data Warehouse Design, and Use LLMs for Translation and Fallible Reasoning. It's also a restatement of observations that have been made before by others, although perhaps not with those terms. In the rest of this post, I'm going to unpack and explain what I mean, and why I think it's important.


Systems such as Looker's LookML and dbt's MetricFlow semantic layers provide a service that takes a structured query, in the semantically-defined language of the business, and translates that query to SQL that can be run against a data warehouse. LookML was introduced in 2012, while MetricFlow's technology was acquired and adopted by dbt in 2023.

Semantic layers such as MetricFlow do two things: represent knowledge and provide a translation service. The knowledge consists of metric definitions, allowed join patterns, synonyms, ownership and curation information, etc. The translation service is an API that converts from one representation to another, perhaps executing the SQL or perhaps providing it back to the caller to execute directly. (LookML's translation service was originally only usable within Looker, and has since been somewhat opened up.) When these systems were designed, they had to provide both the knowledge representation and translation services. Nothing else could do the translation at the time.

Here's what that looked like, visually. First, Looker, which has its own semantic representation of the domain and mapping to the physical SQL engine, as well as its own presentation layer. Note that the user has to specify their needs in the language of the semantic layer correctly to get what they want.

Sequence diagram of Looker query, showing Knowledge and Translation components within Looker per se.

Sequence diagram of Looker query, showing Knowledge and Translation components within Looker per se.

Next, MetricFlow, when used by a compatible BI tool. The BI tool handles the user interactions, including the presentation layer, and the database interactions, but asks the MetricFlow API for help with available metrics and for the appropriate SQL to execute. Note that translation happens twice, first when the BI tool translates the user's request, typically expressed via a GUI, to the semantic representation that the semantic layer API requires. Second, the semantic layer compiles that result to the warehouse's SQL, a physical representation.

Sequence diagram of a BI tool accessing a semantic layer, showing Knowledge and Translation subcomponents.

Sequence diagram of a BI tool accessing a semantic layer, showing Knowledge and Translation subcomponents.


In my post on what LLMs are good at, I asserted that they were good at anything like translation, had emergent and imperfect reasoning capabilities, and were poor (on their own) at reliable memory. Converting from a text-based need to SQL is a form of translation, and something that LLMs excel at.

More recent semantic systems such as MotherDuck's Guides feature and Hex's Knowledge Engine provide knowledge documentation, designed to support an LLM agent that is trying to convert a text-based need to SQL. But, as LLMs can generate SQL effectively with adequate context, these systems do not provide a translation service. The LLM does translation, without a specific service.

Sequence diagram of an AI tool leveraging a semantic system to provide context for directly accessing a data warehouse.

Sequence diagram of an AI tool leveraging a semantic system to provide context for directly accessing a data warehouse.

MotherDuck has explicitly argued for a pattern like this -- recommending "a curated layer over the data... with good domain modeling", but "an agent that writes ordinary SQL," instead of the more tightly coupled systems of the past.

Why does this work? The semantic documentation is proprietary knowledge that cannot get removed from the semantic layer. What counts as "conversion", which fields are used, what's excluded. LLMs don't know or recall that sort of thing, so it's important to make sure that definitions are provided, not inferred. Given good context, converting a question to SQL becomes just translation, which LLMs are good at.

As MotherDuck says, the more information that can be provided in the semantic documentation, the better. Imperfections from LLM quasi-reasoning can be reduced by simplifying the required reasoning. Clean data warehouse tables, with defined semantics such as the funnel property, shrink the opportunities for the LLM to write plausible-but-wrong queries. Similarly, if you implement pre-compiled standard versions of metrics in a reporting layer, then make those implementations available to SQL-writing agents, it can choose to use the underlying dimensional models correctly when building customized metric-related queries.

It's worth highlighting that dbt has argued in favor of a translation service. In one benchmark, they found 98% accuracy when using MetricFlow, vs. 90% when an agent with the full warehouse definition as context writes the SQL directly. I'm not convinced by this result. A fairer comparison would be to provide the complementary knowledge that typically is represented in the semantic layer, not just the warehouse definition. I’d be curious to see whether an LLM given rich semantic context, as described above, could match MetricFlow’s accuracy while writing SQL directly, against this benchmark.


Another set of angles to consider is related to AI theories and frameworks.

The older semantic layer design, with built-in translation capabilities, when accessed by an LLM front-end instead of a BI system, is essentially neurosymbolic. Neural networks handle interfacing with human users, but translation between structured semantic and physical SQL representations is performed mechanistically and deterministically. This pattern reduces opportunities for LLM quasi-logic mistakes. But with a strong semantic documentation context as described above, it doesn't seem to me that the additional guarantees make up for the inflexibility and implementation cost of maintaining the translation service.

Next, let's bring Rich Sutton into the room. His Bitter Lesson, 2019 is that hand-built AI methods lose to general methods plus data and compute. In this domain, the Bitter Lesson predicts the retirement of special-purpose translation systems. But it does not predict the end of semantically critical and company-specific context that can't be extracted from public data. That said, over time, it's likely that company-specific context could be summarized and learned from human-agent interactions, and need not be fully hand-written in advance.

I believe my recommendation to pre-compile key metric definitions retains value, even in a closed-loop learning system. They're not just optimizations, they record curation. Certain metric definitions are authoritative, not just common.


What do you give up by getting rid of translation systems? Formal determinism, cost controls, and 100% consistency across consuming systems -- the things semantic layers were meant to solve! But I think the needs for those things, especially with LLMs approaching (in this domain) AGI-level intelligence, are quite reduced. If you throw 2023-era LLMs against this problem, and get poor results, that's on you. Similarly, if you throw the bleeding-edge, most expensive LLMs at these problems without restraint, and break the bank, that's also on you. Determinism is a great goal, but it seems likely that a well-executed knowledge-only semantic layer gets you almost all the way there with substantially less cost.

So what do I recommend, if you buy this hypothesis? Focus on great documentation that will empower LLM-based systems writing SQL against your cleanly-designed data warehouse. Maintain a set of evals that you can periodically feed into Claude or your favorite agent, to confirm that the right tables are used and the right answers are generated even as LLMs evolve over time. The durable pieces are the definitions and documentation, and a warehouse design that represents the world you care about. Translation got cheap, spend the time on knowledge.


  • This article was primarily authored by me, with secondary contributions from AI systems. I wrote almost all of the text and designed the diagrams. AI did some supporting research and made some copy-edits.
  • It's worth noting that Snowflake splits the difference in its systems, providing both SQL generation via Cortex Agents, and direct access via SQL queries to Snowflake Semantic Views.
  • Are you looking for support with data systems, for AI or other use-cases? Does this post make you think I could help your company make great design or technology decisions? I'm a freelance consultant with extensive experience -- please reach out!