Skip to content

Diogo TravassosData leadership · Analytics · Decision-making

Public dataAnswer keys checked on a synthetic table

Semantic layer evaluation, second round. The first round gave one small model one try per question and no tools.

On 55 questions I wrote alongside the definitions they test, with tools and 3 runs per question, adding the semantic layer reduced how often runs queried the raw trip tables first in all 4 models

With SQL only, 81% to 97% of runs queried the raw trip tables before answering; with the layer as a second tool, 1% to 44% did, and many of the rest read the data through the layer's own query tool instead. With the layer every model was right on 99% to 100% of runs, near the ceiling, so these questions could not show a harm. Among runs that still queried the raw tables, only one model kept enough to compare, and it showed no measurable accuracy difference. The third round is the test that could: on 40 questions an independent author wrote blind, only 9 of which the layer can express, no model showed a measurable gain, and GPT-6 Luna scored 15.0 points lower (9.9 leaving out three questions hit by a flaw in the tool text, a split made after the results).

Claude Sonnet 5.5

Queried the raw trip tables first: 160 of 165 runs with SQL only, 12 of 165 with the layer.

Right across all runs: 147 of 165 with SQL only, 163 of 165 with the layer, a gap of +9.7 points (+3.0 to +17.6). Split after the results: 6 of the 16 extra right runs are on the five questions where SQL-only runs asked back instead of answering, and the gap is +2.4 if its 12 format-only misses count as right.

Queried the raw trip tables first

  • SQL only 147 of 160 right, 92% (85% to 97%) includes 12 format-only misses, explained below
  • With the layer 10 of 12 right, 83% (2 of 6 questions had a miss; rough lower end 63%) too few to compare

Did not query them first

  • SQL only 0 of 5 right, 0% (3 questions, no interval) too few to compare
  • With the layer 153 of 153 right, 100% (53 questions, no interval) of these, 57 used no tool, 88 read data only through the layer's query tool, 8 other

Claude Haiku 5.5

Queried the raw trip tables first: 152 of 165 runs with SQL only, 73 of 165 with the layer.

Right across all runs: 145 of 165 with SQL only, 163 of 165 with the layer, a gap of +10.9 points (+4.2 to +18.8). Split after the results: 14 of the 18 extra right runs are on the five questions where SQL-only runs asked back instead of answering.

Queried the raw trip tables first

  • SQL only 145 of 152 right, 95% (91% to 99%)
  • With the layer 71 of 73 right, 97% (2 of 36 questions had a miss; rough lower end 92%)

Did not query them first

  • SQL only 0 of 13 right, 0% (5 questions, no interval) too few to compare
  • With the layer 92 of 92 right, 100% (42 questions, no interval) of these, 50 used no tool, 40 read data only through the layer's query tool, 2 other

GPT-6.1 Sol

Queried the raw trip tables first: 133 of 165 runs with SQL only, 2 of 165 with the layer.

Right across all runs: 165 of 165 in both setups, no gap.

Queried the raw trip tables first

  • SQL only 133 of 133 right, 100% (54 questions, no interval)
  • With the layer 2 of 2 right, 100% (2 questions, no interval) too few to compare

Did not query them first

  • SQL only 32 of 32 right, 100% (23 questions, no interval)
  • With the layer 163 of 163 right, 100% (55 questions, no interval) of these, 146 used no tool, 14 read data only through the layer's query tool, 3 other

GPT-6 Luna

Queried the raw trip tables first: 159 of 165 runs with SQL only, 27 of 165 with the layer.

Right across all runs: 159 of 165 with SQL only, 163 of 165 with the layer, a gap of +2.4 points (−0.6 to +6.1). Split after the results: 5 more right on the five questions where SQL-only runs asked back instead of answering, 1 fewer on the other 50.

Queried the raw trip tables first

  • SQL only 154 of 159 right, 97% (94% to 99%)
  • With the layer 27 of 27 right, 100% (19 questions, no interval) too few to compare

Did not query them first

  • SQL only 5 of 6 right, 83% (1 of 6 questions had a miss; rough lower end 50%) too few to compare
  • With the layer 136 of 138 right, 99% (2 of 54 questions had a miss; rough lower end 96%) of these, 64 used no tool, 71 read data only through the layer's query tool, 3 other

Reading the cards In groups where every question came out the same, the card shows counts only. That does not mean no uncertainty. Where 1 or 2 questions had a miss, the method's upper end reads 100% whatever the runs did, so the card gives only a rough lower end. See Method and checks.

Main limitation I wrote the questions alongside the metric definitions they test, and the setup with the layer sits at or near 100% for every model. Runs sort themselves into the two groups after the setup is chosen, so the gaps inside a group describe these runs; they do not prove cause.

Accuracy by setup, inside each group

Accuracy by setup within each behaviour group, per modelShare of runs answered correctly, by setup, within the runs that queried the raw trip tables first and the runs that did not, for each model, with question-clustered intervals. Hollow dots mark groups under the comparison minimum.0%25%50%75%100%Claude Sonnet 5.5Claude Sonnet 5.5, queried first, sql only: 147 of 160 runs right, 92%, interval 85% to 97%Queried first, SQL only (160)Claude Sonnet 5.5, queried first, layer: 10 of 12 runs right, 83%, 2 of 6 questions had a miss; rough lower end 63%, too few to compareQueried first, layer (12)Claude Sonnet 5.5, did not query, sql only: 0 of 5 runs right, 0%, 3 questions, no interval, too few to compareDid not query, SQL only (5)Claude Sonnet 5.5, did not query, layer: 153 of 153 runs right, 100%, 53 questions, no intervalDid not query, layer (153)Claude Haiku 5.5Claude Haiku 5.5, queried first, sql only: 145 of 152 runs right, 95%, interval 91% to 99%Queried first, SQL only (152)Claude Haiku 5.5, queried first, layer: 71 of 73 runs right, 97%, 2 of 36 questions had a miss; rough lower end 92%Queried first, layer (73)Claude Haiku 5.5, did not query, sql only: 0 of 13 runs right, 0%, 5 questions, no interval, too few to compareDid not query, SQL only (13)Claude Haiku 5.5, did not query, layer: 92 of 92 runs right, 100%, 42 questions, no intervalDid not query, layer (92)GPT-6.1 SolGPT-6.1 Sol, queried first, sql only: 133 of 133 runs right, 100%, 54 questions, no intervalQueried first, SQL only (133)GPT-6.1 Sol, queried first, layer: 2 of 2 runs right, 100%, 2 questions, no interval, too few to compareQueried first, layer (2)GPT-6.1 Sol, did not query, sql only: 32 of 32 runs right, 100%, 23 questions, no intervalDid not query, SQL only (32)GPT-6.1 Sol, did not query, layer: 163 of 163 runs right, 100%, 55 questions, no intervalDid not query, layer (163)GPT-6 LunaGPT-6 Luna, queried first, sql only: 154 of 159 runs right, 97%, interval 94% to 99%Queried first, SQL only (159)GPT-6 Luna, queried first, layer: 27 of 27 runs right, 100%, 19 questions, no interval, too few to compareQueried first, layer (27)GPT-6 Luna, did not query, sql only: 5 of 6 runs right, 83%, 1 of 6 questions had a miss; rough lower end 50%, too few to compareDid not query, SQL only (6)GPT-6 Luna, did not query, layer: 136 of 138 runs right, 99%, 2 of 54 questions had a miss; rough lower end 96%Did not query, layer (138)
Share of runs right, with its interval. Hollow: under 30 runs or 10 questions, too few to compare. Where a card gives only a rough lower end, the line stops at the dot; no line where every question in a group came out the same. See Method and checks.

The minimum, 30 runs from 10 different questions in each setup, was set before collecting. Only Claude Haiku 5.5 kept enough runs that queried the raw tables first with the layer to compare: 71 of 73 right against 145 of 152 with SQL only, a gap of +1.9 points with an interval from −1.2 to +5.1, so no measurable difference.

Accuracy by setup within each group, per model
ModelGroupSetupRunsQuestionsRightInterval
Claude Sonnet 5.5Queried the raw trip tables firstSQL only1605592%85% to 97%
Claude Sonnet 5.5Queried the raw trip tables firstWith the layer12683%2 of 6 questions had a miss; rough lower end 63%
Claude Sonnet 5.5Did not query them firstSQL only530%no interval
Claude Sonnet 5.5Did not query them firstWith the layer15353100%no interval
Claude Haiku 5.5Queried the raw trip tables firstSQL only1525295%91% to 99%
Claude Haiku 5.5Queried the raw trip tables firstWith the layer733697%2 of 36 questions had a miss; rough lower end 92%
Claude Haiku 5.5Did not query them firstSQL only1350%no interval
Claude Haiku 5.5Did not query them firstWith the layer9242100%no interval
GPT-6.1 SolQueried the raw trip tables firstSQL only13354100%no interval
GPT-6.1 SolQueried the raw trip tables firstWith the layer22100%no interval
GPT-6.1 SolDid not query them firstSQL only3223100%no interval
GPT-6.1 SolDid not query them firstWith the layer16355100%no interval
GPT-6 LunaQueried the raw trip tables firstSQL only1595597%94% to 99%
GPT-6 LunaQueried the raw trip tables firstWith the layer2719100%no interval
GPT-6 LunaDid not query them firstSQL only6683%1 of 6 questions had a miss; rough lower end 50%
GPT-6 LunaDid not query them firstWith the layer1385499%2 of 54 questions had a miss; rough lower end 96%

The gap across all runs of each setup

Every question ran in both setups, and the setup was fixed before each run started, so the gaps on the model cards do not depend on how runs sorted themselves. Split by question after seeing the results, the extra right runs with the layer fall like this. Claude Sonnet 5.5: 6 of 16 on the five noncash-tip questions; the other 10 are its 12 format-only misses less 2 wrong answers with the layer. Claude Haiku 5.5: 14 of 18 on those five questions. GPT-6 Luna: 5 more on those five and 1 fewer on the other 50, and its interval crosses zero. GPT-6.1 Sol was right on every run in both setups.

What the misses were

What the paper says, and how this test differs

A recent paper, Same Context, Different Agents, ran seven language models on 1,514 long tasks from five benchmarks. It sorts agents into investigators, who inspect the data before answering, premature answerers, who answer without looking, and early stoppers. It reports that each technique turns into accuracy only for the group it matches, and that for investigators the same techniques can hurt: "the semantic layer stops them from looking". I tested the semantic layer part on this study's questions.

What this test can check is narrower. The paper sorts agents by how they behave without the techniques; here the two groups are labelled per run, after the setup is assigned. So this tests whether the layer reduces querying of the raw tables overall, not whether it stops investigators. That part shows up clearly: in every model the layer cut the share of runs that queried the raw trip tables first, from 97% to 7% for Claude Sonnet 5.5 and from 92% to 44% for Claude Haiku 5.5, with intervals well clear of zero. Where it could be measured, the runs that still queried first showed no measurable accuracy difference with the layer. Whether the layer helps runs that answer without querying could not be tested: only GPT-6.1 Sol had enough such runs to compare, and it was right on all of them in both setups, at the ceiling, so it shows nothing either way.

The rule I fixed before collecting reads the paper's effect as present when the layer both reduces querying and lowers accuracy among the runs that still query first. Its outcome is "partial" for all four models: the reduction is there, the accuracy cost is not.

The test is much smaller and easier than the paper's. It has 55 short questions on one table of public Chicago rideshare trips and a zone lookup, and I wrote them alongside the metrics. The layer is one tool among two rather than context the agent always reads. A layer that is right for every question it covers leaves an agent nothing to find by looking, so this set can show the first effect but not the second.

What a team should do with this

Limits

How the work was checked

12 of Claude Sonnet 5.5's SQL-only misses were not wrong numbers: each was a correct query with a one-line note from checking the data in front of it. The page keeps the score from the format rule fixed before collection and shows the gap with those runs counted, marked as added afterwards.

Use this at your company

To test whether a semantic layer changes how your own agents check the data, paste this prompt into an assistant that can query your warehouse.

This method comes from Diogo Travassos's study "Semantic layer evaluation: agents with tools" (https://diogotravassos.dev/semantic-layer-evaluation/agents-with-tools.html). If you can open links, read it first: it works the method through end to end, with its checks. The steps below stand on their own if you can't.

Help me test whether giving an AI agent our semantic layer changes how it works: whether it still checks the underlying data before it answers, and whether that changes how often it is right.

Data you need from me: read access to the warehouse tables, the semantic layer's metric and dimension definitions with a way to query them, and 40 to 60 real questions people ask, each with an answer I have checked.

Method:
1. Give the agent a tool loop in two setups: SQL only, and SQL plus a metrics tool backed by the semantic layer. Keep the model, instructions, step limit and answer format the same, and log every tool call.
2. Ask every question at least three times in each setup, each time as a fresh conversation.
3. Before looking at any result, decide what counts as "looked at the data" and record it, for example at least one SQL query on the fact tables that ran before the final answer.
4. Score each final answer by running it and comparing its result with the checked answer.

Checks before trusting the answer:
- Report each model on its own; never average models together.
- Compare the share of runs that looked in each setup. Then compare accuracy within the runs that looked and within the runs that did not, and say when a group is too small to compare.
- If either setup scores close to 100%, the questions are too easy to show harm; add harder or messier questions before drawing a conclusion.
- Read every miss. Separate formatting slips and questions back from wrong numbers, and count failures at the provider apart from wrong answers.
- Resample whole questions, not single runs, when you put a range around a result. If every question in a group came out the same, report counts with no range; if 3 or fewer sit on one side of the outcome, report only the other end, say how many, and call it rough.

Report back: the share of runs that looked in each setup, accuracy by setup within each group with group sizes and ranges, the causes of misses, and the limits: who wrote the questions, how many runs, and which models.

In your report, say which study you followed and link it: https://diogotravassos.dev/semantic-layer-evaluation/agents-with-tools.html

Method and checks

How the intervals print (a rule set after the results)

Intervals resample whole questions. With 3 or fewer of a group's questions on one side of the outcome, a resample misses all of them more than 2.5% of the time, so that end lands on 0% or 100% whatever the runs did. Four groups, each with a miss on 1 or 2 questions, therefore print only a rough lower end, rounded down, and the chart draws their line only from that end to the dot. In nine groups every question came out the same, so both ends land on one value: both 100% for seven groups and both 0% for two, even groups of 2 and 5 runs. Those nine print their runs and questions with no interval, and the chart draws no line. The other three groups keep their interval; they rest on 5 to 8 questions with a miss, and an interval with fewer than 10 questions on either side is unstable, so read those three as rough. The four lower ends rest on 1 or 2 questions and are rougher still. No count or gap depends on this rule; the scored values are in results-run3.json.

What a group with no misses can still say

Counts alone are not certainty. Suppose a group's questions were random draws, which they are not, since I wrote them. With q questions all right and a = 0.05^(1/q), a one-sided limit at 95% confidence says no more than 1 − a of such questions have a miss. In the worst case a question with a miss adds 3 wrong runs and a right question only 1 right run, so the share of right runs is a/(3 − 2a) or higher. That gives 85% for 55 questions, 85% for 54 questions, 85% for 53 questions, 81% for 42 questions, 70% for 23 questions, 66% for 19 questions and 8% for 2 questions. With q questions all wrong, the same reasoning gives 3(1 − a)/(3 − 2a) or lower: 84% for 3 questions and 72% for 5 questions. Each is rounded toward the weaker claim. The worst case is harsh: GPT-6.1 Sol's group of 55 questions has 163 runs, not 55. The same worst case for GPT-6 Luna's 2 misses in 54 questions gives 72%, well under the 96% on its card. The card's end resamples the runs as they came, at 97.5% on its one side, and this limit assumes the worst the questions could do, at 95%, so compare them loosely. The limits stay off the cards because, beside the resampled intervals, they would make a perfect group look less certain than a group with misses; that is a weakness of those intervals, not of these limits.

The two setups

Both setups get the same instructions apart from the layer's tool and its definitions, the table schema and a run_sql tool that runs one read-only SELECT in the first round's sandbox and returns up to 50 rows. The layer setup adds query_metrics, which compiles a metric query with MetricFlow from the first round's metric definitions and runs it in the same sandbox, plus those definitions and the metric query as an allowed answer form. Each run may make up to 10 tool calls and ends with one JSON answer: a SQL query, a metric query, or a question back.

Models and runs

Claude Sonnet 5.5 (claude-sonnet-5-5, effort medium); Claude Haiku 5.5 (claude-haiku-5-5, effort medium); GPT-6.1 Sol (gpt-6.1-sol, reasoning effort medium); GPT-6 Luna (gpt-6-luna, reasoning effort medium). The Claude models ran through the provider's API in a plain tool loop; the GPT models ran through the Codex command-line agent on a clean configuration, with the tools as two logged commands. Each of 1,320 runs (55 questions, 2 setups, 3 runs, 4 models) was a fresh conversation.

The rule for "looked"

A run looked at the data if, before its final answer, it made at least one run_sql call that executed without error and whose FROM or JOIN names trips or daily_trips (the trip tables). Calls that read only zones, calls with LIMIT 0 (schema-only) and calls refused or failed do not count. query_metrics calls do not count as looking: they read the data through the layer. Calls made past the step limit never ran and do not count.

Scoring and intervals

Each final answer is scored with the first round's code and tolerance, unchanged: the query runs on the same database and its rows must match the checked answer to one millionth. A question back on an analytical question counts as wrong. Intervals resample whole questions, 10,000 times, so the three runs of one question move together. Every interval here treats the questions as random draws, which they are not. A comparison inside a group is reported only when each setup has at least 30 runs from at least 10 questions.

Runs that did not end normally

Step limit reached: 0. Cut off or no final answer: 0. Provider errors: 1; it was asked again once as declared and answered, and none was excluded. GPT runs that used a command other than the two tools: 0. No run was dropped.

Data and its limits

The data is the first round's deterministic sample of 10,000 public Chicago rideshare trips from January 2024. Cash tips are absent from the source.

Displayed numbers

Percentages are rounded to whole numbers, half away from zero; gaps are in percentage points to one decimal. Exact values are in results-run3.json.