Live data from Hacker News

Study finds AI assistants help developers produce code likely to be buggy

theregister.com

81–90 of 153 posts

Re: Study finds AI assistants help developers produce code likely to be buggy

#81
post #52

Earlier quoted context omitted.

Then how much time are you actually saving if you have to review everything it produces. The bottle neck was never typing speed, at that point all the AI is allowing you to do is produce more buggy code more quickly.

I use Copilot daily and experimented with using ChatGPT for real work code. It’s an incredibly valuable tool even with having to rewrite the larger outputs… the small stuff like autocompleting variables and keys is highly accurate and what it most often generates (it’s scary how good it is at finishing the exact line you had in your head x50 times a day). What you need to be careful about is when it generates entire…

[deleted]

Re: Study finds AI assistants help developers produce code likely to be buggy

#82
post #74

The anti-singularity, where an AI produces decreasingly correct versions of itself.

The next AIs will be trained on vast swathes of low-quality AI-generated outputs, if they are trained on public data again. Presumably people will have to come up with ways to work around that or the AI will be training to produce outputs like a low quality AI. By low quality I just mean the state of the outputs today, which are incredible for what they are, but are definitely not the pinnacle of what is in theory po…

Anybody that uses these ai assistants know that the human is still by far the main architect and driver of the code base.

Increasingly advanced AI just means more back/forth between coder and AI, both increasing each other's velocity. AI won't just be trained on other AI-generated code, but more like "cyborg" code. Code that was made by both AI and human together. Code that the human probably wouldn't have been able to accomplish, at least not as quickly or in as much volume, without the AI

Rather than a singularity we might see a "multilairty" where both human and AI become increasingly useful to each other. A situation that takes full advantage of diversity in ways of thinking about and processing information/knowledge

Re: Study finds AI assistants help developers produce code likely to be buggy

#83
post #21

Surprising. If only there were a way that we could have foreseen that an AI trained to write code in part by looking at people who, self-admittedly, don’t know how to write code, and people who write code for others with minimal context (Stack Overflow), would produce buggy code. It is a case of GIGO. Most developers do not learn much from Stack Overflow. Why do we expect AI to fare better? In my experience, one in t…

> If only there were a way that we could have foreseen that an AI trained to write code in part by looking at people who, self-admittedly, don’t know how to write code, and people who write code for others with minimal context (Stack Overflow), would produce buggy code. It is a case of GIGO.

So, I'll claim the real issue is just that this generation of AI isn't able to "learn", it merely "trains": if I were alone in a room for years and you gave me a book on how to program that has an error in it, during my careful study of the book (without a computer to test on!), I am likely to notice the error, get annoyed at the author trying to figure out if I failed to understand some special case, and then eventually decide the author was wrong. With only the knowledge from the book, I will also be able to study the concepts of programming and will eventually be able to design large complex systems; again: I will be able to do this even if I don't have a computer, in the same way people have studied math for millennia.

And like, this is how we all learned to program, right? The books and tutorials we learn to program with often suck; but, after years dedicated to our craft synthesizing the best of what we learn, we not only can become better than any one of the sources we learned from, given enough time to devote to practice and self-study we can become better than all of them, both combined and on average (and if we couldn't, then of course no progress could ever be made by a human).

With a human, garbage in can lead to something fully legitimate out! A single sentence by someone saying "never do X, because Y can happen, where Y is extremely important" can cause us to throw out immense amounts of material we already learned. Somewhere, GitHub Copilot has seen code that was purposefully documented with bugs (the kind we use to train humans for "capture the flag events") as well as correct code with comments explaining how to avoid potential bugs... it just didn't "give a shit", and so it is more likely to do something ridiculous like generate code with a bug in it and a comment explaining the bug it just generated than to generate correct code, because it doesn't have any clue what the hell it is doing and isn't analyzing or thinking critically about the training input.

> Even if AI could generate correct, bug-free code the majority (say 99.9% of the time), I expect finding and correcting bugs will be difficult for humans.

There is some error rate below which you beat the chance of a human making a dumb mistake just because they are distracted or tired, and at that point the AI will just bear the humans. I don't know if that is 99.9% or 99.9999% (it might be extremely tight, as humans generate thousands and thousands of individual decisions in their code every work session), but past that point you are actually better off than the current situation where I first program something myself and then hire a team of auditors to verify I coded it correctly (and/or a normal company where someone is tasked to build something and then every now and then someone like me is hired to figure out if there are serious mistakes).

Re: Study finds AI assistants help developers produce code likely to be buggy

#84

Earlier quoted context omitted.

If I had a little robot riding in the passenger seat that could tell me whether to go left, straight, or right, and it was correct 90% of the time, I'd think that was pretty great. I'd get where I needed to be, even with a couple mishaps. ML code suggestions are the same thing to me. If I don't know where I am going, I can just ask it for suggestions. And it's probably going to be what I want. In both cases, I am ann…

Your example hinges on at least two things 1) How many turns do you take on a particular trip 2) How do those wrong turns end up? if it's "travel time extended by 30 seconds" or "My car, the car I hit and the side of this building are all in shambles" changes what a 10% failure rate means a lot.

Right? Took a turn the wrong way down a one way street. Hit a lady with a stroller who was looking the other way. She is a surgeon. Her husband is a lawyer. You killed the kid. Your life is over.

Re: Study finds AI assistants help developers produce code likely to be buggy

#85

Not surprising given the discussion I've seen about these AIs on HN and other sites. AFAICT, they're generally treated as a shortcut to avoid learning an API or library, or as a shortcut to avoid boilerplate by essentially copying somebody else's boilerplate. Both cases boil down to using other people's code for purposes that it wasn't built for, which is obviously going to be error prone. The AI has no idea how this…

> The AI has no idea how this particular case differs from the sample code it was trained on

It can eventually figure a lot of things out if you provide the correct requirements and examples. However, the caveat with all of this is that you already have to be a good programmer to:

- know what is needed

- know what the solution should more or less look like

- spot bugs in the AI's solution

- describe the problem, examples etc in a way that the AI can work with

If you're already a good programmer, the time spent wrangling the AI could be spent writing the solution yourself.

My feeling is that the most value from AIs will come from when you get hopelessly stuck on a problem. An AI could provide some initial steps or ideas that can get you unstuck, effectively working as a rubber ducky. You're unlikely to copy the AI's solution, but it could provide some random insight that helps you take a step forward.

Re: Study finds AI assistants help developers produce code likely to be buggy

#87
post #82
post #74

Earlier quoted context omitted.

The next AIs will be trained on vast swathes of low-quality AI-generated outputs, if they are trained on public data again. Presumably people will have to come up with ways to work around that or the AI will be training to produce outputs like a low quality AI. By low quality I just mean the state of the outputs today, which are incredible for what they are, but are definitely not the pinnacle of what is in theory po…

Anybody that uses these ai assistants know that the human is still by far the main architect and driver of the code base. Increasingly advanced AI just means more back/forth between coder and AI, both increasing each other's velocity. AI won't just be trained on other AI-generated code, but more like "cyborg" code. Code that was made by both AI and human together. Code that the human probably wouldn't have been able…

How will they be able to keep purely AI-generated outputs from being fed back in as inputs? That seems hard to separate out once it’s published and not attributed. The ability of AI to generate lots of output means it might swamp human or cyborg outputs when looking at the corpus of publicly searchable code (or blog posts, or whatever the training data is for the case in question).

Maybe a GAN to detect and filter out AI-generated content? Not sure if that’s possible or not.

Re: Study finds AI assistants help developers produce code likely to be buggy

#88
I am an experienced "industry professional" C++ programmer and I tried ChatGPT and Stackoverflow and found it impressing and entertaining, but I don't know how these two platforms would be helpful for my work. I never use them.

When I need to solve a problem I must read the (API's) docs and I must understand it. It would be dangerous and buggy if I would copy 'n paste code from somewhere. I don't think it would even work.

I also can learn from high quality examples by following it and understanding the details. But Stackoverflow is full of questions that feel like someone was too lazy or does not have the skills to read the manual.

But maybe these platforms are good for learning? I am not sure if ChatGPT and SO are good tools to learn to program. Maybe people learn more when they take the time to find a solution by themselves.

Re: Study finds AI assistants help developers produce code likely to be buggy

#89
post #86

Now compare this to people who blind copy paste from Stack Overflow. This is a bad comparison until you accurately divide the group of engineers who use it correctly and incorrectly.

There's probably a sampling bias for SO that means higher quality than the average code from GitHub (what it was trained on).

Re: Study finds AI assistants help developers produce code likely to be buggy

#90

The first few weeks of ChatGPT I had a goal to make it code. My preliminary conclusion is that if given a feedback loop it could code a lot of basic stuff just fine, my workflow went something like this: - Identify a component in a system you want to build - Give ChatGPT a list of bullets and ask it to write tests - Review tests - Run tests, give ChatGPT output of failing tests - Add the code to your codebase, run th…

I'm guessing it depends on the situation, but at what point does all of that become more work than just writing the tests and code yourself? Is it worth the "investment" to learn how to teach ChatGPT coding? Or will ChatGPT2 come out in six months, based on a different algorithm, and you'll back to square one teaching it over again?

Personally, I find writing new code easier than editting existing code, regardless of how it's written. I'd much rather have an AI that scans the code I write and searches for bugs

Writing code is easy, finding bugs is hard, and it's the finding of bugs that I'd like to see automated.

Post reply on HN