Live data from Hacker News

Copilot regurgitating Quake code, including sweary comments

twitter.com

41–50 of 672 posts

Re: Copilot regurgitating Quake code, including sweary comments

#41

I think the problem might be in the training data. Famous code examples are probably copied a lot and therefore appear multiple times in the training data, prompting the neural network to memorise it completely.

Is this function used verbatim in multiple projects? I know it's famous but how often does one use an approximation of inverse sqrt instead of the readily available cpu call in the past 20 years

Re: Copilot regurgitating Quake code, including sweary comments

#42

I've always assumed that we would eventually have a low-code, or no-code junior dev replacement, and was wondering if this was it. GH and MS actually have [Ed. had?] some cred for this kind of thing. Nope. Game over. Play again?

Copying GPLed code as your own and passing it under an MIT license is not too far fetched of a thing for a junior dev to do.

Jokes aside, to have a proper junior dev replacement you need something that is able to learn and grow to eventually become a senior dev, an architect, or a CTO. That is the most important value of a junior dev. Not the ability to produce subpar code.

Re: Copilot regurgitating Quake code, including sweary comments

#43
post #5

This is utterly damning. I have already instructed my team that Copilot can never be used for our projects. Compromising the product because of unknowable license demands isn't acceptable in the professional world of software engineering. But if we put the licensing to one side for a moment... 1/ Everything I've seen it generate so far is 'imperative hell'. It is practically a 'boilerplate generator'. That might be u…

My question is would Copilot be useful if you could choose the codebase it would be drawing from? Almost as an internal company tool?

It would certainly alleviate the license concerns. If it was possible to train it to a level (that produces effective output), then sure.

As a thought experiment, I thought "what would happen if we trained it on our 15 million lines of product code + my language-ext project". It would almost certainly produce something that looks like 'us'.

But:

* It would also trip over a million or so lines of generated code

* And the legacy OO code

* It will 'see' some of the extreme optimisations I've had to built into language-ext to make it performant. Something like the internals of the CHAMP hash-map data-structure [1]. That code is hideously ugly, but it's done for a good reason. I wouldn't want to see optimised code parroted out upfront. Maybe it wouldn't pick up on it, because it hasn't got a consistent shape like the majority of the code? Who knows.

Still, I'd be more willing to allow my team to use it if I could train it myself.

[1] https://github.com/louthy/language-ext/blob/main/LanguageExt...

Re: Copilot regurgitating Quake code, including sweary comments

#44
From the Copilot FAQ:

> The technical preview includes filters to block offensive words

And somehow their filters missed f*k? That doesn’t give a lot of confidence in their ability filter more nuanced text. Or maybe it only filters truly terrible offensive words like “master”.

Re: Copilot regurgitating Quake code, including sweary comments

#45
post #16
post #5

This is utterly damning. I have already instructed my team that Copilot can never be used for our projects. Compromising the product because of unknowable license demands isn't acceptable in the professional world of software engineering. But if we put the licensing to one side for a moment... 1/ Everything I've seen it generate so far is 'imperative hell'. It is practically a 'boilerplate generator'. That might be u…

Awesome summary and thanks for trying it for the rest of us! Copilot sounded terrible in the press release. The idea that a computer is going to pick the right code for you (from comments, no less) is really just completely nuts. The belief that it could be better than human-picked code is really way off. You bring up a really important point. When you use a tool like Copilot (or copypasta of any kind), you are intro…

Stuff like Copilot makes programming worse and more difficult, not better and easier.

Copilot makes programming worse and more difficult if you're aiming for a specific set of coding values and style that Copilot doesn't generate (yet?). If Copilot generates the sort of code that you would write, and it does for a lot of people, then it's definitely no worse (or better) than copying something from SO.

The author of a declarative, functional C# framework likely has very different ideas to what code should be than some PHP developer just trying to do their day-to-day job. We shouldn't abandon tools like Copilot just because they don't work out at the more rigorous ends of the development spectrum.

Re: Copilot regurgitating Quake code, including sweary comments

#46
post #9

This is pretty clearly just a search engine with more parameters. I thought there was something more going on with copilot, but the fact that it is regurgitating arbitrary code comments tells me that there is zero semantic analysis going on with the actual code being pulled in.

It is decidedly not "just a search engine with more parameters." Language models are just prone to repeating training examples verbatim when they have a strong signal with the prompt. Arguably, in this case, it is the most correct continuation.

Re: Copilot regurgitating Quake code, including sweary comments

#47
post #9

This is pretty clearly just a search engine with more parameters. I thought there was something more going on with copilot, but the fact that it is regurgitating arbitrary code comments tells me that there is zero semantic analysis going on with the actual code being pulled in.

It's more that the model is so large it is capable of memorizing a lot. This can be seen in other language models like GPT-3 as well.

Comments, I suspect, will be more likely to be memorized since the model would be trained to make syntactically correct outputs, and a comment will always be syntactically correct. That would mean there is nothing to 'punish' bad comments.

Re: Copilot regurgitating Quake code, including sweary comments

#49
post #14

I’m really dumbfounded by the Copilot team decision to not exclude GPL licensed code. Why was this direction chosen? Is the inclusion of GPL really worth the risk and potential Google v. Oracle lawsuit? I’d like to know the reasoning.

Why would excluding GPL'd code be enough to not violate licenses? I don't understand why people think MIT or other licenses are free for alls to take code as they wish. The MIT license includes an attribution clause. And, as the linked video shows, Copilot is more than happy to take its code and put your pet license and copyright notice on instead. Isn't that equally as infringing as stealing GPL code? The idea of mining GitHub for training data was doomed from the start copyright-wise, as there's so much code that's misattributed, wrongly-licensed, or unlicensed.

Re: Copilot regurgitating Quake code, including sweary comments

#50
It seems like a very sensible answer from copilot since the prompt includes "Q_" which makes it obvious that the programmer is specifically looking for the Quake version of this function.

To me it doesn't show that copilot will regurgitate existing code when I don't want it to, just that if I ask it to copy some famous existing code for me it will oblige.

Post reply on HN