Live data from Hacker News

I replaced 50 lines of code with a single LLM prompt

haihai.ai

1–10 of 45 posts

Re: I replaced 50 lines of code with a single LLM prompt

#5
post #3

So you replaced 50 lines of code with a service call to a service that burns massive amounts of electricity/cooling capacity, certainly runs slower, and adds a service dependency that could break on a whim without your knowledge? And that’s a win?

50 lines of code that were never going to work with great accuracy.

Sure, it absolutely might be a win. It depends on just how much accuracy they needed in the checking system in question.

It's also worth noting that one could utilize both. The assumed fast, low cost 50 lines of code on your server that takes care of the easy 97%. And then throw GPT4 at the stray hard cases. It requires being able to correctly identify when your code isn't up to the task of course.

Re: I replaced 50 lines of code with a single LLM prompt

#6
post #4

Good luck debugging cases it gets wrong. LLMs seeping into cases that have one valid solution will bring so many new problems to random customers.

The cases are mostly string matching and string patterning. I can't see the debug cases as wildly varying.

OP - You can also, as a double blind, use Google maps api calls which will return you a fully fledged address.

Re: I replaced 50 lines of code with a single LLM prompt

#7
post #3

So you replaced 50 lines of code with a service call to a service that burns massive amounts of electricity/cooling capacity, certainly runs slower, and adds a service dependency that could break on a whim without your knowledge? And that’s a win?

You could also cache addresses seen before.

Re: I replaced 50 lines of code with a single LLM prompt

#10
post #3

So you replaced 50 lines of code with a service call to a service that burns massive amounts of electricity/cooling capacity, certainly runs slower, and adds a service dependency that could break on a whim without your knowledge? And that’s a win?

50 lines of code that were never going to work with great accuracy. Sure, it absolutely might be a win. It depends on just how much accuracy they needed in the checking system in question. It's also worth noting that one could utilize both. The assumed fast, low cost 50 lines of code on your server that takes care of the easy 97%. And then throw GPT4 at the stray hard cases. It requires being able to correctly identi…

Address matching isn't exactly a new problem. USPS provides an [API](https://developer.usps.com/api/18), and there are several python/ruby/any-other-language libraries/modules that would also just be a call instead of however many dozen lines of custom code you have to test.

Would be very interested in the longevity of this solution. It works today, but will it work in a month/year? A library file on the computer running the rest of the code isn't going to change.

Post reply on HN