Lc0 Evaluation Explanation

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

Moderators: hgm, Rebel, chrisw

jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: Lc0 Evaluation Explanation

Post by jp »

cma6:

There is a link in the first post of the thread.

We've already said N is the number of visits.
Last edited by jp on Fri Aug 30, 2019 11:47 pm, edited 1 time in total.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Lc0 Evaluation Explanation

Post by zullil »

cma6 wrote: Fri Aug 30, 2019 11:13 pm Zulli:
Do you know the meaning of these terms: "P", "Q", "Q+U", & "V"?
I am guessing that V = visits. But, as pointed out, Be2 does not have the highest V value of all the moves shown. Or does the lc0 site have an explanation of the parameters, since when I searched here for "visits", it gave me no new information.
I'm actually a newcomer to NN engines, so I'm still learning. I believe P is the probability that the move is the right one to play in this position, based solely on the output of the net, with no additional searching/roll outs. So the P values give an initial suggestion of which moves are likely good ones, and so worthy of further analysis. There is a discussion of these various variables here:

https://github.com/LeelaChessZero/lc0/w ... Chess-Zero

Love to find something better, but not as technical as reading a research article!
cma6
Posts: 219
Joined: Thu May 29, 2014 5:58 pm

Re: Lc0 Evaluation Explanation

Post by cma6 »

Zullil:
Thanks for the excellent link.
jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: Lc0 Evaluation Explanation

Post by jp »

Hamster wrote: Fri Aug 30, 2019 10:23 pm
jp wrote: Fri Aug 30, 2019 2:17 am It looks to me that it does have the highest Q+U, as well as the highest N, but the only one the list of moves is in order for is N (visits).

I don't know what the "(+7)" in the top line means or the "(712)".
You are right, Q+U is actually the highest.

If Lc0 chooses the move with the most visits what would be a useful interpretation of the other variables?
E.g. why not choose the average expected value of all playouts for a move (Q)?
I found the meaning of the "(+7)", etc. It's "how many visits are processed by other threads when this is printed".
I still don't know what the "(712)", etc. mean.

By useful interpretation, I guess you mean from the chess point of view. Many of these outputted variables may be mainly useful from the computing point of view.

If it just chooses Q, it'll run into the standard MCTS problem where an engine "may favor a losing move with only one or a few forced refutations, due to the vast majority of other moves providing a better random playout score than other, better moves".
crem
Posts: 177
Joined: Wed May 23, 2018 9:29 pm

Re: Lc0 Evaluation Explanation

Post by crem »

Code: Select all

e2e4 (123) N: 329 (+ 4) (V: -12.34%) (P:38.12%) (Q: -0.2325) (U: 0.2394) (Q+U: 0.0069)
 ^    ^       ^    ^      ^           ^          ^            ^           ^
 |    |       |    |      |           |          |            |           Q+U, see below
 |    |       |    |      |           |          |           U from PUCT formula,
 |    |       |    |      |           |          |           see below.
 |    |       |    |      |           |         Average value of V in a subtree
 |    |       |    |      |          Probability of this move, from NN, 0%..100%
 |    |       |    |     Expected outcome for this position, directly from NN, -100%..100%
 |    |       |   How many visits are processed by other threads when this is printed.
 |    |      Number of visits. The move with maximum visits is chosen for play.
Move  |
    Internal move id (for debugging)

* U = P * Cpuct * sqrt(sum of N of all moves) / (N + 1)
  CPuct is a search parameter, can be changed with a command line flag.
* The move with largest Q+U will be visited next
* The move with the highest N is played when search is stopped
See also same formula here: https://slides.com/crem/lc0#/9
Hamster
Posts: 26
Joined: Sat May 25, 2013 6:38 pm
Location: Wien

Re: Lc0 Evaluation Explanation

Post by Hamster »

Nice that the most useful explanation came right on my birthday :mrgreen:

Yes, useful was meant from a chess point of view. More specifically I am looking for ideas on how to decide between
different moves for correspondence chess (CC) but also for an OTB opening repertoire. In CC often times one prefers
complex positions to simple ones and one tries to avoid drawing lines and I am hoping to get such info from the lc0
output. Exciting would be to see the draw-percentage from the playouts.