Are neural nets (the weights file) copyrightable?

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

Moderators: hgm, Rebel, chrisw

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: Thu Feb 25, 2021 1:58 am The GPL and its FAQ may or may not suggest that code A that links to/is designed to work with GPL'd code B inherits the copyright on B, but that is nonsense.
No. That's not what the GPL is saying. All copyright licenses stipulate the terms under which you are allowed to copy code that is explicitly licensed by it. Absent meeting those requirements you simply don't have the right to copy it. That is what a copyright is. The copyright holder has the ability to set the terms under which someone else can copy the work. Those terms may by monetary payment or whatever imaginative terms someone might wish to come up with.

In the case of the GPL - just like other copyright licenses - it explicitly says what those terms are. There is no inheriting of copyright. If I make a patch to SF tomorrow then the copyright *on that patch* is mine and mine alone. I am the author of that code in that patch and I get to determine how it will be licensed. If I don't want it to be licensed under the GPL I don't have to make it so! I can distribute my patch - and only my patch - however I wish and set the terms under which I will allow others to copy it. However, I don't have any automatic right to *other* people's code in SF. The only way I am allowed to copy other peoples code in SF or distribute copies of the rest of SF is if I agree and fulfill the terms that those other authors put on their code via the GPL. That's it.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

gonzochess75 wrote: Thu Feb 25, 2021 6:00 am
syzygy wrote: Thu Feb 25, 2021 1:58 am The GPL and its FAQ may or may not suggest that code A that links to/is designed to work with GPL'd code B inherits the copyright on B, but that is nonsense.
No. That's not what the GPL is saying. All copyright licenses stipulate the terms under which you are allowed to copy code that is explicitly licensed by it. Absent meeting those requirements you simply don't have the right to copy it. That is what a copyright is. The copyright holder has the ability to set the terms under which someone else can copy the work. Those terms may by monetary payment or whatever imaginative terms someone might wish to come up with.

In the case of the GPL - just like other copyright licenses - it explicitly says what those terms are. There is no inheriting of copyright. If I make a patch to SF tomorrow then the copyright *on that patch* is mine and mine alone. I am the author of that code in that patch and I get to determine how it will be licensed. If I don't want it to be licensed under the GPL I don't have to make it so! I can distribute my patch - and only my patch - however I wish and set the terms under which I will allow others to copy it. However, I don't have any automatic right to *other* people's code in SF. The only way I am allowed to copy other peoples code in SF or distribute copies of the rest of SF is if I agree and fulfill the terms that those other authors put on their code via the GPL. That's it.
So I guess with this reasoning the GPL would allow distribution of a modified Stockfish with a non-GPLed evaluation function (in a separate object file, that’s perhaps even dynamically loaded) as long as the latter does not call any other functions in the GPLed part of SF. Do you agree? Just trying to understand your point.

This is in essence the situation with a NNUE net but it would then also apply even if the non GPLed evaluation function would be executed natively.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
noobpwnftw
Posts: 560
Joined: Sun Nov 08, 2015 11:10 pm

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

Post by noobpwnftw »

That would be the same as loading a private driver or firmware blob in the Linux world.
Yes, possible, but they must be distributed separately if not explicitly allowed by a "controlled interface" exception from the GPL code.
User avatar
towforce
Posts: 11572
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

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

Post by towforce »

jshriver wrote: Wed Feb 24, 2021 11:39 pmI would imagine a weights file/NN is copyrightable.

I don't see how it's possible to get away from the fact that NNs, and hence NN weights, are software - and software can be copyrighted. If you're going to prove that FF2 can be legally copied, it will have to be through GPL or by showing that the NN isn't original work.
Writing is the antidote to confusion.
It's not "how smart you are", it's "how are you smart".
Your brain doesn't work the way you want, so train it!
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

noobpwnftw wrote: Thu Feb 25, 2021 9:38 am That would be the same as loading a private driver or firmware blob in the Linux world.
Yes, possible, but they must be distributed separately if not explicitly allowed by a "controlled interface" exception from the GPL code.
It is not clear to me what separate distribution means. I could put a nicely GPLed SF on my website with some extra facilities for dynamic loading and then a non-GPLed evaluation .dll on a different website, and finally I use a download manager that combines everything on the user's machine (after having verified that the user has bought the product).

Also note that the evaluation .dll could be derived from a source file in C containing a NNUE net in a large array together with a function that executes it (to overcome the objection that NNs are not derived from source code and hence perhaps not copyrightable, I have no opinion on this point).

PS. I am just playing the devil's advocate here.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
User avatar
hgm
Posts: 27793
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

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

Post by hgm »

I don't see how any license could avoid such a thing. The point is that evaluation is a separate task from search, that can be executed independently. You just have to pass it some representation of the game state, and it returns a number. And game-state representations are functionality, and cannot be copyrighted. Virtually all bitboard engines use the same game-representation. And even if they didn't, it would be trivial to convert it for the purpose of passing it to the evaluation DLL. NNUE evaluation is slow enough to make that an insignificant overhead.

No one could contest your right to sell the binary of a closed-source evaluation DLL with an API relying on an almost universally used representation of the game state of orthodox Chess. So preventing it to be combined with Stockfish would only be possible from the Stockfish end. That would mean it would have to be illegal in GPL'ed programs to use the standard bitboard representation for Chess...
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 »

Michel wrote: Thu Feb 25, 2021 7:16 am
gonzochess75 wrote: Thu Feb 25, 2021 6:00 am
syzygy wrote: Thu Feb 25, 2021 1:58 am The GPL and its FAQ may or may not suggest that code A that links to/is designed to work with GPL'd code B inherits the copyright on B, but that is nonsense.
No. That's not what the GPL is saying. All copyright licenses stipulate the terms under which you are allowed to copy code that is explicitly licensed by it. Absent meeting those requirements you simply don't have the right to copy it. That is what a copyright is. The copyright holder has the ability to set the terms under which someone else can copy the work. Those terms may by monetary payment or whatever imaginative terms someone might wish to come up with.

In the case of the GPL - just like other copyright licenses - it explicitly says what those terms are. There is no inheriting of copyright. If I make a patch to SF tomorrow then the copyright *on that patch* is mine and mine alone. I am the author of that code in that patch and I get to determine how it will be licensed. If I don't want it to be licensed under the GPL I don't have to make it so! I can distribute my patch - and only my patch - however I wish and set the terms under which I will allow others to copy it. However, I don't have any automatic right to *other* people's code in SF. The only way I am allowed to copy other peoples code in SF or distribute copies of the rest of SF is if I agree and fulfill the terms that those other authors put on their code via the GPL. That's it.
So I guess with this reasoning the GPL would allow distribution of a modified Stockfish with a non-GPLed evaluation function (in a separate object file, that’s perhaps even dynamically loaded) as long as the latter does not call any other functions in the GPLed part of SF. Do you agree? Just trying to understand your point.

This is in essence the situation with a NNUE net but it would then also apply even if the non GPLed evaluation function would be executed natively.
Not at all. That would violate the copyright of other peoples work in SF since that does not meet the terms of the GPL. At this point I would suggest just reading the GPL.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

gonzochess75 wrote: Thu Feb 25, 2021 3:44 pm
Michel wrote: Thu Feb 25, 2021 7:16 am
gonzochess75 wrote: Thu Feb 25, 2021 6:00 am
syzygy wrote: Thu Feb 25, 2021 1:58 am The GPL and its FAQ may or may not suggest that code A that links to/is designed to work with GPL'd code B inherits the copyright on B, but that is nonsense.
No. That's not what the GPL is saying. All copyright licenses stipulate the terms under which you are allowed to copy code that is explicitly licensed by it. Absent meeting those requirements you simply don't have the right to copy it. That is what a copyright is. The copyright holder has the ability to set the terms under which someone else can copy the work. Those terms may by monetary payment or whatever imaginative terms someone might wish to come up with.

In the case of the GPL - just like other copyright licenses - it explicitly says what those terms are. There is no inheriting of copyright. If I make a patch to SF tomorrow then the copyright *on that patch* is mine and mine alone. I am the author of that code in that patch and I get to determine how it will be licensed. If I don't want it to be licensed under the GPL I don't have to make it so! I can distribute my patch - and only my patch - however I wish and set the terms under which I will allow others to copy it. However, I don't have any automatic right to *other* people's code in SF. The only way I am allowed to copy other peoples code in SF or distribute copies of the rest of SF is if I agree and fulfill the terms that those other authors put on their code via the GPL. That's it.
So I guess with this reasoning the GPL would allow distribution of a modified Stockfish with a non-GPLed evaluation function (in a separate object file, that’s perhaps even dynamically loaded) as long as the latter does not call any other functions in the GPLed part of SF. Do you agree? Just trying to understand your point.

This is in essence the situation with a NNUE net but it would then also apply even if the non GPLed evaluation function would be executed natively.
Not at all. That would violate the copyright of other peoples work in SF since that does not meet the terms of the GPL. At this point I would suggest just reading the GPL.
Since it seems you are an expert on the GPL (I am not) can you point me to the section in the GPL 3 that would prohibit modifying SF so that it can load a 3d party evaluation dll (the modifications of course being themselves GPLed)?
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
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 »

Michel wrote: Thu Feb 25, 2021 10:26 am
noobpwnftw wrote: Thu Feb 25, 2021 9:38 am That would be the same as loading a private driver or firmware blob in the Linux world.
Yes, possible, but they must be distributed separately if not explicitly allowed by a "controlled interface" exception from the GPL code.
It is not clear to me what separate distribution means. I could put a nicely GPLed SF on my website with some extra facilities for dynamic loading and then a non-GPLed evaluation .dll on a different website, and finally I use a download manager that combines everything on the user's machine (after having verified that the user has bought the product).

Also note that the evaluation .dll could be derived from a source file in C containing a NNUE net in a large array together with a function that executes it (to overcome the objection that NNs are not derived from source code and hence perhaps not copyrightable, I have no opinion on this point).

PS. I am just playing the devil's advocate here.
All of these hypotheticals are missing the forest for the trees. If you accept that the NN weights file is copyrightable, then the only relevant question is whether the SF + NN weights file is a "combined work" or if it is two separate works merely aggregated together.

https://www.gnu.org/licenses/old-licens ... ggregation
"Mere aggregation of two programs means putting them side by side on the same CD-ROM or hard disk. We use this term in the case where they are separate programs, not parts of a single program. In this case, if one of the programs is covered by the GPL, it has no effect on the other program.
Combining two modules means connecting them together so that they form a single larger program. If either part is covered by the GPL, the whole combination must also be released under the GPL—if you can't, or won't, do that, you may not combine them.

What constitutes combining two parts into one program? This is a legal question, which ultimately judges will decide. We believe that a proper criterion depends both on the mechanism of communication (exec, pipes, rpc, function calls within a shared address space, etc.) and the semantics of the communication (what kinds of information are interchanged).

If the modules are included in the same executable file, they are definitely combined in one program. If modules are designed to run linked together in a shared address space, that almost surely means combining them into one program.

By contrast, pipes, sockets and command-line arguments are communication mechanisms normally used between two separate programs. So when they are used for communication, the modules normally are separate programs. But if the semantics of the communication are intimate enough, exchanging complex internal data structures, that too could be a basis to consider the two parts as combined into a larger program."
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.
Last edited by gonzochess75 on Thu Feb 25, 2021 4:25 pm, edited 2 times in total.
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

I think we should restrict ourselves to quoting the GPL3 (and not the GPL2).

This is I think is the relevant GPL3 clause
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate
So the way I read it is that if you modify SF to load a non-GPLed evaluation .dll which is distributed separately then this paragraph does not exclude that (but as I wrote it is easy to circumvent the separated distribution restriction).

PS. It seems the GPL3 does away with the concept of linking. I assume it is present in some other way but I do not understand it.
Last edited by Michel on Thu Feb 25, 2021 4:30 pm, edited 1 time in total.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.