Are neural nets (the weights file) copyrightable?

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

Moderators: hgm, Rebel, chrisw

Michel
Posts: 2273
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

towforce wrote: Fri Feb 26, 2021 11:23 am The view at opensource stackexchange is that the GPL probably doesn't cover an NN - link.

It's a more difficult question than it looks!

Given what Chessbase have actually done, which is:

1. put the NN weights into a separate file

2. put a weaker set of NN weights into the freely available version

...it looks as though somebody at Chessbase has read the second response on that actual page.
I do not believe this is correct. SF with a modified net is clearly a modified SF (given that the net is used as a library by SF) so the combination falls under the GPL 3.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
User avatar
towforce
Posts: 11660
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

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

Post by towforce »

Michel wrote: Fri Feb 26, 2021 11:49 amI do not believe this is correct. SF with a modified net is clearly a modified SF (given that the net is used as a library by SF) so the combination falls under the GPL 3.

I agree: from my reading of the GPL FAQ, and in particular the section I linked in an earlier post, it seemed very clear to me that the NN, and hence its weights, was part of the code and hence is covered by the GPL.

However, I've made a decision to stop thinking about this so much: there's no legal precedent right now, so we don't know for sure (look at the big expensive battle Oracle had with Google about open source software interfaces!!!), and at the end of the day, if you just make a copy of the weights file for yourself, and keep quiet about it, I don't think Chessbase would pursue you - but why would you?

* if you just want the strongest chess program, get StockFish

* if you're buying FF2, you're probably not buying it just for the net - you probably want everything else that comes in the package as well.

For me personally, I'm probably never going to download StockFish, and I'm probably never going to buy FF2. Right now, Chess.com seems to meet my modest chess chess requirements:

* give my colleagues in the office a game when they want one

* play against a fellow human at roughly the same level any time I like (I haven't actually done this)

* play against one of the chess.com bots

* analyse a position from a fen/pgn (which at my level actually means, "Show me why I get killed if I play the obvious move sequence")

* maximum convenience: I don't have to install any software and I can use it from any device

Other than that, my interest in computer chess is in finding a better way to evaluate positions, which I've discussed at length in previous threads, but basically I believe that GM's have deep/complex patterns which enable them to "understand" a position very quickly. The evidence suggests to me that LC0 is finding a large number of shallow patterns, but missing the deep patterns that could really boost its play. If I can crack this, it would also offer a boost to AI in other areas where the patterns are complex/deep and hard to find. This is what I need to focus on, and this copyright issue is interesting, but distracting.
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!
syzygy
Posts: 5569
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

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.
Note that I am not saying that it is the FSF's position that A would inherit B's GPL license. But I believe that it is their position that A would inherit B's copyright, i.e. that the copyright on B also protects A. This would be the case if A were indeed a derived work of B in the sense of copyright. However, that position is legal nonsense.

Note that Linus Torvalds explicitly specified in the earlier days of Linux that a program designed to invoke the system calls of Linux need NOT be licensed under the GPL. He clarified this because some people were afraid that such a program would be considered to be a derived work of Linux. That fear has no basis in law, but it is a fear that exists and that - if I am not mistaken - is perpetuated by the FSF.
https://github.com/torvalds/linux/blob/ ... scall-note

Code: Select all

   NOTE! This copyright does *not* cover user programs that use kernel
 services by normal system calls - this is merely considered normal use
 of the kernel, and does *not* fall under the heading of "derived work".
From the FSF's GPL FAQ:
Some libraries are released under the GNU GPL alone; you must use a GPL-compatible license to use those libraries.
This is obviously true if you distribute a statically linked binary that includes material from the GPL'd library, but it is false if you distirbute an executable that links dynamically to the library. Yet the FSF makes no effort to clarify this nuance.

See also:
https://www.gnu.org/licenses/gpl-faq.ht ... cVsDynamic
Does the GPL have different requirements for statically vs dynamically linked modules with a covered work? (#GPLStaticVsDynamic)

No. Linking a GPL covered work statically or dynamically with other modules is making a combined work based on the GPL covered work. Thus, the terms and conditions of the GNU General Public License cover the whole combination. See also What legal issues come up if I use GPL-incompatible libraries with GPL software?
This is false! A dynamically linking executable contains no material from the library, so cannot be touched by the copyright on that library when it is distributed.

If a book A contains a reference to (not a quotation from) another book B, there is no way that the copyright on book B could be infringed by distributing book A. It is not different for a computer program. (Now, running the program is different, but the GPL does not forbid running a program.)
syzygy
Posts: 5569
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

Michel wrote: Thu Feb 25, 2021 7:16 am 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.
I agree. It is not even a problem if the latter does call functions in the GPL'd part of SF.

It is like taking a book, ripping out a chapter, and distributing both that modified book (within the terms of its license if possible) and distributing a replacement chapter that I wrote myself.

The GPL is a clever attempt at trying to use copyright to achieve something that copyright was never intended for. It should not be a surprise that this attempt is not fully successful.
Michel
Posts: 2273
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

This is false! A dynamically linking executable contains no material from the library, so cannot be touched by the copyright on that library when it is distributed.
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.
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 »

syzygy wrote: Fri Feb 26, 2021 2:08 pm This is false! A dynamically linking executable contains no material from the library, so cannot be touched by the copyright on that library when it is distributed.

If a book A contains a reference to (not a quotation from) another book B, there is no way that the copyright on book B could be infringed by distributing book A. It is not different for a computer program. (Now, running the program is different, but the GPL does not forbid running a program.)
It is not the copyright that extends. It is the terms of the GPL which the person must adhere to if they wish to copy GPL'd code. To be clear, if I make an original copyrighted work with the following copyright license:

// Copyright (C) 2021 foouser. All rights reserved.
// This work may only be copied, distributed, or modified if you meet the following terms
// 1) You go #(@&#*(@&$ yourself
// 2) You then light yourself on fire

That means basically that you only get to copy, distribute or modify the work if you meet those very unreasonable terms. No one in their right mind would meet those terms. Therefore the work can not be copied, distributed or modified by anyone besides foouser who actually holds the copyright. Why? Because all rights are reserved by the copyright holder!

In the case of works licensed under the GPL... the only people who get to copy, distribute or modify the works are the original copyright holder and those who uphold the terms of the GPL or those who have fair use rights. That's it.

Now, the explicit language of the GPL defines what it considers to be a mere aggregation vs a combined work. You may not like its definitions, but that would be like complaining about the definitions of what foouser really means when he says to, "go #(@&#*(@&$ yourself." You could of course argue in a court of law that the definition is unclear and you went and gave your self oral pleasure so that should count and the judge might agree with you. That'd be up to the judge.

However, the GPL has been upheld in court as enforceable as both a copyright and a license/contract. And I feel good that almost any corporate IP lawyer that has looked at this has advised their clients not to dynamically link proprietary modules/dlls with GPL'd code. There have been settlements of 100's of millions of dollars that have banked on this question and the GPL-side enforcing don't link your GPL'd code with dynamic link libraries side one.
User avatar
hgm
Posts: 27860
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 »

The issue is what 'distributing' means, and there are limits to what the GPL can claim it means. Putting a link in a package containing GPL-incompatible Stockfish extensions to an executable of Stockfish hosted by the Stockfish developers most likely is not a breach of copyrights. Mentioning Stockfish is obtainable from GitHub certainly would not be one. There is nothing the GPL can specify to change that.
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: Fri Feb 26, 2021 2:57 pm The issue is what 'distributing' means, and there are limits to what the GPL can claim it means. Putting a link in a package containing GPL-incompatible Stockfish extensions to an executable of Stockfish hosted by the Stockfish developers most likely is not a breach of copyrights. Mentioning Stockfish is obtainable from GitHub certainly would not be one. There is nothing the GPL can specify to change that.
Well, this is exactly right IMO. Wow. Basically, if you can't/won't meet the terms of the GPL, then you can do/not do with Stockfish exactly what you can do/not do with let's say Disney's Star Wars.
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 »

BTW, I've seen a ton of actual proprietary copyright licenses. Company foo licenses such and such software to company bar. The terms and conditions can be incredibly onerous and unreasonable. The more valuable the property that foo has the more onerous. In some cases, they make demands on future products, on company alliances, on non disclosure agreements that limit future activity... on jurisdiction to hear the case... incredible demands. The GPL is quaint and meek in comparison. And if bar doesn't meet those demands, then they simply don't have any rights to foo's product that are protected by copyright. Period.

What do you guys think that Disney's license to a third party for limited use of let's say Star Wars looks like? I can tell you it'd be basically equivalent to agreeing to give your first born to Disney. And if you don't meet those terms or a judge says the terms are illegal, then the copyright contract is not valid and all rights go back to the copyright holder. Bar does not automatically get granted some rights. Bar has no copyrights other than those granted by the copyright holder. Don't believe me? Have a look at some cases.
Michel
Posts: 2273
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

gonzochess75 wrote: Fri Feb 26, 2021 3:12 pm BTW, I've seen a ton of actual proprietary copyright licenses. Company foo licenses such and such software to company bar. The terms and conditions can be incredibly onerous and unreasonable. The more valuable the property that foo has the more onerous. In some cases, they make demands on future products, on company alliances, on non disclosure agreements that limit future activity... on jurisdiction to hear the case... incredible demands. The GPL is quaint and meek in comparison. And if bar doesn't meet those demands, then they simply don't have any rights to foo's product that are protected by copyright. Period.

What do you guys think that Disney's license to a third party for limited use of let's say Star Wars looks like? I can tell you it'd be basically equivalent to agreeing to give your first born to Disney. And if you don't meet those terms or a judge says the terms are illegal, then the copyright contract is not valid and all rights go back to the copyright holder. Bar does not automatically get granted some rights. Bar has no copyrights other than those granted by the copyright holder. Don't believe me? Have a look at some cases.
Can you please calm down. Nobody here is attacking the GPL. We are just trying to understand what it says and what it doesn't. Or what it can and cannot impose.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.