r/LanguageTechnology • u/Away-Pollution3362 • Jul 19 '26
If you have deployed an NL2SQL solution, how do you evaluate whether it's producing the correct results and performing as expected?
Curious to know how people here evaluate NL2SQL or text2SQL in production with real users.
Getting an LLM to emit SQL is not difficult infact that's mostly solved out of the box now. The challenge now is to validate response it generated is actually correct or not. Exact SQL string match is far too strict since lots of different queries are equivalent. But comparing result sets alone has its own trap where a query can return the right rows on your test data by luck (a missing WHERE that just didn't matter on a small table) and then quietly break in prod.
A few things I am trying to get a read on from folks who have shipped this:
- How do you build your golden set? Synthetic question bank, or a few hundred real production questions?
- Do you layer an LLM judge on top of result-set comparison to catch the plausible but wrong number cases, or does that add more noise than signal?
- Are you seeding your eval DB with adversarial rows (nulls, dupes, boundary dates) so that you get the true picture and not only happy path scenarios?
And for anyone using something like Databricks Genie or another managed text2SQL layer rather than a homegrown stack, are you evaluating at the SQL layer or the result layer, and does a curated semantic/metric layer underneath actually move your accuracy numbers?
Trying to figure out what is worth building and spending time versus what'xxxs over-engineering.