Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by lolpanda on Monday February 05, 2024 @02:56PM
(#39266224)
I don't think any of those text-to-sql models are solving the right problems. The hard part is not syntax or I don't know how to write a group by query. Most data scientists and engineers spend more time on understanding the meaning of the data. One cannot simply look at a 50 columns table in Snowflake and guess what columns are by their names. For example, we have 10 columns in one tables, all named ...price. We have to go to wiki to find the actual meaning or read the DBT definitions. I cannot trust any queries that models produce because they don't understand the data; they only understand the query syntax.
[ Parent
| on HN ]
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by mritchie712 on Monday February 05, 2024 @03:30PM
(#39266704)
Yeah, we've been working on this problem a good bit and I think text-to-sql is a dead-end for analytical questions.
We (https://www.definite.app/) ended up abandoning text-to-sql in favor of answering questions with a semantic layer (which LLM's are far more effective against).
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by l5870uoo9y on Monday February 05, 2024 @05:38PM
(#39268207)
So you don’t use AI to generate SQL to retrieve data? As you say on the web site?
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by mritchie712 on Tuesday February 06, 2024 @11:53AM
(#39276776)
We ultimately generate SQL, but the LLM doesn't write SQL, the semantic layer does.
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by joshhart on Monday February 05, 2024 @03:05PM
(#39266374)
At Databricks we have an LLM that is fine-tuned to do the problem you raise -
https://www.databricks.com/blog/announcing-public-preview-ai...
Many customers like it a lot. Although perhaps in your case if there are many pricing details it may not be quite accurate.
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by l5870uoo9y on Monday February 05, 2024 @05:41PM
(#39268233)
Can I ask how you fine-tune or if you can be a bit more specific?
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by danielmarkbruce on Monday February 05, 2024 @03:51PM
(#39266987)
It seems like fine tuning on queries using the underlying schema would work, people are doing this.
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by l5870uoo9y on Monday February 05, 2024 @05:27PM
(#39268114)
You are right but you can use RAG to “teach” AI about your schema. I did a write up on my implementation [1].
[1]: https://www.sqlai.ai/posts/enhancing-ai-accuracy-for-sql-gen...
Re:Show HN: Natural-SQL-7B, a strong text-to-SQL model
by edmundsauto on Monday February 05, 2024 @09:42PM
(#39270136)
I totally agree that the value is in understanding the data. However, as a tool, do you see value in being able to quickly skeleton out the query? Autocomplete in code is a reasonable analogy to me.