Preserve visited Q-values with tiny prior probabilities - #120
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
sylvesterkaczmarek
marked this pull request as ready for review
September 23, 2026 09:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Normalize the visited prior weights before multiplying by Q-values in
_compute_mixed_value. Multiplying a floored tiny prior by a small Q-value first can underflow to zero, losing the visited action's contribution.For raw value
0.5, Q-values[0.25, 1.0], visits[1, 0], and priors[0, 1], the existing float32 result is0.25instead of0.375. This also affects completed Q-values used by the public search transform.The one-expression fix preserves the prior floor, no-visits guard, mixing formula, and output dtypes. No API or search-state changes.
Validation
macOS arm64 CPU, Python 3.12.11, JAX 0.11.2, Chex 0.1.92:
88f9205; all 16 pass after the fix._testingdirectory prescribed bytest.sh, including existing search-tree fixtures.git diff --checkpass.Pylint over all existing tests reports three line-length findings, identical on unchanged upstream; no existing lint rule or test was weakened. GPU/TPU execution and end-to-end agent training were not run.