Live data from Hacker News

Replacing a SQL analyst with 26 recursive GPT prompts

patterns.app

141–150 of 311 posts

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#141
post #106

Earlier quoted context omitted.

In your analogy to the Apple II, is there a fundamental problem people claimed for early computers, which didn’t just boil down to “they need to be faster”? There are fundamental limitations to what an LLM can achieve.

You missed the ever-powerful ellipsis in what he said: Today "..." and then it will be solved. It's the most powerful operator in the whole of applied computer science.

Yeah, ChatGPT/copilot kinda is that ellipsis.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#142

Anyone who's been asked more than a couple of times for data that requires a non-trivial bit of ad-hoc SQL will know the sinking "oh shit" feeling that comes when you subsequently realise you borked the query logic in some subtle way and have accordingly emailed out a completely bogus answer/report. From the article it doesn't seem that GPT is significantly better or worse than a human in this regard, although an exp…

To me this boils down to Churchhills adage "Don't trust a statistical report unless you fabricated it by yourself". There are so many subtleties when translating business questions into SQL e.g. was the average deal size in the post's "trend" example computed using average/median/geometric mean formula? Should the trend only contain historic or also projected values. No serious report comes without data definitions,…

I had not heard that Churchill quote, but now I feel vindicated that I take the same approach as him!

I think this can also be extended to data tools. I've had so many experiences where a SaaS tool that tries to automate away the manual SQL analysis shows something totally wrong. I tend to "Not trust, verify" anything coming from a SaaS UI when serious business decisions are about to be made based on it.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#143

Anyone who's been asked more than a couple of times for data that requires a non-trivial bit of ad-hoc SQL will know the sinking "oh shit" feeling that comes when you subsequently realise you borked the query logic in some subtle way and have accordingly emailed out a completely bogus answer/report. From the article it doesn't seem that GPT is significantly better or worse than a human in this regard, although an exp…

I've done too little SQL to be traumatized by it, but I experienced it plenty of times doing more complex data processing on the backend. I would e.g. spend a week on first discussing a solution, then researching both theoretical background and relevant libraries, and finally writing code to do the math and render the answers (probability distributions). I eyeball them, they seem to all match expectations, so I decla…

I've been there except instead of explaining to everyone on Monday, I didn't spot my mistake for two weeks _and none of the report users did either_. Nobody died but it wasn't my finest hour.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#144

Anyone who's been asked more than a couple of times for data that requires a non-trivial bit of ad-hoc SQL will know the sinking "oh shit" feeling that comes when you subsequently realise you borked the query logic in some subtle way and have accordingly emailed out a completely bogus answer/report. From the article it doesn't seem that GPT is significantly better or worse than a human in this regard, although an exp…

I've done too little SQL to be traumatized by it, but I experienced it plenty of times doing more complex data processing on the backend. I would e.g. spend a week on first discussing a solution, then researching both theoretical background and relevant libraries, and finally writing code to do the math and render the answers (probability distributions). I eyeball them, they seem to all match expectations, so I decla…

When I was dealing with something similar and I didn't know how the result should even look like, something I did a few times was to separate some sample data, implement the idea using different technology than I was using for that project and then compare the numbers. Helps with debugging too.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#145
post #62

Is this a self-hosted GPT model? One of the smaller models? Fine tuned on Crunchbase data? Any insights into how this was put together?

It's using the GPT-3 API from OpenAI.

The article describes how the prompt itself is constructed - to include details of the database schema plus some example data rows, followed by the user's question.

The prompt is then sent to the GPT-3 API. The results are then sent through the API a few more times with some extra prompt engineering before deriving the final result by running the SQL against the original database.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#146

Earlier quoted context omitted.

> GPT is a form of general intelligence. Is it really? I hadn't heard that

no it's not. It's just a neural network. Although it's impressive nobody is seriously calling it "general intelligence".

I don't think it is either, but "just a neural network" is not a valid criticism. We don't have any reason to think that a properly constructed NN couldn't be a general AI.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#147
post #145
post #62

Is this a self-hosted GPT model? One of the smaller models? Fine tuned on Crunchbase data? Any insights into how this was put together?

It's using the GPT-3 API from OpenAI. The article describes how the prompt itself is constructed - to include details of the database schema plus some example data rows, followed by the user's question. The prompt is then sent to the GPT-3 API. The results are then sent through the API a few more times with some extra prompt engineering before deriving the final result by running the SQL against the original database…

How is it being fine-tuned to be able to generate relevant SQL queries on the crunchbase data set? How does this jibe with the article saying they imported 2.5m records from crunchbase? Where and how are you able to import or fine tune the API-accessible GPT-3 this way? Any pointers for where I can look to do the same?

Edit: I noticed you edited your comment above with some details. It seems that he used GPT-3 just to create the SQL statement which was then executed locally. So GPT-3 never had the actual data set, just a prompt that included some details of the schema.

As a result I think any sort of "success" here is fairly limited when GPT-3 is blind to the actual data and has limited knowledge of the schema to be able to formulate queries that imply some knowledge of the data.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#148
post #86

Earlier quoted context omitted.

Maybe 5% of the business/operations people I've worked with would even want to do this. The rest prefer a smart human to walk them through building a report - most of the time this is because they don't actually know what they need, and they actually need an expert to sit down and figure it out with them.

The longer I'm in the business, the more I feel like my value as a software developer is identifying and asking clarifying questions.

We've been prompt engineers all along.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#149
post #41
post #30

Earlier quoted context omitted.

Clearly, the correct move here is to replace the entire team with Looker and let every department head create their own dashboards to track arbitrary kpis with no understanding of the product or underlying data model. /s

The correct move seems to be to replace the team with a set of oracle bones. From the very limited information we have it seems to me like the team was used to justify whatever conclusions were already made before consulting them.

The whole practice is kind of a proof-of-work scheme for credibility and liability laundering: even if you intend the team/company to follow your conclusions regardless of what anyone else thinks or says, getting some analysts or outside consultants to burn non-trivial amount of time and money evaluating the situation before rubber-stamping your proposal, is what may be necessary for you to sell your ideas to the rest of the team/company. Such exercise may be especially important if you want to protect yourself from having your head served on the platter after your hare-brained idea fails spectacularly.

Re: Replacing a SQL analyst with 26 recursive GPT prompts

#150
At least it learned from the training dataset to never fucking format numbers in a way that would be remotely readable to the human eye (like every other fucking sql and developer tool on earth). Because 133854113715608.0 is telling me exactly what I need to know.
Post reply on HN