Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objective pawn eval #4218

Closed
wants to merge 1 commit into from
Closed

Conversation

vdbergh
Copy link
Contributor

@vdbergh vdbergh commented Nov 3, 2022

This is an alternative proposal to #4216

Formula:

s=w+d/2 (w,d,l obtained from the win rate model)
eval_cp=400*log10(s/(1-s))

@vdbergh vdbergh changed the title Objective pawn_eval Objective pawn eval Nov 3, 2022
@vdbergh vdbergh force-pushed the objective_eval branch 2 times, most recently from 5468cc3 to 29467f6 Compare November 3, 2022 10:25
@amchess
Copy link

amchess commented Nov 3, 2022

Great idea!
Congratulations!

@ddobbelaere
Copy link
Contributor

ddobbelaere commented Nov 3, 2022

I personally like this PR in the sense that it puts more emphasis on the WDL model. If the latter is accurate, indeed a more objective pawn eval is obtained. There are still two things that slightly bother me:

  • How does the eval "feel"? Will it not be too "confusing" for the user? The reason being that the now non-linear formula between internal value (and ply) and reported value might lead to compression/decompression for low/high evals w.r.t. the current SF behavior.
  • The reported value depends on ply, will this not cause inconsistencies during analysis? E.g. setting up a board position without the move number might lead to different reported values.

src/uci.cpp Outdated
}

int win_rate_model(Value v, int ply) {
// Return the win rate in per mille units rounded to the nearest value
return int(0.5 + 1000*win_rate_model(v, ply));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return int(0.5 + 1000*win_rate_model(v, ply));
return int(0.5 + 1000*win_rate_model_double(v, ply));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG that's a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@vdbergh
Copy link
Contributor Author

vdbergh commented Nov 3, 2022

It seems that this method works well for small evals (e.g. the starting position has eval ~30). However for big evals it is rather counter intuitive. If I remove the white queen then master has an eval of ~ -1200 but this method has an eval of ~ -4500.

Of course SF will win against god with a queen ahead, so this high negative eval simply reflects the fact that the game is lost.

@nimr0d
Copy link

nimr0d commented Nov 3, 2022

This is a cool idea. Centipawn would then directly mean elo difference starting in that position? It would give some more meaning to "average centipawn loss".

@vdbergh
Copy link
Contributor Author

vdbergh commented Nov 3, 2022

I personally like this PR in the sense that it puts more emphasis on the WDL model. If the latter is accurate, indeed a more objective pawn eval is obtained. There are still two things that slightly bother me:

* How does the eval "feel"? Will it not be too "confusing" for the user? The reason being that the now non-linear formula between internal value (and ply) and reported value might lead to compression/decompression for low/high evals w.r.t. the current SF behavior.

This appears to be the case. But I am not sure is this is bad. For example the eval is currently clamped to 8000cp. I observed in many games that if this value is reached then SF is close to announcing mate. So there is a smooth transition from the eval to mate scores.

* The reported value depends on ply, will this not cause inconsistencies during analysis? E.g. setting up a board position without the move number might lead to different reported values.

Personally I regret that the win rate model depends on the ply. Logically it can and should only depend on the board. One may try to replace ply by game phase, but according to Vondele this gives a less good fit.

@ddobbelaere
Copy link
Contributor

Personally I regret that the win rate model depends on the ply. Logically it can and should only depend on the board. One may try to replace ply by game phase, but according to Vondele this gives a less good fit.

There was an interesting suggestion by zz4032 on Discord to let WDL depend on number of pieces instead of ply. Don't know if that would work equally well though (i.e. give an accurate model).

Formula:

s=w+d/2 (w,d,l obtained from the win rate model)
eval_cp=400*log10(s/(1-s))
@vdbergh
Copy link
Contributor Author

vdbergh commented Nov 4, 2022

I am going to close this. After thinking it over I decided it is probably too controversial.

@vdbergh vdbergh closed this Nov 4, 2022
@vondele
Copy link
Member

vondele commented Nov 4, 2022

I think it is interesting, but yes, I'm sure especially the larger values would surprise people. This would also make it a little more difficult to derive the win_rate_model from pgns that contain search evals.

@LovelyChess LovelyChess mentioned this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants