News for hackers. Stuff that matters.
Re:What Copilot means for open source by mcbuilder on Saturday June 25, 2022 @05:58PM (#31879070)
> Rather than conceal the licenses of the under­lying open-source code it relies on, it could in prin­ciple keep this infor­ma­tion attached to each chunk of code as it wends its way through the model.

I don't know if the author understands how these transformer models work, but this would a impossible task in Byzantine complexity. The way these models work is by outputting a probably distribution of likely "token" embeddings given an input prompt. The output involves basically inverting a word2vec (probably beefed up with programming language keywords and other bells and plausible search techniques I don't have access to the details of).

This model was of course trained with real code, but you can't attach to the output any meaningful information from the gradient you get from the sample. It's a very messy computation to even think to write down (attaching a percentage that 1 training example affected 1 particular output), much less come up with a simple interpretation of.

Re:What Copilot means for open source by gus_massa on Saturday June 25, 2022 @06:14PM (#31879180)
There is a problem because some licenses require attribution, but ignoring that...

You can make a model that is trained only with BSD and MIT code, and IIRC/IIUC the result can be used with any license, including proprietary code.

You can make a second model that is trained only with BSD, MIT and GPL2 code (and perhaps GPL2+), and IIRC/IIUC the result can be only with GPL2 code.

You can make a third model that is trained only with BSD, MIT and GPL2+ and GPL3 code, and IIRC/IIUC the result can be only with GPL3 code.

AGPL, Apache, WTFPL, ... Just add them to the correct model or create a new model for them.

Re:What Copilot means for open source by q-big on Saturday June 25, 2022 @06:39PM (#31879323)
> You can make a model that is trained only with BSD and MIT code, and IIRC/IIUC the result can be used with any license, including proprietary code.

BSD and MIT license still require attribution of the used source code (there exists a MIT No Attribution License, though: https://en.wikipedia.org/w/index.php?title=MIT_License&oldid...).

Re:What Copilot means for open source by mbreese on Saturday June 25, 2022 @08:17PM (#31879863)
> BSD and MIT license still require attribution of the used source code

Which in this scenario could be accomplished by starting that “this software contains algorithmically generated code that was trained using MIT derived code from X, Y, and Z.

This attribution list would be very long, but it could be done.

I think the interesting thing here would be to compare the generated code with the original training data after the fact. If the generated code does not already exist (with some degree of similarity), then it would be okay to use. Otherwise, if it did already exist, you’d then need to attribute the authors of the chunk of code — which you’d now know.

I’m not discounting the hurdles involved, but there might be ways to overcome them.

Re:What Copilot means for open source by jimmySixDOF on Saturday June 25, 2022 @08:23PM (#31879889)
Whats to stop them from just making a huge attribution page with every possible instance and a vague statement like "the following may or may not have been incorporated in part or in whole" ?
Re:What Copilot means for open source by jacobolus on Saturday June 25, 2022 @08:52PM (#31880034)
They’d be gambling that such a crummy attribution would hold up in court. Generally judges aren’t too amused by people’s efforts to find wacky loopholes that make a mockery of the law.

On the other hand, open source licenses haven’t been tested thoroughly in court, so maybe the result would be to throw out such attribution requirements entirely. The main relevant case to date is https://en.wikipedia.org/wiki/Jacobsen_v._Katzer

Re:What Copilot means for open source by wolpoli on Saturday June 25, 2022 @07:02PM (#31879447)
Great. Now developers will need to check license compatibility before picking the copilot model.

In reality through, we'll all just end up using the MIT No Attribution License copilot.

Re:What Copilot means for open source by q-big on Saturday June 25, 2022 @07:27PM (#31879589)
Developers already have to check license compatibility. If copilot implemented such a feature, this would just represent the status quo.
Re:What Copilot means for open source by xigoi on Sunday June 26, 2022 @04:37AM (#31882148)
> In reality through, we'll all just end up using the MIT No Attribution License copilot.

Great, so GPL code would be left alone. I don't see how that's a bad thing.

Re:What Copilot means for open source by winety on Saturday June 25, 2022 @06:42PM (#31879339)
> There is a problem because some licenses require attribution, but ignoring that...

Surely the solution would be to give credit to every author from the training corpus. I am looking forward to the 10 000 lines of copyrights in every header. :P

If Microsoft had trained it on its own code, there would be no such problems. Surely a company as large as Microsoft has produced enough code over the years to create a large enough training dataset.

Re:What Copilot means for open source by ShamelessC on Saturday June 25, 2022 @07:44PM (#31879694)
> If Microsoft had trained it on its own code, there would be no such problems.

I keep seeing this sentiment from the GPL/"laundering" side of the debate.

Believe me, Microsoft wouldn't have released this thing (after what, 6 months of beta testing?) if they thought they had any "problems" at all.

I'm not saying I don't sort of agree with you, but is there no room for what's actually _likely_ to happen in this debate? Because as best as I can tell, they aren't going to see any real legal issues from this.

(There's also an option to remove generations that result in a collision with actual GitHub code, just fyi)

I feel like when the singularity happens HN is going to be flooded with programmers mad that they got automated away despite it very much being one of the primary goals of computer science and software engineering. This stuff is a kind of just a fact of life now.

Salesforce trained models (on GitHub) competitive with copilot without needing to own GitHub. I would spend less time worrying about how to lawyer up and more time figuring out how you're going to adapt to these new tools. That's the gig.

Re:What Copilot means for open source by belorn on Sunday June 26, 2022 @06:13AM (#31882565)
Microsoft made a bet that releasing Copilot will mean more profits than the legal issues might cost them. This doesn't mean anything if there is or isn't a problem with it.

The simply way to test the legal theory behind copilot would be to write a AI that write music notes, using music scraped from youtube or any other large music library. The idea that one can train on "public available material" and produce algorithms that output large chunk of copyrighted material is a bit untested in court, but go against the wrong target and we will quickly see a response. We have actually seen some traces of this with news bots that scrapes news site and produce "novel" interpretation of existing news, especially sports news.

Re:What Copilot means for open source by ShamelessC on Sunday June 26, 2022 @06:47AM (#31882701)
This is what I'm talking about. Are we commenting on a news report of someone actually doing what you're describing - filling a suit or legal action of any kind against MS for this?

No, we're not. Further, Amazon just announced a similar product and Salesforce has literally _released weights_ for their code models. You can't put the genie back in the bottle.

Actually enforcing any action when the representations are learned rather than hard-coded just seems impossible to me. They have a check box that removes any predictions matching existing code - that basically makes it impossible to discern the source since this will be based on some subjective "semantic closeness" BS.

Re:What Copilot means for open source by Ygg2 on Sunday June 26, 2022 @07:48AM (#31883107)
> Believe me, Microsoft wouldn't have released this thing (after what, 6 months of beta testing?) if they thought they had any "problems" at all.

They would. Did you just forget TAI? Microsoft didn't consider 4chan would train her to be the ultimate racist.

Re:What Copilot means for open source by iostream24 on Sunday June 26, 2022 @03:43AM (#31881930)
As you mentioned “WHEN the singularity happens” as an article of religious faith, followed by a vast leap of faith in proposing no-code tools taking over programming, I’m afraid that you adapting to the reality on the ground will be the difficult part here, rather than the lack of adaptation by programming writ large.

Do you work in marketing? Do you program?

Re:What Copilot means for open source by ShamelessC on Sunday June 26, 2022 @06:22AM (#31882597)
I'm only somewhat certain that the singularity is inevitable (and obviously my predictions aren't worth betting on anyways) - sorry for using poetic language.

I'm a machine learning engineer, amateur researcher and open source contributor. Before that I was a software engineer for 8 years.

Re:What Copilot means for open source by ninjin on Sunday June 26, 2022 @02:55AM (#31881751)
It does not matter whether Matthew understands how transformer models work. He does understand that legally this is looking messy – or “foggy”, in his words.

As a person that teaches and conducts research with these models, there is no reason why a tool like Copilot has to be a purely parametric, generative transformer like GPT-3. Where attribution, as you describe it, is nearly impossible.

For example, if the model was to use a retriever component to obtain specific pieces of concrete code from a database (where the licensing for each piece is known) conditioned on the original source code context; then generate its output based on this, the context in your source code, and pre-trained parameters, then it could theoretically at least satisfy Butterick’s request and probably be more akin to how a human programmer operates.

This still does not rule out possible legal issues entirely as the pre-trained parameters are opaque, but it certainly makes it less problematic.

Alternatively, there is active research on attributing a given output to a transformer’s training data. But it is still very early days and frankly it is very “foggy” as to what degree this can be done.

Lastly, I have seen a bunch of comments elsewhere alluding to it being somehow sufficient to reduce the level of verbatim copying. Sadly, it will not, as even if you for example replace the variable names it is still a copyright violation. Just like if you manipulate the RGB space slightly for an image. Determining fair use, etc without a license is something that today can only be done in court, regardless of how we of a heavier technical disposition may feel about it. After all, that is exactly why we have explicit licenses in the first place!

Re:What Copilot means for open source by Brian_K_White on Saturday June 25, 2022 @06:29PM (#31879267)
As much as I hate the entire concept, I would have a hard time articulating a substantive difference between this description of the ai mixing together bits of stuff it saw and what I do myself when I'm writing something that I fully describe as mine.
Re:What Copilot means for open source by alpaca128 on Saturday June 25, 2022 @07:13PM (#31879518)
You probably don't sell code snippets that you collected from various sources you can't remember without knowing whether you're even allowed to sell some of them.

That's what Copilot does with extra steps. I don't see why it should be different just because Microsoft mixed the code snippets in a blender to obscure what they're doing. It's code laundering.

Re:What Copilot means for open source by disconcision on Saturday June 25, 2022 @07:44PM (#31879693)
just trying to make the comparison more precise:

using copilot is like subcontracting to a company who you know has no institutional qualms about their employees liberally copy/pasting from a known corpus of github repos. you know these employees don't always literally copy/paste, but all they do every day is read the corpus, so their code is always going to be basically derivative. you can optionally ask that the company avoids matches to existing code, which you know means that before sending you the code, the boss will fuzzy search their code against the corpus, asking their employees to write it again if a match is found.

so given that this is the way the company works, and that you know this is the way they work, your task is to decide what your ethical and legal liabilities are.

Re:What Copilot means for open source by chii on Sunday June 26, 2022 @05:21AM (#31882349)
> You probably don't sell code snippets that you collected from various sources you can't remember without knowing whether you're even allowed to sell some of them.

actually i'm sure you do, you just don't think of it this way. The education you received to learn to code would consists of such snippets and examples. Then you sell your skill as a programmer, which consists of you recalling past experience and knowledge, and transform that into the final piece of code.

Copilot is merely doing something like that, but way less sophisticated than a human brain.

Re:What Copilot means for open source by Brian_K_White on Tuesday June 28, 2022 @12:07AM (#31903970)
This. Sure I synthesize, but everything I synthesize is made out of stuff that came from somewhere. If the "snippets" are small enough, they become no different than me consulting the man page for a function.

I think this will require looking at some actual examples to try to judge, and figure out how to articulate the basis for the judgement.

Hm. That begs the question what good is it if it deals in such small bits? I guess that means if the snippets are large enough to be of any value at all, then they are automatically big enough to be damning.

Re:What Copilot means for open source by giovannibonetti on Saturday June 25, 2022 @07:34PM (#31879634)
"code laundering" is genious!
Re:What Copilot means for open source by amelius on Saturday June 25, 2022 @07:04PM (#31879468)
The difference is that the AI is doing it on a much larger scale.

Analogy: the law has no problem with you memorizing the license plates of cars you see as they pass your street; however, building an automated system for recording and storing license plates in a database is a different story.

Re:What Copilot means for open source by flohofwoe on Sunday June 26, 2022 @05:06AM (#31882285)
Why not simply split the input training data into a separate "license sets", and then train on them separately? Instead of one Copilot you'd have a "GPL Copilot", an "MIT Copilot", and "BSD Copilot" and so on and so forth, at least this would simplify the burden that's currently put on the user.

Attribution would still be a problem though. How to attribute generated code that's a random mishmash from thousands of inputs? The only solution can be to attribute all of them by doing some sort of reverse match. This "IP scanning" must clearly also be provided by Copilot and not be offloaded to the user.

TBH I would have expected that the "evil geniuses" who came up with Copilot would have thought about such obvious pitfalls beforehand. It's not much of an achievement to innovate by ignoring the law.

Re:What Copilot means for open source by mnd999 on Saturday June 25, 2022 @07:50PM (#31879728)
The model itself is a derivative work of GPLed code and thus should itself be open sourced. Granted by the time it’s spat out it’s probably an unreadable binary blob but it would be nice to have access to it for GPLed projects.
Re:What Copilot means for open source by mbreese on Saturday June 25, 2022 @08:25PM (#31879895)
I’m not sure about the vitality of GPL here.

Assuming the generated code does not exist and is not part of the training set (these are two giant caveats), how would this be different from me reading GPL code to learn how to do something, and then rewriting it in my own words?

If I have not copied, but learned from GPL code, is my new code GPL? No, it’s not a derived work in terms of copyright. Am I standing on the shoulders of giants? Yes. But so long as that concept is expressed in a novel way (not just changing variable names), then it isn’t a derivative work.

I haven’t worked with copilot at all to know how verbatim the results are, but it is theoretically possible to train a model with GPL code and not get GPL code generated out the other side. (Again, here be dragons).

Re:What Copilot means for open source by jen20 on Saturday June 25, 2022 @10:50PM (#31880665)
> how would this be different from me reading GPL code to learn how to do something, and then rewriting it in my own words?

No different - that is also not allowed. The idea of clean room reverse engineering exists exactly for this reason.

Re:What Copilot means for open source by nathanielarmer on Saturday June 25, 2022 @11:46PM (#31880881)
Do you have a source for that claim?

My understanding is the GPL based on copyright - and that copyright only protects a specific expression, not a general idea or concept. To suggest that if something is copyrighted, humans cannot learn from it and generate thier own material seems to be absurd.

Re:What Copilot means for open source by omegalulw on Saturday June 25, 2022 @06:52PM (#31879393)
There are much simpler solutions than that. Simply invest or reuse plagiarism models and tag output snippets to source repositories. You can either exclude this code or let the users know it's licenced code.
Re:What Copilot means for open source by withinboredom on Saturday June 25, 2022 @06:08PM (#31879140)
Unless the model is truly coming up with something novel, there is something in it's training set that is truly similar, if not precisely the output. It should say so when that is the case, and should also say whether or not the output is novel. I'm sure GitHub could provide an API for searching code snippets, if they don't already.
Re:What Copilot means for open source by mcbuilder on Saturday June 25, 2022 @06:19PM (#31879204)
Yes, but Co-Pilot is more like a system that has spent a lot of time learning from open source code but it has the logical reasoning ability of that code of the 12-year old who just learned about the problem yesterday that the author mentioned.

But will it be capable of generating a copyright infringement? Let's imagine I want to implement an algorithm to find the shortest path between nodes in a graph. Well I remember from my MSc that you probably need to implement it with Dijkstra's algorithm, and I've implemented this a few times over the years in kata and leetcode. Now let's say I'm programming Rust, which I don't really know the syntax for so I go read some GPL code while browsing the net for syntax.

Do I need to state that my implementation of Dijkstra's algorithm is 10% GPL, because I spent a few minutes reading syntax of a GPL file? What if someone else's copyrighted code looks 90% similar to mine, because hell there's only so many ways to implement it, can I get sued because there is 90% overlap and I might have looked at this code?

These systems aren't even capable yet of generating more than a a few functions, much less a coherent library. Even then, as they generalize more and gain more expressive power they will be less likely to copy in the training data to the output now, a possibility that I consider quite remote even given a relatively primitive Co-Pilot.

Re:What Copilot means for open source by belorn on Saturday June 25, 2022 @09:34PM (#31880252)
Describing an artificial intelligence algorithm as a 12-year old is a bit like describing advanced technology as magic. It kind of works as a way for people to related to it. It stops working however as soon someone start to unravel how they actually function, and at some level we understand that neither true AI or magic exist. It is just an illusion.

When you write your implementation of Dijkstra's algorithm then you hopefully using human intelligence to write it, not an illusion of intelligence. If its original then its 0% of whatever GPL file you happen to have read at a previous date. If you copy something verbatim without using human intelligence, then its 100% GPL.

True artificial intelligence == magic. if not magic then math.

Re:What Copilot means for open source by withinboredom on Saturday June 25, 2022 @07:03PM (#31879461)
Yeah, you do have to obey the terms of the license if you base it on someone else’s code even if it “is the only way to implement it.” Even if it is only a single line.

At least according to Google’s monetization policy when it comes to music.

Re:What Copilot means for open source by zarzavat on Saturday June 25, 2022 @09:36PM (#31880267)
No, you do not. Copyright protects creative expression. If there is only one way to do something, or only one good way to do something, then there is no creativity and hence no copyright.

In particular an algorithmic concept cannot be copyrighted but a description of an algorithm in code can be. I think that many programmers believe that the algorithm is the copyrightable bit because that is the “hard part” compared to say the variable names and comments which are the easy part. But copyright cares much more about the latter than loops and conditionals, which have much less creative value. Mathematical expressions cannot be copyrighted.

Re:What Copilot means for open source by moyix on Saturday June 25, 2022 @06:18PM (#31879202)
They're currently doing this automatically for catching exact matches, and you can turn on a setting that will suppress any suggestion that was found verbatim in the training data.

But of course this wouldn't catch copies where variable names have been changed, etc. One thing that I think would be really interesting (but hideously computationally expensive) is to compute an embedding of each chunk of the training data and then query for the k nearest neighbors when Copilot generates some code, so you can see what the closest snippets in the training data are and evaluate for yourself if they're too similar.

Re:What Copilot means for open source by amelius on Saturday June 25, 2022 @07:02PM (#31879449)
That's no excuse. Attach all licenses if necessary.
Re:What Copilot means for open source by sodality2 on Saturday June 25, 2022 @07:05PM (#31879470)
And if the license terms conflict?
Re:What Copilot means for open source by amelius on Saturday June 25, 2022 @07:07PM (#31879480)
Then you should have built two (or more) different non-conflicting models.
Re:What Copilot means for open source by Gigachad on Saturday June 25, 2022 @09:10PM (#31880135)
Do you attach the licenses for every project you have ever looked at and learned something from? Do you switch learning modals when you use a MIT project?
Re:What Copilot means for open source by amelius on Sunday June 26, 2022 @07:25AM (#31882959)
Perhaps I should. And if I built a product around copying other people's code, then I definitely should!
Re:What Copilot means for open source by charcircuit on Saturday June 25, 2022 @07:28PM (#31879598)
It's not impossible. Amazon's CodeWhisperer is already able to tell you the license of code if what it generates is close to existing code.
Re:What Copilot means for open source by treesprite82 on Saturday June 25, 2022 @11:13PM (#31880761)
What's described as impossible is "[keeping the license] attached to each chunk of code as it wends its way through the model".

Checking generated code for similarity against training set is possible, and is now done by both Copilot and CodeWhisperer. But it'll include code that just happens to be similar, even if that code had no influence on what the model generated.

Re:What Copilot means for open source by jamal-kumar on Saturday June 25, 2022 @08:25PM (#31879898)
I wasn't aware that Amazon was developing something similar, how does it compare in terms of usefulness?

I was finding the copilot trial was pretty good at reading something like an adjacent CSV file and building out a struct with proper data types from the data in it but beyond writing CSV->DB migration stuff I didn't really use it for a lot

Re:What Copilot means for open source by groovybits on Monday June 27, 2022 @10:38AM (#31895180)