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

SyntheticGatherer often gives nearly deterministic feedback #821

Open
timokau opened this issue Nov 28, 2023 · 1 comment
Open

SyntheticGatherer often gives nearly deterministic feedback #821

timokau opened this issue Nov 28, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@timokau
Copy link
Contributor

timokau commented Nov 28, 2023

Bug description

The current implementation of the SyntheticGatherer in the preference comparisons module often chooses the trajectory with the higher reward nearly deterministically. This is because the Boltzmann-rational policy (or softmax) used for the SyntheticGatherer is very sensitive to the scale of the utilities, and the sum of rewards which are used as utilities tend to be quite large. The gatherer effectively implements this equation for feedback:

$$ P ( A \succ B) = \frac{\exp(\beta R(A))}{\exp(\beta R(A)) + \exp(\beta R(B))} $$

Where $A$ and $B$ are trajectories, $R(A)$ is the return of trajectory $A$ and $\beta$ is the temperature / rationality coefficient. Here are some example values with $\beta = 1$ to illustrate the problem:

R(A) R(B) Difference P(A > B) P(B > A)
1 1 0 0.5 0.5
1 2 1 0.27 0.73
1 3 2 0.12 0.88
1 4 3 0.05 0.95
1 5 4 0.02 0.98
1 7 6 0.0 1.0
1 8 7 0.0 1.0
1 9 8 0.0 1.0
1 10 9 0.0 1.0

As you can see, as soon as the difference in returns exceeds 10 the simulated feedback is nearly deterministic. Note that the probability only depends on the difference, the absolute values of the returns are irrelevant.

To fix this we could either normalize the returns or move away from the Boltzmann-rational model to something like the B-Pref oracle teachers.

@timokau timokau added the bug Something isn't working label Nov 28, 2023
@ernestum
Copy link
Collaborator

Hi @timokau. Thanks a lot for this hint! We will review the PC implementation in the coming weeks and then this information will be really valuable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants