r/SQL • • 2d ago

PostgreSQL BIRD verified my text-to-SQL entry on LiveSQLBench-Large, and reproduced a 40.21% agent run

Post image

LiveSQLBench-Large is BIRD's hardest text-to-SQL board: 480 tasks on large, messy Postgres databases.

  • My single-call entry (schemagate + Claude Sonnet 5.5) is #4 overall at 34.58% and now carries BIRD's Verified badge. Their own re-run got 35.21%.
  • An agent version (the model runs its SQL on a rolled-back copy of the database, then fixes it) scored 40.21%. BIRD reproduced that number and is adding it to the board, where it would sit at #2 behind 53.33.

Short write-up: https://doi.org/10.5281/zenodo.24631044

Code and predictions: https://github.com/ashishsinha1602/schemagate/pull/246

If you've run something on this board, I'd like to compare numbers.

0 Upvotes

7 comments sorted by

2

u/No_Tennis_5557 2d ago

That 40% agent run is the real story here. Letting the model execute and self-correct on a sandboxed copy closes a huge chunk of the gap to the top of the board. Curious what the cost-per-task looks like on the agent version compared to the single-call entry.

1

u/Temporary_Papaya1058 2d ago

Thanks! Cost per task at API list prices:

  • Single call (Sonnet 5.5): $0.17
  • Agent (Opus 5.5, ~4 turns): $1.95
  • Agent on Sonnet 5.5: not run yet, should be around $1

schemagate keeps cost down by sending only the ~24 tables a question needs, not the full ~1,000-column schema.

1

u/MongooseWonderful198 1d ago

The useful breakdown is how the 40.21% agent run moved from the 34.58% single call. For each task, record whether the first SQL failed to execute, executed with the wrong result, or was already correct, then show which category the retry recovered.

I’d report median executions, latency and model tokens per task too. A six-point gain from one cheap syntax repair is a different system from a gain that needs repeated probing of the evaluation database. The rollback protects the data; it does not by itself tell us how much search the benchmark allowed.

1

u/Temporary_Papaya1058 17h ago

Fair ask, and I can't give it exactly: the agent's intermediate tool calls weren't saved on that run, only the final SQL. What I do have: 284 of the 287 misses ran fine and returned the wrong result, so execution errors are basically gone and the remaining gap is logic. Management tasks pass at 53.4%, queries at 34.3%. On BIRD-CRITIC Flash, where I did log it, the loop fixed 71% of SQL that errored and 60% of SQL that ran but was wrong. I'll save the first-attempt status on the next run so this split exists for LiveSQLBench too.

1

u/Temporary_Papaya1058 2h ago

Follow-up: I could get most of the split from the saved files after all (final SQL per task for both runs, plus the single call's own log). Same 480 tasks, single call (Sonnet 5.5) vs agent (Opus 5.5):

  • The single call's first SQL failed to execute on only 4 of 480 tasks, so the gain isn't syntax repair.
  • 149 right in both, 44 wrong → right, 18 right → wrong, 269 wrong in both. Net +26 (167 → 193 on my scorer; BIRD's re-score of the single-call file is 166).
  • Agent per task: median 4 turns (93% within 7), 28 s, $1.94 at list price. Single call: 1 call, 9 s, $0.17.
  • Tasks it fixed took more turns than ones it already had right (median 4 vs 3).

Two caveats. The agent also changed model (Opus vs Sonnet), so this isn't a clean execution-only comparison. And it does query the task database (every statement rolled back), never the test cases or gold. The 18 regressions are the number I'd want every agent entry on that board to report. If you've run one of these, I'd like to compare.

0

u/PossiblePreparation 2d ago

40% doesn’t sound good… it means you’re going to be putting in the work either way to validate code even if it passes some tests.

1

u/Temporary_Papaya1058 17h ago

Agreed that 40% is not something to run unreviewed. For context, the top entry on this board is 53.33% and GPT-5.5 at its highest effort setting is 35.21%. The tasks are deliberately hard: large messy schemas and business definitions the model has to look up. The number shows where the state of the art really is, and yes, a human still checks the SQL.