Are neural nets (the weights file) copyrightable?

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

Moderator: Ras

User avatar
hgm
Posts: 28353
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 cannot be blamed for the fact that there are so many arguments that say 'no' on 2. The whole FF2 situation is very unclear:

* The NN weights might not be protected by copyright because:
- NN weights can never be copyrighted
- They were generated with the aid of a machine
- The data set from which they were generated was not protected by copyrights

In that case there is nothing wrong with what CB is selling, but they have no protection for the FF2 net. But some of these options seem false, and for others we simply do not know what is the case.

In any case the GPL never obliges you to publish anything. It can at most forbid you to distribute something. I don't have any doubts on the issue of the NN weights being object code for a data-flow computer, which is interpreted. But one can never be sure that the truth will prevail in court; laws have been made to state pi exactly equalled 3. I also suspect that (in the context of computer programs) there is something very wrong with the argument that the functionality is not copyrightable, only the 'creative freedom' on top of it. By that reasoning all object code becomes uncopyrightable, because the task of an (optimizing) compiler is to cast the functionality of a given program into the most efficient form for execution by the hardware. That pretty much would mean that the Stockfish binary is not protected by copyrights, and CB is free to do with it as they please. It is an executable that plays Chess (functionality), and doesn't show any creativity of its designers to the user.

We know that this is not the case, so I suspect that 'functionality' here must refer to what output it gives in response to what input, and not on the details of how it does that. But the way it does it is usually considered 'the algorithm', and algorithms are not copyrightable either. Only the implementation of an algorithm can be copyrighted. But different implementations of an alpha-beta search might very well all result in exactly the same binary. That pretty much brings it on par with 'idiom': code lines like "for(i=0; i<n; i++)" are also not copyrightable.
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 »

hgm wrote: Mon Mar 01, 2021 6:52 pm I cannot be blamed for the fact that there are so many arguments that say 'no' on 2. The whole FF2 situation is very unclear:

* The NN weights might not be protected by copyright because:
- NN weights can never be copyrighted
- They were generated with the aid of a machine
- The data set from which they were generated was not protected by copyrights

In that case there is nothing wrong with what CB is selling, but they have no protection for the FF2 net. But some of these options seem false, and for others we simply do not know what is the case.

In any case the GPL never obliges you to publish anything. It can at most forbid you to distribute something. I don't have any doubts on the issue of the NN weights being object code for a data-flow computer, which is interpreted. But one can never be sure that the truth will prevail in court; laws have been made to state pi exactly equalled 3. I also suspect that (in the context of computer programs) there is something very wrong with the argument that the functionality is not copyrightable, only the 'creative freedom' on top of it. By that reasoning all object code becomes uncopyrightable, because the task of an (optimizing) compiler is to cast the functionality of a given program into the most efficient form for execution by the hardware. That pretty much would mean that the Stockfish binary is not protected by copyrights, and CB is free to do with it as they please. It is an executable that plays Chess (functionality), and doesn't show any creativity of its designers to the user.

We know that this is not the case, so I suspect that 'functionality' here must refer to what output it gives in response to what input, and not on the details of how it does that. But the way it does it is usually considered 'the algorithm', and algorithms are not copyrightable either. Only the implementation of an algorithm can be copyrighted. But different implementations of an alpha-beta search might very well all result in exactly the same binary. That pretty much brings it on par with 'idiom': code lines like "for(i=0; i<n; i++)" are also not copyrightable.
grep for "interpreter" in the GPLv3

you've been staking a big big claim on the GPL FAQ without looking at the license. i've been trying to tell you *how* the FAQ is formed from the license - ie., the language in the license that is operative - but you've been taking the FAQ *as* the license.

once again, "...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..." is the operative language. all your interpretations need to deal with this language.

syzygy's way of dealing with it is to dismiss it as superfluous language and insist on using "derivative work" as it was used in GPLv2 even though that language doesn't exist in GPLv3.

Dann's way of dealing with it is to ignore it and rant about data data data not being part of a work's "source code."

HGM's way of dealing with it is never to bother looking at the actual license at all and glomming on to one part of the GPL FAQ and twist it into something you could drive a truck through.

I don't find any of these GPL-truthers strategies convincing... Neither does the industry... Neither do the courts... Neither do the people who actually wrote the GPL... and from what I can tell neither do most in this forum.

https://www.gnu.org/licenses/gpl-3.0.en.html
syzygy
Posts: 5696
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

chrisw wrote: Mon Mar 01, 2021 2:03 pm The NNUE weights data is machine generated and there’s no copyright on them. Calling them “code” is logically possible, but that inversion-of-point-of-view can’t magically add any copyright attribute.
Yes, it is has been my position from the start that an NNUE net is free of copyright.

In my view this would even be the case if its values were all handcrafted, because an NNUE net is not a perceivable creative expression.
syzygy
Posts: 5696
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

Fulvio wrote: Mon Mar 01, 2021 2:28 pm(I'm still not sure if someone previously in this thread really tried to claim that you can take some GPL source code, change an image, and redistribuite it with a different license).
What does it mean to change an image in GPL source code?

Whatever you might mean exactly, the GPL source code obviously must remain GPL.
syzygy
Posts: 5696
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

hgm wrote: Mon Mar 01, 2021 9:41 am OK, you used that example before, and only now I understand what you meant.

Interpreting is not dynamic linking. Stockfish links to the NNUE interpreter (statically, I guess). Not to the interpreted code. If interpreting was linking, it would never be allowed to bundle a GPL-incompatible Python program with a GPL'ed interpreter. But the GPL FAQ explicitly says you can.
Let's forget that FAQ and see what part of the GPLv3 text causes interpreted code to be treated differently from dynamically linked code.

I guess that this would have to be found in the "Corresponding Source" part:
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
What a mess... You don't need the source code of a shared library that a GPL'd executable links to to "generate, install and run the object code and to modify the work".

You do need the shared libraries (in object code) themselves, or the program won't load (to keep things simple, I am ignoring the possible use of dlopen()).

You don't need interpreted code to start an interpreter. (Nor do you need an NNUE net to start SF NNUE.) On the other hand, if you distribute an interpreter together with a program that can be interpreted by it, the combination is arguably an extended program that, in order to work, needs the interpreted code (which then apparently should be GPL'd).

So it's not really clear where the line is that the GPLv3 is trying to draw.

If we consider the "For example" hints, one could say that an interpreter is, by its nature, not specifically designed to require any particular interpreted code. But the same applies to NNUE SF executables. They are designed to run some NNUE net that comes in the right format, not any particular one. (To argue the contrary, I would point out that the default value of the EvalFile specifies the NNUE net that the program was specifically designed to require.)

If we look at "intimate data communication or control flow", it seems to me this is much weaker between SF and an NNUE net than between an interpreter and interpreted code. The NNUE net is merely food for a number crunching algorithm, it doesn't communicate in any way.
Last edited by syzygy on Tue Mar 02, 2021 2:59 am, edited 1 time in total.
syzygy
Posts: 5696
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

towforce wrote: Mon Mar 01, 2021 3:53 pm
hgm wrote: Mon Mar 01, 2021 3:42 pmWhy do you think I have any motivation one way or the other in making Stockfish derivatives?
I fully accept that, regarding the two main issues under dispute..

1. Can an NN be copyrighted?

2. Does SF's GPL license oblige CB to publish FF2's NN weights file?

..there are no precedents to my knowledge that have been decided in a court.

However, it seems to me that you're producing arguments in favour of (1) yes (2) no which are somewhat stretched and convoluted, implying that your heart lies in allowing bundling of new NNs with GPL software while holding the copyright on the NN.

I also claim impartiality, and my view is (1) yes (2) yes.
I often don't agree with HGM, but there is no doubt in my mind that he has no hidden agenda. I find it very disturbing to see someone being accused of having some "motivation" just because he is trying to objectively analyse the situation to the best of his abilities (whether I agree with his conclusions or not).
syzygy
Posts: 5696
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

hgm wrote: Mon Mar 01, 2021 6:52 pmI also suspect that (in the context of computer programs) there is something very wrong with the argument that the functionality is not copyrightable, only the 'creative freedom' on top of it.
C-406/10 (SAS Instititue v World Programming)
Court of Justice of the EU wrote:Article 1(2) of Council Directive 91/250/EEC of 14 May 1991 on the legal protection of computer programs must be interpreted as meaning that neither the functionality of a computer program nor the programming language and the format of data files used in a computer program in order to exploit certain of its functions constitute a form of expression of that program and, as such, are not protected by copyright in computer programs for the purposes of that directive.
https://en.wikipedia.org/wiki/SAS_Insti ... amming_Ltd
By that reasoning all object code becomes uncopyrightable, because the task of an (optimizing) compiler is to cast the functionality of a given program into the most efficient form for execution by the hardware. That pretty much would mean that the Stockfish binary is not protected by copyrights, and CB is free to do with it as they please. It is an executable that plays Chess (functionality), and doesn't show any creativity of its designers to the user.
One argument against this is that optimizing compilers aren't perfect and in practice some copyrightable expression will survive the compilation step (or be assumed to survive by the judge).

Another argument is that the legislator wanted object code to have the same protection as the source code, so, as an exception to normal principles of copyright, it is protected by the copyright on the source code even if no copyrightable expression survived the compilation step. (I do not know if this argument has been used by any court.)
We know that this is not the case, so I suspect that 'functionality' here must refer to what output it gives in response to what input, and not on the details of how it does that. But the way it does it is usually considered 'the algorithm', and algorithms are not copyrightable either. Only the implementation of an algorithm can be copyrighted. But different implementations of an alpha-beta search might very well all result in exactly the same binary. That pretty much brings it on par with 'idiom': code lines like "for(i=0; i<n; i++)" are also not copyrightable.
Only the expression of the algorithm in source code can be copyrighted. Comments, variable names, white space, etc. (Indeed these do not survive in a stripped eecutable.)

If there is no functional/technical reason for a particular ordering of the fields of a struct, perhaps that is also a copyrightable element. Such an element does survive the compilation step (at least for C/C++, not necessarily for Rust).
Dann Corbit
Posts: 12777
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

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

Post by Dann Corbit »

Fulvio wrote: Sun Feb 28, 2021 11:43 am
Dann Corbit wrote: Sun Feb 28, 2021 11:12 am Yes, of course I am claiming that, assuming that the images are loaded into memory by the program.
Data is not source code.
We need to start to define some word to avoid misunderstandings.
Everything is data, just 0 or 1, and everything is loaded into memory.
Data is usually used with the meaning of "user's data" like the data you store into a database.

What you are claming is that you can download the source code of a GPL game:
https://wiki.wesnoth.org/Download
replace a few .png images and then you can legally distribute it with a different license?
I have no idea how you can make that out of what I said.
In fact, I think it to be an utterly absurd statement
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.
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

hgm wrote:I also suspect that (in the context of computer programs) there is something very wrong with the argument that the functionality is not copyrightable, only the 'creative freedom' on top of it.
Yes there seems to be something wrong with ignoring functionality.
  • The fact that a program is statically or dynamically linked makes zero difference for the functionality of the program. It is an implementation detail (and in addition, with the standard concept of linking, the actual memory copy of the program is virtually the same). If copyright law truly makes a difference between these (I am not convinced) then there is something very wrong with copyright law.
  • Likewise, whether a library is interpreted, byte compiled and then interpreted, just in time compiled, pre-compiled, or accessed by whatever scheme that is yet to be invented, is an implementation detail with no effect on functionality. It should make zero difference with respect to the context in which the library can be used.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Dann Corbit
Posts: 12777
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

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

Post by Dann Corbit »

Michel wrote: Tue Mar 02, 2021 8:38 am
hgm wrote:I also suspect that (in the context of computer programs) there is something very wrong with the argument that the functionality is not copyrightable, only the 'creative freedom' on top of it.
Yes there seems to be something wrong with ignoring functionality.
  • The fact that a program is statically or dynamically linked makes zero difference for the functionality of the program. It is an implementation detail (and in addition, with the standard concept of linking, the actual memory copy of the program is virtually the same). If copyright law truly makes a difference between these (I am not convinced) then there is something very wrong with copyright law.
  • Likewise, whether a library is interpreted, byte compiled and then interpreted, just in time compiled, pre-compiled, or accessed by whatever scheme that is yet to be invented, is an implementation detail with no effect on functionality. It should make zero difference with respect to the context in which the library can be used.
There is something that feels wrong about all the effort that goes into making a phone book, and yet the phone book is not copyrightable.
But there is a method behind that madness.
Why should someone get exclusive rights to print a phonebook, when all that was involved was tedious, simple steps that anyone could accomplish?

There is something that feels wrong about not protecting an enormous effort spent creating special formulas to accelerate numerical integration.
The Japanese professors who invented double exponential integration spent years on it.
The guy in Utah who perfected sinc integration spent years on it.
But it makes sense to protect math.
Why should anyone own a math formula?
That math formula existed for eternity, until it was uncovered. And if the guy who uncovered it did not do it, someone else was going to uncover it shortly. That's why Newton and Leibnitz both invented calculus at the same time. The necessary preliminary steps had already been completed.

Copyright does not protect hard work. Copyright protects original thought. And that is how it should be.
IMO-YMMV
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.