test(grpo): reproduce LOO dynamic-sampling group split - #3469
Open
gkaplun-nvidia wants to merge 1 commit into
Open
test(grpo): reproduce LOO dynamic-sampling group split#3469gkaplun-nvidia wants to merge 1 commit into
gkaplun-nvidia wants to merge 1 commit into
Conversation
Exercise dynamic sampling through grpo_train with one prompt and four responses across single-success, single-failure, and balanced reward distributions. Every non-uniform prompt group should reach training intact. The one-outlier cases currently fail because the leave-one-out standard deviation causes the unique response to be filtered out and the batch to be backfilled with identical responses. The balanced case is a passing control. This is intentionally a test-only reproducer; no production fix is included. Signed-off-by: gkaplun <gkaplun@nvidia.com>
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.
Summary
grpo_train()path with one prompt and four generations.[1, 0, 0, 0](single success),[1, 1, 1, 0](single failure), and[1, 1, 0, 0](balanced control).Observed behavior
LOO produces response-specific standard deviations. When exactly one response differs, that response sees three identical siblings, receives a zero LOO standard deviation, and is removed by the current row-wise
std != 0filter. The remaining three identical responses are cached and backfilled from another rollout batch.As a result,
[1, 0, 0, 0]becomes[0, 0, 0, 0], while[1, 1, 1, 0]becomes[1, 1, 1, 1]. The balanced[1, 1, 0, 0]case already passes because every leave-one-out subset remains diverse.The test observes the final batch immediately after dynamic sampling. It does not prescribe whether maintainers fix the statistics calculation, the filtering logic, or another part of the implementation.
Verification
Run:
uv run pytest -q tests/unit/algorithms/test_grpo.py::test_grpo_train_dynamic_sampling_with_loo_keeps_prompt_group_intact