- Blind mode tutorial
lichess.org
Donate

How does lichess calculate average centipawn loss?

I've been getting interested in chess statistics, and wanted to be able to calculate average centipawn loss in a way that would be directly comparable to lichess. I have a general idea how it is done, but I can't find very much information on the specifics.

There is a little information here: https://lichess.org/faq#acpl, but if you dig into the numbers, there is clearly more to it, because if you just take the average of the loss for each move, on many games you will get a quite different number than lichess.

I found a discussion (https://chess.stackexchange.com/questions/22087/how-is-average-centipawn-loss-calculated-when-a-mate-is-missed) suggesting that chess.com implements a cap of +-1000 centipawns on the evaluations used in the calculation. I tried this with some data from my games on lichess, and I get answers that are very close to lichess. However, something is a little bit off. My numbers tend to be a bit lower than lichess, and rarely match exactly, even though I'm using lichess's own evaluations to do my calculations.

Here's a graph that shows how my numbers compare to lichess:

https://imgur.com/a/hpkQxsV

The red line is y = x. In other words, if I matched lichess' acpl exactly, all the black dots would fall on the red line. Instead, my numbers trend a little bit low, especially for low acpl. In one case, I even get negative acpl!

Can someone point me to the exact method used by lichess for this calculation?

I've been getting interested in chess statistics, and wanted to be able to calculate average centipawn loss in a way that would be directly comparable to lichess. I have a general idea how it is done, but I can't find very much information on the specifics. There is a little information here: https://lichess.org/faq#acpl, but if you dig into the numbers, there is clearly more to it, because if you just take the average of the loss for each move, on many games you will get a quite different number than lichess. I found a discussion (https://chess.stackexchange.com/questions/22087/how-is-average-centipawn-loss-calculated-when-a-mate-is-missed) suggesting that chess.com implements a cap of +-1000 centipawns on the evaluations used in the calculation. I tried this with some data from my games on lichess, and I get answers that are very close to lichess. However, something is a little bit off. My numbers tend to be a bit lower than lichess, and rarely match exactly, even though I'm using lichess's own evaluations to do my calculations. Here's a graph that shows how my numbers compare to lichess: https://imgur.com/a/hpkQxsV The red line is y = x. In other words, if I matched lichess' acpl exactly, all the black dots would fall on the red line. Instead, my numbers trend a little bit low, especially for low acpl. In one case, I even get negative acpl! Can someone point me to the exact method used by lichess for this calculation?

First of all negative acpl by defenition isnt possible. CPL for one move is the difference in evaluation between the move played and the best move according to the engine at a certain depth. There is also a cutoff, where cpl is always 0 (I dont know where the cu is), because it doesnt matter if the engine thinks you are winning by +20 or +40. I also dont know, how missed mate is counted, but I would guess that it is equal to the cutoff.

First of all negative acpl by defenition isnt possible. CPL for one move is the difference in evaluation between the move played and the best move according to the engine at a certain depth. There is also a cutoff, where cpl is always 0 (I dont know where the cu is), because it doesnt matter if the engine thinks you are winning by +20 or +40. I also dont know, how missed mate is counted, but I would guess that it is equal to the cutoff.

@QEDemonstrandum Negative cpl is an artifact resulting from the evaluation changing even if the best move was played, because the analysis is now starting one ply deeper. So in some circumstances, the evaluation drops even when the engine's first choice was played. It definitely does happen - you can easily prove this to yourself by pulling up the numerical evaluation scores from a game's analysis and taking the difference at turns where the engine's first choice was played.

@QEDemonstrandum Negative cpl is an artifact resulting from the evaluation changing even if the best move was played, because the analysis is now starting one ply deeper. So in some circumstances, the evaluation drops even when the engine's first choice was played. It definitely does happen - you can easily prove this to yourself by pulling up the numerical evaluation scores from a game's analysis and taking the difference at turns where the engine's first choice was played.

@dryguy Thats why I wrote at a certain depth, of course if you compare the eval before and after the move and dont account for the change in depth, it is a clear bug (at least to me). I think for any case resulting in negative CPL, you should just take 0.

@dryguy Thats why I wrote at a certain depth, of course if you compare the eval before and after the move and dont account for the change in depth, it is a clear bug (at least to me). I think for any case resulting in negative CPL, you should just take 0.

@QEDemonstrandum Fair enough, although that would take a lot longer to do the calculation, because you would have to make sure that the lines for both the best move and the played move got analyzed. I think lichess is analyzing in single-PV mode, and just taking the difference. They have a really big user base running a lot of analyses, so it would cost too much for them to do it in a way that guaranteed positive cpl.

@QEDemonstrandum Fair enough, although that would take a lot longer to do the calculation, because you would have to make sure that the lines for both the best move and the played move got analyzed. I think lichess is analyzing in single-PV mode, and just taking the difference. They have a really big user base running a lot of analyses, so it would cost too much for them to do it in a way that guaranteed positive cpl.

Yeah ths#ats why I suggest that you take 0 if you calculate a negative CPL for any move, because by the defenition of CPL a negative value doesnt really make sense.

Yeah ths#ats why I suggest that you take 0 if you calculate a negative CPL for any move, because by the defenition of CPL a negative value doesnt really make sense.

@QEDemonstrandum I did try that to see if my results line up better with lichess, but it doesn't make much difference, apart from the one negative value disappearing:

https://imgur.com/a/bEmxQxW

It also worsens the agreement with lichess, and the scatter increases.

@QEDemonstrandum I did try that to see if my results line up better with lichess, but it doesn't make much difference, apart from the one negative value disappearing: https://imgur.com/a/bEmxQxW It also worsens the agreement with lichess, and the scatter increases.

@QEDemonstrandum I varied the caps. Somewhere around 1000 centipawns gives the closest agreement to lichess. Setting it much higher or lower increases the amount of scatter in my graph. Both the graphs I posted use a cap of 1000 cp.

@QEDemonstrandum I varied the caps. Somewhere around 1000 centipawns gives the closest agreement to lichess. Setting it much higher or lower increases the amount of scatter in my graph. Both the graphs I posted use a cap of 1000 cp.

https://lichess.org/mWyheZrR/white#83

I was not cheating and only 19 acpl (okay, this is a bit off topic, but it shows that acpl below 20 is not only GM level!)

https://lichess.org/mWyheZrR/white#83 I was not cheating and only 19 acpl (okay, this is a bit off topic, but it shows that acpl below 20 is not only GM level!)

This topic has been archived and can no longer be replied to.