Are neural nets (the weights file) copyrightable?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

smatovic
Posts: 3346
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Are neural nets (the weights file) copyrightable?

Post by smatovic »

If you throw in code examples (source, libraries) concerning GPL then the
question if NNs are code or data is relevant, and that is not that easy to
answer. NNUE can be trained via supervised learning via scores of positions of
engine-engine games. Hence here you train the NN clearly against the evaluation
function of the engine, the score of the position, and the NN is some kind
of approximation, or whatever, of that evaluation function and someone could
conclude that this NN is code. If you train NNUE via reinforcement learning,
and not against HCE, than the question is open what this NN actually encodes,
here it is an approximation of perfect chess knowledge, chess knowledge
encoded in numbers and in this later case not copyright protectable....like
Chris already pointed out in a prev post, there is strong interest of the capital
in protecting their big data cows, so in short term I am pretty sure we will
see copyright protection on NNs, in the long run I guess we will revert that,
cos science has a problem with copyright on a set of numbers.

--
Srdja
gonzochess75
Posts: 208
Joined: Mon Dec 10, 2018 3:29 pm
Full name: Adam Treat

Re: Are neural nets (the weights file) copyrightable?

Post by gonzochess75 »

chrisw wrote: Sat Feb 27, 2021 5:32 pm
Alayan wrote: Sat Feb 27, 2021 4:14 pm An analogy to consider the problem differently:

Imagine there is a law saying "chemical compound X can only be distributed alongside chemical compounds that do not explodes when mixed with X", in order to ensure safety.

Chemical X explodes when mixed with chemical Y. No law restricts the distribution of Y itself.

You can't distribute X and Y together by arguing "if I take X alone, it doesn't explode! So here is my right to distribute X. I also have the right to distribute Y as there is no restriction on it. So I add the two rights, and I have the right to distribute X and Y next to each other!".

FF2 net + SF-binary go boom when you put them together. :mrgreen:
Yes, but. Terms like “no distribution to brown people” are going to fall on discrimination law and would unenforceable. Terms like “no unsafe distribution” are not really “terms” they’re a way of a) ensuring the licensor is not going to be held accountable by dumb acts of distribution and b) a safety warning.

Terms like “you can’t distribute it with something else XYZ” may well fail on competition and/or trading law.
I got all these CD-ROMs of Xs and all these Ys and I can’t sell them because of lack of demand, so I bundle them together (maybe plus A, B and C) and sell them all off cheap. Is that going to be unlawful because of some GPL license?
In all those cases the copyright license is null and void. Importantly, that does not mean that the grantee of such an unlawful license gets permission to copy, distribute, modify the work purportedly covered by the unlawful license. If the license is null and void, then the copyright rights remain with the holder of the copyright.

To see this, again consider what would happen if Disney said to ViacomCBS, "Hey, I grant you license to redistribute Star Wars if the CEO of your company sells his first born son to our CEO." No court would allow that. However, it does not mean that ViacomCBS would then have permission to redistribute Star Wars.
chrisw
Posts: 4639
Joined: Tue Apr 03, 2012 4:28 pm
Location: Midi-Pyrénées
Full name: Christopher Whittington

Re: Are neural nets (the weights file) copyrightable?

Post by chrisw »

smatovic wrote: Sat Feb 27, 2021 5:39 pm If you throw in code examples (source, libraries) concerning GPL then the
question if NNs are code or data is relevant, and that is not that easy to
answer. NNUE can be trained via supervised learning via scores of positions of
engine-engine games. Hence here you train the NN clearly against the evaluation
function of the engine, the score of the position, and the NN is some kind
of approximation, or whatever, of that evaluation function and someone could
conclude that this NN is code. If you train NNUE via reinforcement learning,
and not against HCE, than the question is open what this NN actually encodes,
here it is an approximation of perfect chess knowledge, chess knowledge
encoded in numbers and in this later case not copyright protectable....like
Chris already pointed out in a prev post, there is strong interest of the capital
in protecting their big data cows, so in short term I am pretty sure we will
see copyright protection on NNs, in the long run I guess we will revert that,
cos science has a problem with copyright on a set of numbers.

--
Srdja
NN is not code, it’s data, but if anyone wants to bring in code <==> data equivalence, then they have to answer the question “what code, whose is it, and where is this code?”. Can you reconstruct the specific code of a specific author and then wave it at some “original created copyright material” and claim match? Nope. There is no “code”, copyrightable or otherwise, to match. There’s no extractable copyrightable code “in” the NN.
syzygy
Posts: 5758
Joined: Tue Feb 28, 2012 11:56 pm

Re: Are neural nets (the weights file) copyrightable?

Post by syzygy »

Alayan wrote: Sat Feb 27, 2021 4:02 pm
syzygy wrote: Sat Feb 27, 2021 2:52 pm Everything starts with the copyright law question which permissions I need. The permission I need is the permission to distribute FF2 SF. So I invoke the GPLv3 to obtain permission for distributing the entire covered work "FF2 SF" (as part of a zip file), not for distributing the zip file as a whole (of which only FF2 SF is protected by the SF copyright).

The wording of the GPLv3 may allow one to consider the zip file to be a "work based on SF", but I have already covered my copyright needs by invoking the GPLv3 with FF2 SF as the "work based on SF".

And certainly it makes more sense to invoke the GPLv3 on FF2 SF, as this is the derived work that undisputably is protected by the SF copyright. The zip file itself is not a derived work, it merely contains one. (And there are commentators suggesting that "work based on SF" is nothing else than "derived work".)
No. It doesn't work like this.

By default, you have no redistribution rights at all.
I have explained that I am getting my distribution right from the SF's authors through my GPLv3 license on SF, which gives me the right to distribute FF2 SF under conditions with which I am complying. This distribution right suffices to distribute the zip file.

I am know what I am talking about. I have carefully studied the precise wording of the license, and I have explained everything already.
syzygy
Posts: 5758
Joined: Tue Feb 28, 2012 11:56 pm

Re: Are neural nets (the weights file) copyrightable?

Post by syzygy »

gonzochess75 wrote: Sat Feb 27, 2021 4:03 pm syzygy, I am really trying to understand your position. This hypothetical is not meant as an attack I just want to understand how you'd handle it. Let's forget dynamic linked libraries, whether an NN is data or code, whether an NN weights file is even copyrightable (which we agree on!) etc, etc.

Let's say an enterprising programmer has a brilliant idea for improving Stockfish. The embodiment of the idea would look like this:

1. Stockfish sources verbatim copied with a one line diff that changes the name of one function call from "search" to "mysearch"

2. A new file called mysearch.cpp which is entirely copyrighted by the enterprising programmer. It contains ZERO code from anything else in Stockfish or from any other copyrighted work in existence and is novel, original, brilliant and in all other ways THE AWESOME.
So he can distribute the modified SF source under the GPLv3 and he can distribute his own source file, which is an independent work, under his preferred license.

However, if he compiles this into a single executable, the executable will have to be licensed under the GPLv3 when it is distributed.
The enterprising programmer asks himself what his licensing obligations are and reads the GPL. He discovers the sections we've been arguing about endlessly. From my understanding of your position the enterprising programmer would say that he could put #1 and #2 on a CDROM and give it to someone else. Because #2 did not contain any SF code and was entirely the original work of the enterprising programmer he could choose not to make it GPL and give it a proprietary license. However, the small change he made to #1 *would* need to be licensed in a GPL compatible way.
Agreed.
Now, I clearly know that you'd disagree with this reading above ^^ but help me understand how your position doesn't lead to ^^. What is the difference? And again let's keep dynamic linked libraries, whether the NN is data or code, whether an NN weights file is even copyrightable out of it. Thanks!
I do not disagree with the reading above.
gonzochess75
Posts: 208
Joined: Mon Dec 10, 2018 3:29 pm
Full name: Adam Treat

Re: Are neural nets (the weights file) copyrightable?

Post by gonzochess75 »

syzygy wrote: Sat Feb 27, 2021 6:32 pm
gonzochess75 wrote: Sat Feb 27, 2021 4:03 pm syzygy, I am really trying to understand your position. This hypothetical is not meant as an attack I just want to understand how you'd handle it. Let's forget dynamic linked libraries, whether an NN is data or code, whether an NN weights file is even copyrightable (which we agree on!) etc, etc.

Let's say an enterprising programmer has a brilliant idea for improving Stockfish. The embodiment of the idea would look like this:

1. Stockfish sources verbatim copied with a one line diff that changes the name of one function call from "search" to "mysearch"

2. A new file called mysearch.cpp which is entirely copyrighted by the enterprising programmer. It contains ZERO code from anything else in Stockfish or from any other copyrighted work in existence and is novel, original, brilliant and in all other ways THE AWESOME.
So he can distribute the modified SF source under the GPLv3 and he can distribute his own source file, which is an independent work, under his preferred license.

However, if he compiles this into a single executable, the executable will have to be licensed under the GPLv3 when it is distributed.
The enterprising programmer asks himself what his licensing obligations are and reads the GPL. He discovers the sections we've been arguing about endlessly. From my understanding of your position the enterprising programmer would say that he could put #1 and #2 on a CDROM and give it to someone else. Because #2 did not contain any SF code and was entirely the original work of the enterprising programmer he could choose not to make it GPL and give it a proprietary license. However, the small change he made to #1 *would* need to be licensed in a GPL compatible way.
Agreed.
Now, I clearly know that you'd disagree with this reading above ^^ but help me understand how your position doesn't lead to ^^. What is the difference? And again let's keep dynamic linked libraries, whether the NN is data or code, whether an NN weights file is even copyrightable out of it. Thanks!
I do not disagree with the reading above.
Ok then.
chrisw
Posts: 4639
Joined: Tue Apr 03, 2012 4:28 pm
Location: Midi-Pyrénées
Full name: Christopher Whittington

Re: Are neural nets (the weights file) copyrightable?

Post by chrisw »

gonzochess75 wrote: Sat Feb 27, 2021 5:53 pm
chrisw wrote: Sat Feb 27, 2021 5:32 pm
Alayan wrote: Sat Feb 27, 2021 4:14 pm An analogy to consider the problem differently:

Imagine there is a law saying "chemical compound X can only be distributed alongside chemical compounds that do not explodes when mixed with X", in order to ensure safety.

Chemical X explodes when mixed with chemical Y. No law restricts the distribution of Y itself.

You can't distribute X and Y together by arguing "if I take X alone, it doesn't explode! So here is my right to distribute X. I also have the right to distribute Y as there is no restriction on it. So I add the two rights, and I have the right to distribute X and Y next to each other!".

FF2 net + SF-binary go boom when you put them together. :mrgreen:
Yes, but. Terms like “no distribution to brown people” are going to fall on discrimination law and would unenforceable. Terms like “no unsafe distribution” are not really “terms” they’re a way of a) ensuring the licensor is not going to be held accountable by dumb acts of distribution and b) a safety warning.

Terms like “you can’t distribute it with something else XYZ” may well fail on competition and/or trading law.
I got all these CD-ROMs of Xs and all these Ys and I can’t sell them because of lack of demand, so I bundle them together (maybe plus A, B and C) and sell them all off cheap. Is that going to be unlawful because of some GPL license?
In all those cases the copyright license is null and void. Importantly, that does not mean that the grantee of such an unlawful license gets permission to copy, distribute, modify the work purportedly covered by the unlawful license. If the license is null and void, then the copyright rights remain with the holder of the copyright.

To see this, again consider what would happen if Disney said to ViacomCBS, "Hey, I grant you license to redistribute Star Wars if the CEO of your company sells his first born son to our CEO." No court would allow that. However, it does not mean that ViacomCBS would then have permission to redistribute Star Wars.
This is not how the hard commercial capitalist world works.
Let’s go back to the beginning.
*if* SF was private unreleased sources and CB got hold of them and published them for profit, then you’ld be in the realms of criminal law. Police. But that didn’t happen.

SF released everything publicly with a public licence with conditions. CB publish, they have a public licence, for profit.
Now, there’s an internet aired claim, allegedly CB have not met all the licence conditions. Let’s suppose instead of this condition, CB had not met some other condition, I’ll invent one, they didn’t make some payment. They can still carry on distributing, meanwhile you have to go to court to get the payment. The point I’m trying to make it that once you got the licence you can distribute and if there’s a problem (presumably disputed) with some of the conditions, then that’s for civil lawyers and civil court to argue over. Distribution can continue.
Okay, so you say, well, SF sends CB a legal notice of licence breach and demands distribution cessation, or maybe revokes the licence specifically from CB. This would be a very dangerous move for SF, there’s as usual no damages claimable, but now CB has a potential damage claim against SF. They stopped distribution at a cost of, well, however many FFs and so on that now won’t be sold, plus reputation damage. All ticks up as time goes on. All SF downside and zero upside.

Risk-reward is catastrophic. It’s not entirely clear about the aggregation. It’s not entirely clear about copyright. Even voices in the internet could be deemed commercially damaging. No matter what side I was on, I’ld argue: just shut up. Fait accompli. You had your five minute hate on Silver/ChessBase. Done.
User avatar
towforce
Posts: 12523
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK
Full name: Graham Laight

Re: Are neural nets (the weights file) copyrightable?

Post by towforce »

syzygy wrote: Sat Feb 27, 2021 3:02 pmSo my argument is that copyright law allows me to distribute a zip file with electronic books A and B IFF I have permission to distribute electronic book A AND I have permission to distribute book B.

There may be circumstances where that's not true - but leave that - we don't want to argue about everything!

The more important point is that what CB have done is republish book A with a modified chapter 3. They're allowed to do that, but they then need to offer their new chapter 3 under the same license as the rest of the book.

Anyway, I've said this a couple of times before, but this particular dispute is actually of no practical importance.

This is a copyright question (not a GPL question), so the fact that FF2 SF and FF2 NNUE share some functional relationship does not make this different from two fully independent books.
Human chess is partly about tactics and strategy, but mostly about memory
syzygy
Posts: 5758
Joined: Tue Feb 28, 2012 11:56 pm

Re: Are neural nets (the weights file) copyrightable?

Post by syzygy »

towforce wrote: Sat Feb 27, 2021 8:56 pm The more important point is that what CB have done is republish book A with a modified chapter 3. They're allowed to do that, but they then need to offer their new chapter 3 under the same license as the rest of the book.
But that's what they do. They have released their modifications to SF.

If they had not also released their NNUE net, I think everybody would agree that there was no problem.

But some people think that if you offer SF for download on your website and you also offer your own NNUE net for download, then you MUST license that NNUE net under GPLv3 (or distributing SF would become illegal). I don't agree with that.

So this story is not even about the trivial modification to the SF source that CB made. Except that if they had not needed that modification (e.g. if SF adapted dynamically to a new net size), they would not have had to offer SF for download but could have given a link to SF's website. (They can still do that, of course, by asking someone else to host their modified SF. That would also get around the perceived problem.)
Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

Re: Are neural nets (the weights file) copyrightable?

Post by Fulvio »

syzygy wrote: Sat Feb 27, 2021 10:38 pm If they had not also released their NNUE net, I think everybody would agree that there was no problem.
I don't agree.
Let's say you pick a videogame which loads some jpg images.
You change some of the images with your owns and then you sell the modified videogame without permission.
I consider that a copyright infringment.