Live data from Hacker News

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

theregister.com

91–100 of 153 posts

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

#91
post #67
post #9

Earlier quoted context omitted.

But what if you could write more LoC/h and make Elon Musk happier?

You’ll need to pair it up with a super fast laser printer to be able to get it all properly code reviewed.

Can AI with aimbot do that for us?

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

#92

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, exam…

> My feeling is that the most value from AIs will come from when you get hopelessly stuck on a problem.

This sounds about right.

It may also help you to find related areas to study. I was throwing rocket optimization problems at ChatGPT and it was horrible, but I think it was finding some related code from vehicle navigation optimization problems which I found interesting.

It does reasonably well at simple kinds of symbol manipulation and might be able to replace matlab/mathematica at some point, but the problem is that you always have to double-check the results. I'm not sure it is really that much better than just knowing your way around wikipedia (which has its own accuracy issues, but for straightforward things it is usually pretty good).

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

#93

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…

TL;DR - Models can learn from massive validation, not just massive text prediction.

I agree our current crop of Copilot, GPT-3 and chatGPT can introduce subtle bugs, and that's a big problem. Checking for such bugs takes time. They code like someone who read a lot and has good memory, but never implemented anything complex.

But there is no reason to be the same in the next iteration. Language models can be fine-tuned on code execution, that means giving sufficient exposure to trial and error to learn how to avoid such bugs.

Having a way to test its outputs is the key to self improvement. It works the same with AlphaGo - the model is generating its own training data, and this process can eventually surpass human level. It just needs tons of compute to iron out a lot of bad ideas.

Alternatively, the model could use a code execution environment at runtime, too. So it could iterate a few times on an error, eventually using web search if it cannot solve it alone, instead of simply failing and leaving it to the human to fix. It is pretty good at proposing fixes and will recover most of the times, like human devs.

I'm leaving this for further reading. It's fascinating.

> Evolution through Large Models

> Large language models (LLMs) trained to generate code can vastly improve the effectiveness of mutation operators applied to programs in genetic programming.

https://arxiv.org/abs/2206.08896

The paper is from OpenAI, Ken Stanley who works on opendedness is the last author.

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

#94
Looking at the demographics of the study, they only had 47 total participants, 15% of which were professionals and 62% reporting less than 5 years experience coding (which I would imagine is an underestimate assuming some people exaggerated their actual experience level). So that means they only had 6-7 participants who worked in industry and generously 18 people with more than 5 years experience. They also don’t report the breakdown of how participants did by experience. One other factor they use to measure is if the participant has security experience, but their bar for that is whether they have taken a single security class.

Given all of this, I don’t think the paper’s conclusion is convincing at all given that they were evaluating this on a pool of participants that a majority were students with not much experience programming when these tools are sold for professional use. I would bet if the study had a more uniform distribution of experience levels, you would probably see the “bugginess” trend downwards with more experience. Participants with more years programming just have had more time to learn how to use new tools more effectively in their workflows.

I definitely tweaked my methods of using Copilot plenty over the past year or so to take advantage of its strengths and avoid weak its weaknesses.

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

#95
Recently had the misfortune of fixing a really overwrought and broken chunk of html. Copilot kept trying to introduce tons of junk into it of nearly the exact same variety I was trying to remove. I'm not sure how to fix this logically but still seems like copilot has a way to go improve helpfulness.

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

#96

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…

I don't know what you do for your work, but I suspect you haven't used chatgpt/copilot/etc enough to see the benefits.

Do you think tab-autocompletion is useful? AI assistants can do that on steroids.

Do you ever use example code to learn a new package? ChatGPT does that at a new level.

When I hear developers I work with saying stuff like the above, I think it sometimes comes from a place of insecurity. It's ok to find these tools useful, it doesn't mean you aren't an elite programmer. In the end the best developers will find ways to use these tools to learn faster and build better.

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

#97
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…

reCaptcha v5: Which lines have errors?

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

#98
I spent a few days working on using ChatGPT to write code. I've been meaning to write a blogpost about my experience, but here's my synopsis.

Where ChatGPT was best was when I wanted to do generic data structure work with common tools. Prompts like "make a Python class that stores keys in a redis sorted set, with the score as a timestamp, that removes members older than a configured time on access / insertion." I know how that code should work, I know what's correct- but it's nice being lazy and letting ChatGPT spit out a class for me I can clean up.

Anytime I want to do anything weird or nonstandard, ChatGPT is an uphill battle. Try asking it to write a convolution function without using Numpy (say you're using PyPy or AWS Lambda and C extensions are a no go). It will often insist you have to use Numpy- it argued with me at one point it wasn't possible without it! (This has gotten a bit better since, but was still quite interesting)

Working with pre-existing code, especially anything database related, was not worth the time spent at all. Terrible query plans, misinterpreting the schema that was provided, etc. I do love SQL though- I'm quite biased here.

It was interesting in that when it worked best, I needed to know what to ask for. I asked a good friend who started learning to code a few months ago to try it, and she was way less successful with it versus reading documentation.

Ultimately I think with tight text editor integration it will be great, but it's still going to require someone skilled and who knows what to ask for- at least for a couple years. As for how productive it's made me, I've stopped using it for anything except greenfield work with common libraries I already know how to use.

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

#99

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, exam…

I hadn't considered the "hopelessly stuck" aspect, and that does seem promising.

I fully agree on your other points, though. Communicating the requirements to the AI in a non-ambiguous way is more-or-less equivalent to just writing the code. I can't even get firm requirements from my coworkers, and we all presumably have "real" intelligence.

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

#100
post #69
post #4

I made a site using the OpenAI APIs new models (similar to ChatGPT) for creating simple apps or demos using natural language: https://aidev.codes . If anyone is interested please try it out. I tried to promote the site by submitting to HN and did not receive a single vote. I feel that although many people may not be impressed, it is better than 0. So I am just trying to promote it in related threads. Anyway if you ha…

Hi ilaksh, I was able to view your video on an android device. That said, I did have to watch it several times before I understand what was going on because a lot is happening everywhere in the screen. With the video and the minimalist intro on the site, I was still left guessing what was being offered and how it works. Usually before signing up for any website, I want to check out all of the information I can find o…

Can I send my site to you to critique if I make one please?
Post reply on HN