I replaced 50 lines of code with a single LLM prompt
21–30 of 45 posts
Re: I replaced 50 lines of code with a single LLM prompt
#22Earlier quoted context omitted.
Great accuracy as tested to a continually changing black box. GPT hits are also expensive and often have unpredictable latency. This would have to be integration tested to detect changes to GPT answers.
Correct me if I'm wrong, you can pick which dated GPT API to utilize and expect that to not act as a continually changing black box. I've been using the API for a long time and have been able to pick the version. So for example: gpt-4-0314, or gpt-3.5-turbo-0613, etc. The latency issue is definitely true. Ideally the cost could be limited to a very small percentage of hard cases (which you first have to identify).
[0] https://matt-rickard.com/foundational-models-are-not-enough
[1] https://arxiv.org/pdf/2308.02828.pdf
[2] https://www.sitation.com/non-determinism-in-ai-llm-output/
[3] https://towardsdatascience.com/the-magic-of-llms-prompt-engi...
Re: I replaced 50 lines of code with a single LLM prompt
#23I can't help but think LLM is the wrong tool for the job here. There are many address validation and standardization services, including databases you can get straight from USPS. Those services will give you real and consistent answers, rather than unknown edge cases that will shift subtly over time as your LLM changes. Edit: The USPS even runs a program called CASS for this exact purpose. While you may not need to C…
Re: I replaced 50 lines of code with a single LLM prompt
#24This feels like extreme overconfidence in the LLM, sort of how I felt the first time I used one.
How many times did they run the test suite? How thorough is the test suite? How much does accuracy matter here, anyway? (seems like it does matter or they wouldn't advertise 100% accuracy and point out edge cases)
In my experience, LLMs will hallucinate on not only the correctness and consistency of answers but also the format of their response, whether it be JSON or "Yes/No". If LLMs didn't hallucinate JSON, there'd be no need for posts like 'Show HN: LLMs can generate valid JSON 100% of the time' [1].
If this gave 100% correctness on all test cases always, I'd need to throw out everything I know about LLMs which says they're totally unfit for this sort of purpose, not only due to accuracy, but due to speed, cost, external API dependency, etc, mentioned in other comments.
Suggesting that problems with edge cases and text manipulation are good candidates for LLMs seems dangerous. Now your code is nondeterministic (even with temperature set to 0).
Re: I replaced 50 lines of code with a single LLM prompt
#25But that costs more.. but they ended up anyway doing: >The other key will be 'reason' and include a free text explanation of why you chose Yes or No.
But they did yes/no FIRST, then reason. So he ended up asking for the answer, and then asked it to _justify_ why that's the answer. For chain of thought to be helpful, you do the opposite: First explain why these addresses match or don't match, then give a final answer. Same amount of tokens but activated chain of thought prior to the answer, giving it "space to think".
Re: I replaced 50 lines of code with a single LLM prompt
#26[1] https://github.com/openai/chatgpt-retrieval-plugin/blob/main... [2] https://github.com/topics/pii-detection
Re: I replaced 50 lines of code with a single LLM prompt
#27Is this for real? The author didn't bother to use or even consider the excellent free tools available straight from USPS for exactly this purpose ( https://www.usps.com/business/web-tools-apis/ ) and instead went straight to the LLM prompt?
Re: I replaced 50 lines of code with a single LLM prompt
#28Re: I replaced 50 lines of code with a single LLM prompt
#29Although, I did just pass the article into chatGPT, asked it to list all the edge cases possible, and to produce some code that covers the edge cases, and at first glance it did ok...
Re: I replaced 50 lines of code with a single LLM prompt
#30> And BOOM! 100%(!) accuracy against our test suite with just 2 prompt tries. ... OK, so I'm super happy with the accuracy and almost ready to ship it. ... Wawaweewah! ... letting me actually deploy this in production ... This feels like extreme overconfidence in the LLM, sort of how I felt the first time I used one. How many times did they run the test suite? How thorough is the test suite? How much does accuracy ma…