Are neural nets (the weights file) copyrightable?

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

Moderators: hgm, Rebel, chrisw

syzygy
Posts: 5566
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 1:19 am
syzygy wrote: Sat Feb 27, 2021 1:10 am
gonzochess75 wrote: Sat Feb 27, 2021 1:06 am - when distributing an SF executable that is modified to load the FF2 NNUE net (and many other nets with the same format), both the executable and the net file specifically intended to act as an extension of and be combined with SF must be released under the GPLv3. It is fine to include the FF2 NNUE net in the same zip file provided it is also licensed in a GPL-compatible manner.
And the FF2 NNUE net and not any other NNUE net because we know that that was the plan all along, I suppose?

Obviously it would be fine for anyone else to distribute a non-GPL NNUE net that is compatible with SF13, or with FF2-SF for that matter. (Still assuming that NNUE nets are copyrightable.)
Not just the FF2 net. Any net that is distributed with SF for the express purpose of being used by SF as an NN weights file. Same is true of Lc0 and Allie as I just said to Dann. These weights files - if they are copyrightable - are by their nature extensions of and combined with GPL'd engines to form a larger work. Hence they need to be licensed in a GPL compatible way.
What do you mean by "distributed with SF"? What if they are separately downloadable?
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 »

Dann Corbit wrote: Sat Feb 27, 2021 1:25 am
gonzochess75 wrote: Sat Feb 27, 2021 1:21 am
Dann Corbit wrote: Sat Feb 27, 2021 1:20 am If a GPL program reads movies from a database into its memory, do the movies become GPL?
Is it otherwise somehow illegal to read these movies into RAM using a GPL program because you are voiding their license?
Are the movies read into RAM by their nature extensions of the covered work? Are they being combined with the covered work to form a larger program?

Notice the pattern...
If data is code (as you clearly stated in a previous argument) then yes, and yes.
Then we disagree.
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

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

Post by Dann Corbit »

gonzochess75 wrote: Sat Feb 27, 2021 1:29 am
Dann Corbit wrote: Sat Feb 27, 2021 1:25 am
gonzochess75 wrote: Sat Feb 27, 2021 1:21 am
Dann Corbit wrote: Sat Feb 27, 2021 1:20 am If a GPL program reads movies from a database into its memory, do the movies become GPL?
Is it otherwise somehow illegal to read these movies into RAM using a GPL program because you are voiding their license?
Are the movies read into RAM by their nature extensions of the covered work? Are they being combined with the covered work to form a larger program?

Notice the pattern...
If data is code (as you clearly stated in a previous argument) then yes, and yes.
Then we disagree.
That is totally fine, and my opinion is no better than anyone else's.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
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 1:28 am
gonzochess75 wrote: Sat Feb 27, 2021 1:19 am
syzygy wrote: Sat Feb 27, 2021 1:10 am
gonzochess75 wrote: Sat Feb 27, 2021 1:06 am - when distributing an SF executable that is modified to load the FF2 NNUE net (and many other nets with the same format), both the executable and the net file specifically intended to act as an extension of and be combined with SF must be released under the GPLv3. It is fine to include the FF2 NNUE net in the same zip file provided it is also licensed in a GPL-compatible manner.
And the FF2 NNUE net and not any other NNUE net because we know that that was the plan all along, I suppose?

Obviously it would be fine for anyone else to distribute a non-GPL NNUE net that is compatible with SF13, or with FF2-SF for that matter. (Still assuming that NNUE nets are copyrightable.)
Not just the FF2 net. Any net that is distributed with SF for the express purpose of being used by SF as an NN weights file. Same is true of Lc0 and Allie as I just said to Dann. These weights files - if they are copyrightable - are by their nature extensions of and combined with GPL'd engines to form a larger work. Hence they need to be licensed in a GPL compatible way.
What do you mean by "distributed with SF"? What if they are separately downloadable?
Is the person with copyright of the net hosting a copy of SF for download with the express purpose to combine the two into a larger work? Note: hosting for download is a form of distribution that as a right is exclusively held by the copyright owner.

Also, look at this relevant language in the GPL from the same section that we've been talking about:
You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged.
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 »

Alayan wrote: Sat Feb 27, 2021 1:28 am
Michel wrote: Fri Feb 26, 2021 2:40 pm As I understand it you cannot distribute a GPL'ed program unless you abide by its license (obviously). The GPL prohibits distributing a GPL'ed program together with a program which does have a GPL incompatible license if the two together constitute a modification of the original program (so that the precise aggregation exception does not apply).

So ChessBase can obviously distribute the NNUE net under a non-freely distributable license (assuming this is possible for a NN), but it cannot distribute it with SF as a unit, since this goes against the license of SF.
I agree, I have come to this conclusion too.

By this standard, Chessbase is still violating the copyright of Stockfish authors.
gonzochess75 wrote: Fri Feb 26, 2021 11:13 pm Can Disney tell ViacomCBS that they can redistribute Star Wars all they want in exchange for ViacomCBS granting Disney the right to redistribute Star Trek?

Can that deal be made?

If ViacomCBS refuses and says that's unfair since Star Trek is not a derivative work of Star Wars does that mean that ViacomCBS some how automatically gets the right to distribute Star Wars?
This has been ignored, but makes the point very eloquently.
Thanks :) A stopped clock is still right twice a day!
Alayan
Posts: 550
Joined: Tue Nov 19, 2019 8:48 pm
Full name: Alayan Feh

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

Post by Alayan »

syzygy wrote: Sat Feb 27, 2021 12:44 am If you distribute a compiled SF separately from an NNUE net specifically designed for SF (e.g. the two in a zip file), I don't see how this would force you to distribute the NNUE net under the GPL (assuming there is copyright on the NNUE net).
In this scenario, if you don't distribute the NNUE net under a GPL-compatible license, then you violate the terms of the license granted to you by the SF authors. You still have rights to that NNUE net, you can still distribute it if you want, but you lose the rights to distribute Stockfish (or you modified version of it) alongside.

Hence:
Of course the starting point here would still be the FF2 NNUE net, which doesn't contain any copyrightable expression from SF.
It is irrelevant if the FF2 NNUE net itself contains copyrightable expressions from SF. This means that Chessbase has the right to distribute the net itself.

But they can distribute Stockfish only if they abide by the requirements put forth in the license they were granted ; and distributing the proprietary FF2 net alongside with their modified Stockfish binaries violates these requirements, so they don't have the rights to distribute the modified Stockfish binary in this situation.
syzygy
Posts: 5566
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 1:34 amIs the person with copyright of the net hosting a copy of SF for download with the express purpose to combine the two into a larger work? Note: hosting for download is a form of distribution that as a right is exclusively held by the copyright owner.
So it would be fine for the legal entity Chessbase to host the FF2 NNUE net as long as some other legal entity hosted FF2-SF?
You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged.
[/quote]
Well, the "entire work" is the source code necessary to build the FF2-SF executable.
syzygy
Posts: 5566
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 1:40 am But they can distribute Stockfish only if they abide by the requirements put forth in the license they were granted ; and distributing the proprietary FF2 net alongside with their modified Stockfish binaries violates these requirements, so they don't have the rights to distribute the modified Stockfish binary in this situation.
That's like saying a GPL'd image viewer modified to display a new image format cannot be distributed if the author of the modified version distributes non-GPL'd images in that new format.

It is clear to me that FF2-SF is an independent complete work. That it will crash if you type "go" without first loading a compatible NNUE net is irrelevant. Distributing it under the GPLv3 means you also need to distributed the relevant source files under the GPLv3.
Alayan
Posts: 550
Joined: Tue Nov 19, 2019 8:48 pm
Full name: Alayan Feh

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

Post by Alayan »

Comparing the role of a NNUE net in Stockfish and the role of a movie in a movie viewer or of a picture in a picture editor is misguided.

I have seen this argument many times this week (mostly by dkappe), and I have been dumbfounded that it has been entertained as legitimate.

The purpose of a video player is to play video files. A specific video file is in no way essential to it. If you don't have it bundled with the video player, it doesn't affect the functionality of the video player in any way.

The purpose of Stockfish is to find strong chess moves and to evaluate positions. The NNUE network used for this is absolutely essential to this process. It strongly affects the functionality of Stockfish. The network and Stockfish function together as a unit. Arguing they don't is like arguing that the legs and the brain of a walking human are unrelated and independent.

Regarding specifically FF2, it's particularly obvious:
gonzochess75 wrote: Thu Feb 25, 2021 4:07 pm So again the only relevant question is whether SF + NN weights file is a combined work or not. Here is some evidence that they are indeed a combined work whether or not the weights file is separated on the file system:

1) Albert Silver modified the SF source files to include *himself* as an author. If he didn't believe they were a combined work, then why the hell would he do this?

2) Albert Silver and Chessbase *renamed* SF and the weights file to be the same name - FatFritz2 - and marketed them as a combined work.

3) The weights file was developed for and tested against SF and no other engine and was intended from the very beginning to be combined with SF and no other engine in its distribution. It is not as if the weights file was developed in a clean room and only at the very end Albert Silver and Chessbase had the miraculous idea, "Hey you know what would *really* make this weights file shine?? Let's include it with an arbitrary chess engine!"

4) The weights file is ABSOLUTELY USELESS without SF. Chessbase could have decided to just sell the weights file and not include a copy of SF and let their own customers figure out how to combine the two, but they didn't. Why? Because it would have been useless without SF and they knew it.

5) Here is a quote from Albert Silver himself proving that he intended them and still intends them as a combined work:
"I did it because, one, the neural network is unusable in any other environment, and the second reason is this was what Stockfish was doing, this was standard procedure," explains Silver.
6) The fact that he had to modify SF sources at all is evidence they are a combined work. If they were really two separate works not intended to be combined, then why did he have to modify SF sources to make them work well together?

7) The purported sources that were released on github had "FF2" as the branch name for an SF github repository. If they are not a combined work - both the SF and FF weights file, then why was the former renamed in a branch to match the latter?

If there is any actual litigation in Chessbase and AS future over what they've done I would be very surprised if that quote and the patch where he modifies *the GPL'd SF source code* to include himself as an author doesn't prove dispositive. It defies incredulity to say that CB and AS did not intend their weights file to be a combined work with SF. All the history of what they've done up to this point clearly points to their intention that they be a combined work.
syzygy
Posts: 5566
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

http://www.rosenlaw.com/GPLv3-Comments.htm
Lawrence Rosen wrote:More broadly to my satisfaction, though, the GPLv3 license contains clearer language that will encourage its software to be used in “aggregations” (what in United States law we call “compilations” or “collective works”) that include many independent works. Computer professionals will better understand these independent works as modules of code, so I’ll use that word instead. As long as those modules are independent works under copyright law, and as long as their own independent licenses allow this to be done, verbatim copies of those modules can be combined to build larger systems of increasing sophistication and breadth. GPLv3, as I now read Draft 4 the license, allows that.
(Note that the relevant text of draft 4 corresponds to the current text.)

So, according to Lawrence Rosen, what matters is that the individual components/modules are independent works under copyright law.

It is beyond doubt that the FF2-SF executable is an independent work under copyright law.
And if an FF2 NNUE net is copyrighted then it, too, is an independent work under copyright law.
So, according to Lawrence Rosen, a compilation of the two is an "aggregation".

(Still, I struggle to see how compliance with condition c) would be impacted by distributing a collection of separate works, only some of which are GPLv3, that is somehow not an "aggregation". The "covered work" in the aggregation paragraph would seem to be the same as "the entire work", so c) requires only that the "covered work" is distributed under the GPLv3.)
A guy called Ed wrote:I don't agree with this argument because the combination would be possible not just with Apache licensed code, but with code covered by any license, even proprietary, closed source code. I don't think RMS (Richard Stallman) would agree either. To this, Larry replied:

He doesn't. But he wrote GPLv3 and he must now live by the words in his license.