Live data from Hacker News

AI learns to write its own code by stealing from other programs

newscientist.com

81–90 of 160 posts

Re: AI learns to write its own code by stealing from other programs

#81
post #76

Earlier quoted context omitted.

Doesn't TDD basically provide a spec? Write a test, then let the AI generate a program that passes the test. If the program is still buggy, you didn't write sufficient tests.

I don't think it's that simple. Imagine a simple add(int32, int32) int32 function. Unless you write a test for all 2^32 * 2^32 possible inputs and their expected outputs, how could you guarantee that the AI will come up with the "correct" implementation? Automated tests are generally not practical for proofing program correctness. Why would you expect them to be sufficient as a specification format?

Software produced by a typical business app developer is not provably correct either. TDD of AI generated code could not hope to produce something more correct. As your tests get better, so would the software produced both by the human and the AI.

For your add(int32, int32) function: While an AI-generated implementation is not provably correct unless the test contains 2^64 inputs, I think it's pretty likely that a correct implementation would in fact be generated pretty quickly.

Re: AI learns to write its own code by stealing from other programs

#82
post #76

Earlier quoted context omitted.

Doesn't TDD basically provide a spec? Write a test, then let the AI generate a program that passes the test. If the program is still buggy, you didn't write sufficient tests.

I don't think it's that simple. Imagine a simple add(int32, int32) int32 function. Unless you write a test for all 2^32 * 2^32 possible inputs and their expected outputs, how could you guarantee that the AI will come up with the "correct" implementation? Automated tests are generally not practical for proofing program correctness. Why would you expect them to be sufficient as a specification format?

(BTW, I don't think it's that simple either. Just pointing out that TDD is a possible approach to avoiding the infinite recursion of specs-are-just-programs-in-a-higher-level-language.)

Re: AI learns to write its own code by stealing from other programs

#83

Earlier quoted context omitted.

making people in an industry more efficient at their jobs == job losses for that industry. if one programmer can now do the work of 5 with the help of an AI, companies will quickly be hiring less developers. yet everytime i mention this, im told that "software developers are the one job that will never be at risk of automation"

> im told that "software developers are the one job that will never be at risk of automation" The AI is itself a program. If the AI can write programs, it can write a better version of itself. A few iterations of this, and it will have far surpassed human intelligence. So it would be more accurate to say that writing programs is the last job that will be automated.

> The AI is itself a program. If the AI can write programs, it can write a better version of itself.

Not necessarily (or even likely). There's a huge difference between being able to write "programs" (for example the ones described here are ~5 lines) and being able to write a large and very complex piece of software, which such an AI would undoubtedly be.

There's also the question of what constitutes "better." Improvements in e.g. speed or memory efficiency (hard enough as it is, but conceivable for an AI) are a quite different thing than improvements in capabilities or understanding.

Re: AI learns to write its own code by stealing from other programs

#84
post #45

“It could allow non-coders to simply describe an idea for a program and let the system build it” This is not a new thought. The problem with it, however, is that such a description would have to be very precise or else leave room for different interpretations which in turn could lead to very different programs being generated. In particular, as programmers know, it's often the edge cases that pose the main difficulty…

As a technical manager, this actually isn't that far from what happens with teams of engineers. The less precise I am in describing the requirements of a system, the less correct solution is produced. This isn't to say that my team is incompetent or mindless -- far from it, I find them to be some of the most talented engineers I've had the pleasure of working with.

Perhaps the solution to this particular problem is a clear specification of the requirements of the problem -- very similar to how corps define requirements documents for what their product does/behaves like?

Re: AI learns to write its own code by stealing from other programs

#85
post #36
post #32

Earlier quoted context omitted.

Specifying exactly what is needed is coding. The hope for some kind of high-level language you would generate the actual code from is decades old, see compilers. (And it does reduce coding times tremendously!)

that's kind of what i meant. someone has to tell the thing what to do, in a understandable way. and this will not be the client/manager/whoeverneedssomething. and that's not coding. that's software engineering. maybe codingmonkeys will disappear but a "developer" is, imo, a guy who does more than code

someone has to tell the thing what to do, in a understandable way. and this will not be the client/manager/whoeverneedssomething.

To start with, sure. That's where we are now - even the best "AI" tool needs a lot of help from the user giving it instructions in specific language. That will improve very quickly though. For a limited subset of apps, you will be able to describe what you want in plain English and get something usable out of it. That subset will start off being the sort of apps people have made in VB for years, and now make in web languages.

If that's what you do then your job will be automated away over the next decade. Learn to make something that can't easily be automated.

Re: AI learns to write its own code by stealing from other programs

#86
post #45

“It could allow non-coders to simply describe an idea for a program and let the system build it” This is not a new thought. The problem with it, however, is that such a description would have to be very precise or else leave room for different interpretations which in turn could lead to very different programs being generated. In particular, as programmers know, it's often the edge cases that pose the main difficulty…

DHH did a great job explaining this exact same thing on Tim Ferris's podcast a while back. http://tim.blog/2016/11/25/david-heinemeier-hansson-on-digit... at around 13:49.

Basically as time progresses we keep creating languages that are a "higher level".

Re: AI learns to write its own code by stealing from other programs

#87
post #45

“It could allow non-coders to simply describe an idea for a program and let the system build it” This is not a new thought. The problem with it, however, is that such a description would have to be very precise or else leave room for different interpretations which in turn could lead to very different programs being generated. In particular, as programmers know, it's often the edge cases that pose the main difficulty…

As a technical manager, this actually isn't that far from what happens with teams of engineers. The less precise I am in describing the requirements of a system, the less correct solution is produced. This isn't to say that my team is incompetent or mindless -- far from it, I find them to be some of the most talented engineers I've had the pleasure of working with. Perhaps the solution to this particular problem is a…

I'm not saying it applies to your case, but one danger of specifying a problem in too much detail, is that it teaches the engineers to think less about the problem. From my experience developers often think of failure cases that the managers are not aware of, or have a simpler solution to a problem.

Re: AI learns to write its own code by stealing from other programs

#88
post #51

Earlier quoted context omitted.

we'll still have job but we'll be explaining an AI what we're looking for like it's 5.

that sounds pretty easy to debug though but the verbosity.... it will be a lot of writing, even for a simple function

> that sounds pretty easy to debug though

Sounds like a nightmare to me. How do you describe a bug to an AI? "Dear AI, that SQL query you did break on my server. Could you improve it and regenerate all your code? ... Nope, still doesn't work. Could you try again?"

Re: AI learns to write its own code by stealing from other programs

#89
post #45

“It could allow non-coders to simply describe an idea for a program and let the system build it” This is not a new thought. The problem with it, however, is that such a description would have to be very precise or else leave room for different interpretations which in turn could lead to very different programs being generated. In particular, as programmers know, it's often the edge cases that pose the main difficulty…

In my experience, people have trouble describing something in sufficient detail that another human can build what they want. I think we're a ways off yet from AI being able to do so.
Post reply on HN