Live data from Hacker News

Copilot regurgitating Quake code, including sweary comments

twitter.com

151–160 of 672 posts

Re: Copilot regurgitating Quake code, including sweary comments

#151
post #87

Earlier quoted context omitted.

> And these are the hand picked examples. This product seems like it needs some more thought. Everyone's self-preservation instincts kicking in to attack Copilot is kinda amusing to watch. Copilot is not supposed to produce excellent code. It's not even supposed to produce final code, period. It produces suggestions to speed you up, and it's on you to weed out stupid shit, which is INEVITABLE. As a side note, Excel a…

So how do you know if the code that Copilot regurgitates is almost a 1:1 verbatim copy of some GPL'ed code or not ? Because if you don't realize this, you might be introducing GPL'ed code into your propiertary code base, and that might end up forcing you to distribute all of the other code in that code base as GPL'ed code as well. Like, I get that Copilot is really cool, and that software engineers like to use the la…

You have the same issue with MIT because it requires attribution

Re: Copilot regurgitating Quake code, including sweary comments

#152
The irony is that we're whinging about a tool that generates code that will be difficult to understand in the future...

... and the example is mathematically- and floating-point-spec obtuse enough that it was incomprehensible at the time it was written. (As evidenced by id comments)

Re: Copilot regurgitating Quake code, including sweary comments

#153

From the GPLv2 licensed code: https://github.com/id-Software/Quake-III-Arena/blob/master/c... copilot repeats it word for word almost, including comments, and adds an MIT like license up the top

Actually the indentation of the first comment and the lack of preprocessor show it's not copied from this code directly but from Wikipedia ( https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overv... ) So It could be that the Quake source code is not part of the training set but the Wikipedia version is.

While I strongly doubt they would use Wikipedia as a training set, has anyone done a search of GitHub code to see if other projects have copied-and-pasted that function from Wikipedia into their more-permissive codebases?

Re: Copilot regurgitating Quake code, including sweary comments

#154

Earlier quoted context omitted.

> The python example is using floats for currency. Dumb question, but what is the proper way to handle currency? Custom number objects? Strings for any number of decimal places?

Depends what you’re doing. In fact it’s not always wrong to use floats for currency. For accounting you should probably use a fixed-precision decimal type.

If someone asks how to handle money the best answer is integers or fixed precision decimals. There may be a valid case for using floats, but if someone asks they shouldn't be using floats.

Also I'm hard pressed to come up with a case where floats would work. Can you give an example?

Re: Copilot regurgitating Quake code, including sweary comments

#155
post #140
post #87

Earlier quoted context omitted.

> And these are the hand picked examples. This product seems like it needs some more thought. Everyone's self-preservation instincts kicking in to attack Copilot is kinda amusing to watch. Copilot is not supposed to produce excellent code. It's not even supposed to produce final code, period. It produces suggestions to speed you up, and it's on you to weed out stupid shit, which is INEVITABLE. As a side note, Excel a…

>As a side note, Excel also uses floats for currency It's still problematic, but the defaults and handling there avoid some issues. So, for example: Excel: =1.03-.42 produces 0.61, by default, even if you expand out the digits very far. Python: 1.03-.42 produces 0.6100000000000001, by default.

Excel rounds doubles to 15 digits for display and comparison. The exact precision of doubles is something like 15.6 digits, those remaining 0.6 digits causing some of those examples floating (heh) around.

Re: Copilot regurgitating Quake code, including sweary comments

#158

I hate to be the one that says this but I think it‘s true: "So you are an SWE and you take a break from work to go to Hackernews to complain that Github's Copilot, which is an AI-based solution meant to help SWEs, is utter shit and completely unusuable. And then you go back to writing AI-based solutions for some other profession. Which is totally not shit or anything.“ Can anybody put this more elegantly?

"'I never thought leopards would eat MY face,' sobs woman who voted for the Leopards Eating People's Faces Party."

Re: Copilot regurgitating Quake code, including sweary comments

#159
post #26

This does make me wonder if this is susceptible to the same form of trolling as that MS AI got. Commit a load of grossly offensive material to multiple repos, and wait for Copilot to start parroting it. I think they're going to need some human moderation.

Offensive code is the least of my worries. What about vulnerable/exploitable code?

Just ask it to prioritize safety

Re: Copilot regurgitating Quake code, including sweary comments

#160
post #146
post #96

Earlier quoted context omitted.

Because it's an opaque neural network on the backend, it doesn't know if or from whom it copied code.

Could they handle this by generating a collective attribution file that covers every (permissively licensed) repository that Copilot learned from? Of course this would be massive, so from a practical consideration the attribution file that Copilot generates in the local repository would have to just link to the full file, but I don't think that would be an issue in and of itself.

Maybe? Might depend on the license, I doubt the courts would be amused.

Almost certainly a link would not suffice, basically every license requires that the attribution be directly included with the modified material. Links can rot, can be inaccessible if you don't have internet access, can change out from underneath you, etc.

(I am not a lawyer, btw)

Post reply on HN