Skip to content

GRPO validation accepts groups that don't match the training request #748

Closed

Description

@ItsM0rty

I found a mismatch between the SDK's GRPO checks and its training request format in 0.6.20.

_check_groups accepts interleaved runs such as A1, B1, A2, B2 because each group_id appears twice. The request keeps that order, but only sends group_size=2; it doesn't send the group IDs. Both request models document contiguous groups. Under that contract, the request represents [A1, B1] and [A2, B2] rather than the original task groups.

I reproduced this through four real local rollouts. Task A always scores 1 and task B always scores 0. After interleaving them, both forward and forward_backward accept the batch and send rewards [1, 0, 1, 0]. The SDK also warns that every group has zero reward spread, even though the contiguous groups in the request both contain [1, 0].

There's a related case w/o reordering: omitting group_size is documented to make the whole batch one group, but the warning still splits it by group_id. It reports no gradient for [1, 1, 0, 0].

My local change rejects interleaved keyed groups before HTTP and calculates the warning from the same positional groups as the request. It preserves input order, including the meaning of returned traj_idx values. The existing test treats interleaved groups as valid, so I've updated that expectation explicitly.

Four regression cases fail on the original source. All 11 focused training tests pass w/ the change. The tests use actual local task execution and mock only training HTTP; no hosted training or weight updates were run. This establishes the SDK/request mismatch, not a measured effect on a deployed model. If the service actually recovers groups from trace provenance instead, the documented request contract needs clarifying.

Activity

  1. added a commit that references this issue on Oct 27, 2026
    2ad6e30
  2. added a commit that references this issue on Oct 27, 2026
    5611f4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions