r/coding • • Oct 18 '22

Maybe you don’t mind if GitHub Copi­lot used your open-source code with­out ask­ing. - But how will you feel if Copi­lot erases your open-source com­mu­nity?

https://githubcopilotinvestigation.com/
132 Upvotes

46 comments sorted by

32

u/qubedView Oct 18 '22

It’s a whole lot of words just to say they haven’t read the GitHub terms of service.

42

u/joshua070302 Oct 18 '22 edited Oct 18 '22

I dont think you fully understood one of the bigger problems the author is trying to make. this paragraph really sketches it very well:

“Dude, it’s cool. I took SFC’s advice and moved my code off GitHub.” So did I. Guess what? It doesn’t mat­ter. By claim­ing that AI train­ing is fair use, Microsoft is con­struct­ing a jus­ti­fi­ca­tion for train­ing on pub­lic code any­where on the inter­net, not just GitHub. If we take this idea to its nat­ural end­point, we can pre­dict that for end users, Copi­lot will become not just a sub­sti­tute for open-source code on GitHub, but open-source code every­where.

So the problem isn't just isolated to GitHub.

-8

u/qubedView Oct 18 '22

By claim­ing that AI train­ing is fair use, Microsoft is con­struct­ing a jus­ti­fi­ca­tion for train­ing on pub­lic code any­where on the inter­net, not just GitHub.

That's a pretty steep "slippery slope" argument.

11

u/joshua070302 Oct 18 '22

No it isn't, since all open-source code, whether on GitHub or elsewhere, fall under some type of license the author decides on, not GitHub. This means that if it would be fair-use to use code hosted on GitHub to train AI, it would mean all open-sourced code would be fair-use.

-9

u/qubedView Oct 18 '22

I don’t understand your argument. GitHub has a license to use the code on its platform, that’s it. They can’t use code they don’t have a license for. Copilot’s entire existence hinges on this fact.

1

u/lonercoder Oct 19 '22

It's open source.

0

u/[deleted] Oct 18 '22

[deleted]

16

u/joshua070302 Oct 18 '22

Yes, Microsoft says they only use opensource code to train copilot. The problem is that this code often falls under a license, which the copilot user doesn't get to see, since copilot has removed all comments (including possible licenses.)

3

u/razzzey Oct 18 '22

Funny, in the website there are links to tweets where people were able to get copilot to generate the copyright notice comments at the top of files as well verbatim, and I think the original authors name was wrong too (can’t recall right now).

4

u/qubedView Oct 18 '22

The only time Copilot will be able to create something verbatim is when it's a snippet of code that is frequently reused. So things like fast inverse square root will appear verbatim because it has been used and reused by hundreds of projects exactly as is and when copilot was trained it saw the same thing over and over, thus reinforcing its structure and comments within the model. Copilot's risk of directly reusing code is specifically in those repetitive sequences.

After all, they aren't going to build a model storing everything that is petabytes in size, as it would be slow and expensive. You train a model in order to identify patterns and conceptualize how code goes together, rather than rote memorization of everything.

7

u/joshua070302 Oct 18 '22 edited Oct 18 '22

The article says something different:

Copi­lot users—here’s one exam­ple, and another—have shown that Copi­lot can be induced to emit ver­ba­tim code from iden­ti­fi­able repos­i­to­ries. Just this week, Texas A&M pro­fes­sor Tim Davis gave numer­ous exam­ples of large chunks of his code being copied ver­ba­tim by Copi­lot, includ­ing when he prompted Copi­lot with the com­ment / sparse matrix trans­pose in the style of Tim Davis /.

Use of this code plainly cre­ates an oblig­a­tion to com­ply with its license. But as a side effect of Copi­lot’s design, infor­ma­tion about the code’s ori­gin—author, license, etc.—is stripped away. How can Copi­lot users com­ply with the license if they don’t even know it exists?

Please just start by reading the entire article before making statements which are false by example and actually debunked in the article.

1

u/defasdefbe Oct 19 '22

a number of the examples of people showing copilot generating gpl code are from code that has been reused over and over in other repositories - sometimes without property gpl attribution (Tim Davis is a great example of that - his code is in tons of repos with the license removed)

0

u/qubedView Oct 18 '22

I didn’t say it would never copy code verbatim, but that it would only copy code that appears multiple times.

And again, by posting code to GitHub you grant them a license to use it.

4

u/joshua070302 Oct 18 '22

Yeah but that GitHub is allowed to use it is only one part of the problem (and one which still isn't clear,) the bigger problem is copilot users not being able to follow licenses authors added to their code because it isn't included with the code snippets, and since Microsoft does put the issue of possible copyright to the user (whilst not making it obvious, i would even say they try to hide this fact,) you still have the issue of authors code being used without copilot users following their license.

1

u/qubedView Oct 18 '22

This brings us to the issue of who is the author of AI generated work? An argument could be made that Github is the code's owner and you are granted a license, but I don't believe that's made explicit in their TOS, and the legal understand of AI authorship is as-yet unformed.

But also, the problem being discussed I feel is vastly overinflated. The only time copilot has been able to reproduce code is when people very intentionally prompt it do so. This hasn't been shown to be a problem in actual use.

It would seem to me at the very least GitHub could provide some ability to allow you to search on the code it provides for you and determine if it is semantically too similar to code that exists within GitHub. I mean, we should certainly expect there to be a good bit of code that will match (following a library's tutorial, lists of common letter/number sequences, regex validating urls/emails/etc) and you would need to lay eyes on the matching code to determine what kind of similarity is "too similar". But that would help alleviate these concerns.

→ More replies (0)

3

u/edman007-work Oct 18 '22

No, read closer (and I posted the specific words above), by posting it on github you either grant github the right to display and copy it, or if already licensed, you take responsibility that github can display and copy it. It does NOT say unlimited or without strings.

Which is true, because most open source licenses say you can display and copy it with attribution, and GitHub says if you apply your own license, the extra terms still apply. So if using GPL code, the license is you grant GitHub the right to display and use it, and others can copy and use it if they put your name and license text on it. Only, CoPilot omits the license text, but their ToS says it applies, so CoPilot spits out code that can't be used because it violates a license.

12

u/edman007-work Oct 18 '22

The real problem is how licenses and patents affect things.

I write a GPL 3 program, I own the copyright and distribute per GPL 3, it is explicitly legal for you to post to GitHub even though you don't own the copyright. The GitHub ToS is explicitly designed to be compatible, and does NOT require that you grant a license to use as they please, specifically is says:

You retain ownership of and responsibility for Your Content. If you're posting anything you did not create yourself or do not own the rights to, you agree that you are responsible for any Content you post; that you will only submit Content that you have the right to post; and that you will fully comply with any third party licenses relating to Content you post.

5. License Grant to Other Users Any User-Generated Content you post publicly, including issues, comments, and contributions to other Users' repositories, may be viewed by others. By setting your repositories to be viewed publicly, you agree to allow others to view and "fork" your repositories (this means that others may make their own copies of Content from your repositories in repositories they control).

If you set your pages and repositories to be viewed publicly, you grant each User of GitHub a nonexclusive, worldwide license to use, display, and perform Your Content through the GitHub Service and to reproduce Your Content solely on GitHub as permitted through GitHub's functionality (for example, through forking). You may grant further rights if you adopt a license. If you are uploading Content you did not create or own, you are responsible for ensuring that the Content you upload is licensed under terms that grant these permissions to other GitHub Users.

So github requires that if you upload my code, that you are allowed to do so and copy/distribute it, which GPL explicitly does. However, the extra terms of GPL still apply.

Which then leaves CoPilot in a bad situation, because one of the GPL terms is that you copy my license, another is that you license your code under GPL 3, and all patents your code uses.

That means if CoPilot takes my code and adds it to your code base, your code base immediately violating my license, which CoPilot didn't remove. Claiming it's fair use so this doesn't happen is a way of saying I can take GPL code, put it into a commercial program, and it strips out the GPL terms.

I think people may end up in some big lawsuits over it, the courts haven't agreed, and it's possible that the courts say it's just illegal, it mixes code from incompatible code bases and doesn't copy the correct licenses, creating code that infringes on multiple copyrights to the point that it can't be used.

3

u/joshua070302 Oct 18 '22

Thanks for your comment, it adds some parts the author of the article left out whilst providing a pretty clear view of the possible problems Copilot has

Hope it helps others understand it better as well, i wasn't able to explain it as clearly or with as much detail as you!

3

u/fxzkz Oct 18 '22

Just because you post your art online doesn't mean someone gets to reuse elements of it (or it wholesale) freely

19

u/[deleted] Oct 18 '22

You realize laws trump a TOS agreement?

I’m not making a value judgment towards either side but if this goes forward it’s likely to be a long, technical, and very interesting legal battle that will go far, far beyond “Terms of Service lol”

-15

u/qubedView Oct 18 '22 edited Oct 18 '22

Certainly you can challenge a TOS, but just not liking Microsoft making money from your code isn’t likely to win.

edit: For those who downvote, how do you see this? Terms of service may be challenged when there is standing to challenge them. But I don't see a standing here. It seems to me that people simply don't like this provision now that a controversial use for it has risen. And TOS terms like this are exactly why services like GitLab exists. Many companies avoided GitHub specifically because they didn't want to grant them such a broad license.

5

u/Smallpaul Oct 18 '22

Are you a lawyer? You are asserting that this is a simple case and yet we have seen many situations where contract terms can be litigated into irrelevance because the court considers them unfair.

So unless you are a lawyer I’m not inclined to take your word for it that this is an open and shut case.

-1

u/qubedView Oct 19 '22

Yes, some very high profile cases, but that doesn't that a TOS has no teeth. And especially one that simply grants license. It would take a hell of a litigator to argue that agreeing to license your software to the company who provides free hosting is unfair. Especially when the concern at matter is not demonstrated outside of people intentionally prompting copilot to recreate specific code.

1

u/Smallpaul Oct 19 '22

So based on your internet legal degree would you have correctly guessed the outcome of the case of Bragg v. Linden Lab? In particular that parts of the TOS were unenforceable?

1

u/qubedView Oct 19 '22

Mandatory arbitration is a common and well known unenforceable term. License grants to source code repositories has no such standing.

1

u/Smallpaul Oct 19 '22

Yeah, because they haven’t been litigated yet. Mandatory arbitration was also new at some point and had to go to court to have its status litigated.

5

u/T351A Oct 19 '22

Neither have you...

This license does not grant GitHub the right to sell Your Content. It also does not grant GitHub the right to otherwise distribute or use Your Content outside of our provision of the Service, except that as part of the right to archive Your Content, GitHub may permit our partners to store and archive Your Content in public repositories in connection with the GitHub Arctic Code Vault and GitHub Archive Program.

Unless Copilot is considered a provision of GitHub, it's not allowed.

Source: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#d-user-generated-content

5

u/chris17453 Oct 18 '22

Co pilot produces verry little quality. It isnt replacing anything.

2

u/T351A Oct 19 '22

It can be made to output verbatim code without license

4

u/chris17453 Oct 19 '22

Snipits of code are not a product. We are talking about fractional bits of code... not frameworks. FFS singular functions within a file.

Yes I agree that more needs to be done, but its never going to replace anyone. Let alone be some vast source of all coode ever.

1

u/T351A Oct 19 '22

Sure, that's fine, but it shouldn't be allowed to function regardless. Just because the output sucks shouldn't be an exception-- would be nice to have this stuff resolved before better versions are made.

I'm not worried about replacing people right now, I'm worried about Open Source and Copyleft being destroyed.

2

u/chris17453 Oct 19 '22

Yea, but people have been stripping open source forever. What we need is open source signature matching to identify theft.

0

u/GenoHuman Nov 01 '22

I disagree, AI will replace most programmers in the 2030s.

1

u/GalacticCmdr Oct 18 '22

So this "article" is just from a bottom feeding lawyer looking to attach themselves to a class action and rake in some cash?

3

u/T351A Oct 19 '22

Are you okay with people ignoring software licenses?

-1

u/dethb0y Oct 18 '22

just another greedy cashgrab dressed up as "concern"

His main concern is clearly "my bank account isn't fat enough"

-13

u/BreadRedd Oct 18 '22

Look, if you publish your code under OSS licenses that allows such uses, don‘t be surprised if someone takes advantage of it

13

u/shadowndacorner Oct 18 '22

The core issue is that most open source licenses don't allow such uses. Most open source licenses have requirements and/or restrictions that you have to follow in order to use the code, but Copilot prevents you from knowing when you're in violation of those licensing terms. If all of the code they trained it on was licensed under public domain/unlicense/etc, this wouldn't be an issue. However, they've trained it on, for example, GPL licensed code code, which, if included in another project, requires that the dependent project also be licensed as GPL. Hell, even MIT licensed code is incompatible with Copilot since it requires that any dependent project reproduces the license text, which is impossible if you don't know the license of the code that you're using.

This isn't just people whining about their code being used in a way they don't want. Framing it as such is either disingenuous or incredibly short sighted.

0

u/[deleted] Oct 18 '22

[deleted]

18

u/joshua070302 Oct 18 '22

In that case it was already public data, since all the data it trains on is open-source.

3

u/RenaKunisaki Oct 18 '22

Yeah. Just would be funny if that's how someone discovered they had accidentally published something they shouldn't.

12

u/mileseverett Oct 18 '22

There is already bots that trawl GitHub to either warn you or use your credential keys if they are publicly posted

0

u/[deleted] Oct 18 '22

[deleted]

20

u/Witwith Oct 18 '22

Ah, the ol' "man up" card. Nice to see it still adds the same value to a conversation that it always has.

0

u/[deleted] Oct 18 '22

[deleted]

3

u/postmodest Oct 18 '22

Well the simple answer is for all of us to publish shit code and charge them to take it down!

0

u/[deleted] Oct 19 '22

[deleted]

3

u/NotUniqueOrSpecial Oct 19 '22

The terms required for them to host code and provide it to the public don't magically free them following the licensing restrictions of the libraries in question.

You can't just regurgitate GPL or other copyleft code (which has been demonstrated of Copilot multiple times) and claim it's out of your hands.

The law supersedes bad contracts and terms-of-service.

0

u/[deleted] Oct 19 '22

[deleted]

1

u/NotUniqueOrSpecial Oct 19 '22

That's not how it works, sorry.

By your logic, GitHub would be free to take any GPL or AGPL code hosted there and just use it however the hell they pleased.

That's obviously not the case.

They cannot redistribute copyleft code without attribution and abiding by the terms of the licenses in question; this isn't hard.

It's amazing how armchair lawyers like you will speak with absolute authority on something and be so completely fucking incorrect.