5 ms·
Just a thought that I have not fleshed out and can even see some problems with, but: will we arrive at a point or will it even be desirable to get to a point wh
by xwowsersx 4y ago
Just a thought that I have not fleshed out and can even see some problems with, but: will we arrive at a point or will it even be desirable to get to a point where the text in your source "code" just remains the instruction you've given to the AI? In other words, Amazon's example on the linked page is:
> /*Create a lambda function that stores the body of the SQS message into a hash key of a DynamoDB table.
Now, obviously that is not valid Java syntax and javac will fail on that, but could/would it be possible to just build an intermediate tool that'll expand this into Java (or whatever other language) so that you don't need to even see the expanded code in your editor, like the same way you don't need to see bytecode?
I get that practically, right now, that would be ill-advised since the AI may not be reliable enough and there are probably more cases than not where you need to tweak or add some logic specific to your domain, etc. But still, theoretically is that where we are heading, i.e. a world in which even what are now considered high level langs get shoved down further below and are considered internal/low level details?
- otabdeveloper4 4y agoNo, because a programmer's job is to build stuff to spec, and "just do what I really mean" is the opposite of that.
- ch4s3 4y ago> will we arrive at a point or will it even be desirable to get to a point where the text in your source "code" just remains the instruction you've given to the AI These systems are non-deterministic by nature, so I doubt it unless something fundamentally changes. Moreover you'd have to be super specific to capture the business logic to the point that you're basically writing code in a high level dynamic language anyway.
- xwowsersx 4y agoRight, that makes sense. You can't very well have a system where the AI instructions produce a different underlying program each time lol.
- helen___keller 4y agoI don’t think that’s necessarily a problem. Technically every time you update gcc your compiler might produce a different underlying program for your source code. The bigger problem is that LLMs are slow and expensive. Even in the future after many improvements, it makes more sense to have an LLM write a program once ever, rather than write a program on every compile or every execution.
- ch4s3 4y ago> Technically every time you update gcc your compiler might produce a different underlying program for your source code. Individual versions are deterministic though. Two identical prompts to a LLM at the same time can give drastically different results, because the the responses are probabilistic. You can't assemble complicated systems that way and expect them to behave consistently.
- helen___keller 4y agoThe issue you’re describing is more to do with correctness and performance (two critical elements of a good compiler), not nondeterminism. If a natural language compiler can output correct performant code, nondeterminism shouldn’t matter. For example, take a script that randomly invokes either gcc or clang, maybe randomly sets the optimization level. Multiple invocations will output vastly differently, but we can be confident the output is correct and to some degree performant.
- ch4s3 4y agoNo my point is that nondeterminism effects correctness. A random script that invokes different compilers is a contrived example, no one would ever build a system that way it is totally undesirable. Moreover, I'm not sure how we could determine the correctness of a system generated by an LLM without auditing the output and certifying each run. Who would ever want to work that way? This just creates problems that don't need to exist.
- SCHiM 4y agoGiving a task to a team of programmers is similarly no-deterministic by nature. Otherwise we'd not see so many posts about budgets, planning, meetings, sprints and security bugs :)
- sarchertech 4y agoYes but the source code is not non deterministic, which is what the GP was talking about.
- ch4s3 4y agoYes, but the execution of the source is (modulo network stuff) deterministic, which is my point.
- Aperocky 4y agoYes, that's was the original promise of compilers. COBOL was designed for normal business people use, remember? You'll just have to program in AI understandable language, I'm sure there are going to be lots of quirks and tricks similar to the languages today.
- xwowsersx 4y agoRight, but what do you think about the point ch4s3 made below, namely that AI is non-deterministic? Isn't that a core difference? The COBOL compiler produces the same output for the same input, i.e. the compiler acts as a pure function.
- tough 4y agoDoesn't 0 temp give you determnistic outputs tho? Also you need to translate/expand once (or multiple times, add tests, pick best benchmarked solution) Where this could be useful would be in handling updates of packages and API's by itself. if you integrate only by prompt/words the AI can generate the appropiate latest lib integration that happens to work with your system or whatever
- mike_hearn 4y agoEven temp=0 isn't fully deterministic for some reason, most likely floating point non-associativity and related issues.
- krona 4y agoThere's nothing requiring non-determinism in these models, it's just there as a means to increase variety. There are obviously scenarios where this makes less sense.
- joaogui1 4y agoKinda, there are GPU kernels that are sped-up by being non-deterministic, so you also gain performance with non-determinism
- IanCal 4y agoYou can try the decorator ai_fn in marvin https://github.com/PrefectHQ/marvin https://github.com/PrefectHQ/marvin
- helen___keller 4y ago> Now, obviously that is not valid Java syntax and javac will fail on that, but could/would it be possible to just build an intermediate tool that'll expand this into Java (or whatever other language) so that you don't need to even see the expanded code in your editor, like the same way you don't need to see bytecode? One step before this (AI as a pre processor that generates source code which is then validated by tests and committed without even review) I think is possible. Cutting edge LLM apps utilize multiple LLMs to perform validation, task decomposition, etc. it’s not a stretch that a future application can take your pseudo code / spec, maybe ask you some clarifying questions, generate a bunch of code and test cases, maybe even launch a beta stage and prompt you to validate it. As others have mentioned, LLMs are nondeterministic and can do the wrong thing on a given run. This is in contrast to a traditional program that is either buggy or bug free. OTOH another LLM can be trained to validate, and to debug. There’s a lot of work to do before LLM apps are considered reliable enough to do their job without intense supervision.
- onion2k 4y agocould/would it be possible to just build an intermediate tool that'll expand this into Java Yes. But... it'll expand it based on the probability of what you want looking like other things it's been trained on. If you want the obvious use case then it'll be magical. Just describe the code and it'll work. But as soon as you want anything slightly less than typical you'll need to start 'prompt engineering' to refine in greater and greater detail, possibly until you've actually put in more effort than it'd take to just write the code. For anything that's even further outside of the training data it won't work but it might look like it does. In the short term that's going to trip a lot of people up. The worst part will be when non-developers start to use it though. "Make me a web form that takes a name, email address, and ZIP code and saves them to Airtable" will probably work eventually ... but with no validation, no error handling, no security, no styling, no cross-browser testing... because the author didn't know to ask for those things in their prompt. AI derived apps are going to suck.
- pacifika 4y agoThe best complete prompt we have for that is the source code, so I think not.
- mike_hearn 4y agoIn fact you can do that, and I've already built a tool for my own use that does something very similar. It works surprisingly well, and the specs (prompts) you write get checked into VCS and act as a form of literate programming that can help explain the resulting code better than comments do. It's funny, I was actually just pondering what to do with it when I opened HN and came across your comment. I was thinking of improving it some more and then selling it for a low-ish price. One thing that'd really help though, is a more widely accessible GPT-4 API.