Live data from Hacker News

Copilot regurgitating Quake code, including sweary comments

twitter.com

211–220 of 672 posts

Re: Copilot regurgitating Quake code, including sweary comments

#211

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

I guess this confirms John Carmack to be an AI

Re: Copilot regurgitating Quake code, including sweary comments

#212
post #30

They have 4 hand picked examples on their homepage: https://copilot.github.com/ One has the issue with form encoding: https://news.ycombinator.com/item?id=27697884 The python example is using floats for currency, in an expense tracking context. The golang one uses a word ("value") for a field name that's been a reserved word since SQL-1999. It will work in popular open source SQL databases, but I believe it would bom…

Now that they have an AI that can be trained to replicate code, it looks like the next step is training it to replicate good code. That will be non-trivial, since step one is identifying good code and they may not have much big data signal to draw from for that.

We know you can't use StackOverflow upvotes. However, they should have enough signal to identify what snippets of code have been most frequently copy-pasted from one project to another.

Question is whether that serves as a good proxy for good code identification.

Re: Copilot regurgitating Quake code, including sweary comments

#213
post #6

Even includes the commented out code. Clearly Copilot has gained a deep understanding of code and is not simply the slowest way to make a terrible, opaque search engine ever!

From the tweet it looks like an awesome search feature. Just type what you wanted to search for right inline and then it can drop the result in without you ever changing a window or moving a hand to the mouse.

Problem is you don't know whose code you're stealing, which leads to all sorts of legal, security, and correctness issues.

Re: Copilot regurgitating Quake code, including sweary comments

#214
post #124

Earlier quoted context omitted.

> ...may not always work, or even make sense... Naively, as someone who just heard of this - that sounds worse than useless. If you can't trust its output and have to verify every line it produces and that the combination of those lines does what you wanted, surely it's quicker just to write the code yourself?

Then write the code yourself. It's not like you're forced to use this demo.

Well, you're right. I was somehow expecting there might be a silver lining I'd missed but perhaps not.

Re: Copilot regurgitating Quake code, including sweary comments

#215

With apologies to Martin Niemöller[1]: First the automation came for the farmers, and I did not speak out — Because I was not a farmer. Then the automation came for the factory workers, and I did not speak out — Because I was not a factory worker. Then the automation came for the accountants, and I did not speak out — Because I was not a accountant. Then the automation came for me (a programmer) — and there was no on…

Honestly I’ve automated a large chunk of my day job. The trick is keeping it secret!

Well... wait until all the programmer salaries crash to minimum wage because Management believe that "CoPilot does most of the work anyway".

Re: Copilot regurgitating Quake code, including sweary comments

#216
post #30

They have 4 hand picked examples on their homepage: https://copilot.github.com/ One has the issue with form encoding: https://news.ycombinator.com/item?id=27697884 The python example is using floats for currency, in an expense tracking context. The golang one uses a word ("value") for a field name that's been a reserved word since SQL-1999. It will work in popular open source SQL databases, but I believe it would bom…

> 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?

A lot of good answers, but they mostly relate to accounting types of problems (which granted, is what you need to do with currency data 99% of the time)

I’d just add that if you are building a price prediction model, floats are probably what you need.

Re: Copilot regurgitating Quake code, including sweary comments

#217
post #203

Earlier quoted context omitted.

This is a complex topic, mainly for two reasons: 1. it works on two layers (storage and code) 2. there is a context to take care of. [Modern] programming languages have decimal/rational data types, which (within limits) are exact. Where this is not possible, and/or it's undesirable for any reason, just use an int and scale it manually (e.g. 1.05 dollars = int 105). However, point 2 is very problematic and important t…

The problem is also stupid people and companies. My last job they wanted me to invoice them hours worked, which was some number like 7.6. This number plays badly when you run it through GST and other things - you get repeaters. So I looked up common practice here, even tried asking finance who just said "be exact", and eventually settled on that below 1 cent fractions I would round up to the nearest cent in my favour…

I wish this was untrue, but I have spent years hearing the words "why dont my reports match?" - no amount of logic, diagrams, explaining, the next quarter or instance - "why dont my reports match?"

BECAUSE EXCEL SUCKS MY DUDE.

Re: Copilot regurgitating Quake code, including sweary comments

#218
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?

This was my first thought when reading about Copilot...it feels almost certain that someone will try poisoning the training data.

Hard to say how straightforward it'd be to get it to produce consistently vulnerable suggestions that make it into production code, but I imagine an attacker with some resources could fork a ton of popular projects and introduce subtle bugs. The sentiment analysis example on the Copilot landing page jumped out to me...it suggested a web API and wrote the code to send your text there. Step one towards exfiltrating secrets!

Never mind the potential for plain old spam: won't it be fun when growth hackers have figured out how to game the system and Copilot is constantly suggesting using their crappy, expensive APIs for simple things!? Given the state of Google results these days, this feels like an inevitability.

Re: Copilot regurgitating Quake code, including sweary comments

#219
post #30

They have 4 hand picked examples on their homepage: https://copilot.github.com/ One has the issue with form encoding: https://news.ycombinator.com/item?id=27697884 The python example is using floats for currency, in an expense tracking context. The golang one uses a word ("value") for a field name that's been a reserved word since SQL-1999. It will work in popular open source SQL databases, but I believe it would bom…

> This product seems like it needs some more thought. Maybe a way to comment, flag, or otherwise call out bad output? Wait for your colleagues to use it, fix the bad code in the pull request, and wait for copilot to learn from the new training data you just provided!

This is actually a good idea that is missing from nearly every machine learning product. How do you back propagate lessons from user interaction into future training of the model? It can be done, I can't think of a place I've seen it done though.

Re: Copilot regurgitating Quake code, including sweary comments

#220

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.

Apparently you haven't seen many of the demos that people are showing off? Because saying that this only occurs when the author is explicitly asking for copied code is blatantly false.
Post reply on HN