Are neural nets (the weights file) copyrightable?

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

Moderator: Ras

syzygy
Posts: 5714
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

Michel wrote: Sun Feb 28, 2021 1:02 pm But why are there no court cases then? If dynamic linking does not create a derived work then it becomes trivial to hijack large GPL projects. Surely companies will do this if it is possible.
The FUD spread by the FSF may be having some effect?
User avatar
towforce
Posts: 12506
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 »

hgm wrote: Sun Feb 28, 2021 1:02 pm
Fulvio wrote: Sun Feb 28, 2021 11:43 amData is usually used with the meaning of "user's data" like the data you store into a database.
Computer software is organized hierarchically in 'levels' and what is code at one level can be data as far as the undelying level is concerned. So the distinction is not that clear cut.

E.g. engines like Fairy-Max or Sjaak II come together with a file of game definitions to specify the rules of individual chess variants. The game-description format, when sufficiently powerful, in fact becomes a programming language interpreted by these engines. Although to the engines they are just data files.

The GPL FAQ explicitly addresses this situation, and states that it is legal to distribute a GPL'ed interpreter with an interpreted program that has a different license. As far as I am concerned that settles the matter: linking programs at the same level of organization (e.g. through DLLs) is not allowed, bundling interpreted code with an interpreter is.

That's not what CB have done with FF2 and SF, though. If a file of NN weights can be regarded as "interpreted code" (dubious), then they have not bundled interpreted code with a GPL interpreter - they've taken a GPL bundle consisting of interpreted code with an interpreter and they have modified the interpreted code!
Human chess is partly about tactics and strategy, but mostly about memory
Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

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

Post by Fulvio »

hgm wrote: Sun Feb 28, 2021 1:02 pm The GPL FAQ explicitly addresses this situation, and states that it is legal to distribute a GPL'ed interpreter with an interpreted program that has a different license.
interpreter: A person who interprets, especially one who translates speech orally or into sign language.
It is obvious to me that a compiler translates c++ code into machine code, and a python interpreter does the same with python code.
It is obvious to me that Stockfish is not an interpreter.
User avatar
towforce
Posts: 12506
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 »

Fulvio wrote: Sun Feb 28, 2021 1:27 pm
hgm wrote: Sun Feb 28, 2021 1:02 pm The GPL FAQ explicitly addresses this situation, and states that it is legal to distribute a GPL'ed interpreter with an interpreted program that has a different license.
interpreter: A person who interprets, especially one who translates speech orally or into sign language.
It is obvious to me that a compiler translates c++ code into machine code, and a python interpreter does the same with python code.
It is obvious to me that Stockfish is not an interpreter.

+1

Even better than my response to the same post.
Human chess is partly about tactics and strategy, but mostly about memory
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

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

Post by Michel »

syzygy wrote: Sun Feb 28, 2021 1:15 pm
Michel wrote: Sun Feb 28, 2021 1:02 pm But why are there no court cases then? If dynamic linking does not create a derived work then it becomes trivial to hijack large GPL projects. Surely companies will do this if it is possible.
The FUD spread by the FSF may be having some effect?
I don't think so. Companies always take what they can get. This is the basic rule of capitalism (this is not meant as a judgement or a political statement).

Surely Eben Moglen would not stake his reputation on a position which you claim to be obviously untenable in court.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
User avatar
hgm
Posts: 28386
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 »

Fulvio wrote: Sun Feb 28, 2021 1:27 pm
hgm wrote: Sun Feb 28, 2021 1:02 pm The GPL FAQ explicitly addresses this situation, and states that it is legal to distribute a GPL'ed interpreter with an interpreted program that has a different license.
interpreter: A person who interprets, especially one who translates speech orally or into sign language.
It is obvious to me that a compiler translates c++ code into machine code, and a python interpreter does the same with python code.
It is obvious to me that Stockfish is not an interpreter.
In IT speak (i.e. in discussions about the GPL, and its FAQ) 'interpreter' means a program that in real time reads the program it is interpreting, and performs the actions that the program element ('instruction', 'statement') specified. This in contrast to a 'compiler', which translates the actions into instructions of a lower-level programming language, without performing the actions themselves.

A neural net is a data-flow computer, and the weights represent a machine-language program for that computer. Because there are no hardware implementations of the NN, it requires an interpreter to execute (the SF NNUE code).
User avatar
hgm
Posts: 28386
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 »

towforce wrote: Sun Feb 28, 2021 1:23 pmThat's not what CB have done with FF2 and SF, though. If a file of NN weights can be regarded as "interpreted code" (dubious), then they have not bundled interpreted code with a GPL interpreter - they've taken a GPL bundle consisting of interpreted code with an interpreter and they have modified the interpreted code!
No, they have replaced the interpreted code entirely. One never has to worry about copyrights on stuff you do notone doesn't use. Not using something doesn't count as 'copying'.

They just used the interpreter. GPL FAQ says you can do that.
User avatar
towforce
Posts: 12506
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 »

hgm wrote: Sun Feb 28, 2021 1:38 pm
Fulvio wrote: Sun Feb 28, 2021 1:27 pm
hgm wrote: Sun Feb 28, 2021 1:02 pm The GPL FAQ explicitly addresses this situation, and states that it is legal to distribute a GPL'ed interpreter with an interpreted program that has a different license.
interpreter: A person who interprets, especially one who translates speech orally or into sign language.
It is obvious to me that a compiler translates c++ code into machine code, and a python interpreter does the same with python code.
It is obvious to me that Stockfish is not an interpreter.
In IT speak (i.e. in discussions about the GPL, and its FAQ) 'interpreter' means a program that in real time reads the program it is interpreting, and performs the actions that the program element ('instruction', 'statement') specified. This in contrast to a 'compiler', which translates the actions into instructions of a lower-level programming language, without performing the actions themselves.

A neural net is a data-flow computer, and the weights represent a machine-language program for that computer. Because there are no hardware implementations of the NN, it requires an interpreter to execute (the SF NNUE code).

NN weights are not being read in real time (emphasis yours) - they're loaded once then used multiple times. There are other reasons why you could not say that they're not being "interpreted" as well.

Also, of course, these weights are in the original SF GPL bundle - it's not as though it's new software that's never been associated with the interpreter previously, which is what the GPL rule you're using is intended to mean.
Human chess is partly about tactics and strategy, but mostly about memory
User avatar
towforce
Posts: 12506
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 »

hgm wrote: Sun Feb 28, 2021 1:45 pm
towforce wrote: Sun Feb 28, 2021 1:23 pmThat's not what CB have done with FF2 and SF, though. If a file of NN weights can be regarded as "interpreted code" (dubious), then they have not bundled interpreted code with a GPL interpreter - they've taken a GPL bundle consisting of interpreted code with an interpreter and they have modified the interpreted code!
No, they have replaced the interpreted code entirely. One never has to worry about copyrights on stuff you do notone doesn't use. Not using something doesn't count as 'copying'.

That's a bit garbled, but clearly the NN weights were already there and have been modified. HOW they were modified doesn't matter.
Human chess is partly about tactics and strategy, but mostly about memory
Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

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

Post by Fulvio »

hgm wrote: Sun Feb 28, 2021 1:38 pm A neural net is a data-flow computer, and the weights represent a machine-language program for that computer. Because there are no hardware implementations of the NN, it requires an interpreter to execute
Ok, we can agree on that: if you pick some input, run it through a NN and just spit the output.
But that's not what Stockfish NNUE does.