Skip to content

Bug in GRPO advantage calculation: Extra brackets in std computation #104

@SCBoy1007

Description

@SCBoy1007

There's a bug in the GRPO advantage calculation at line 159 of verl/trainer/core_algos.py. The standard deviation computation has extra brackets that create an incorrect tensor shape.

Line 159

id2std[idx] = torch.std(torch.tensor([id2score[idx]]))

The id2score[idx] is already a list; wrapping it in additional brackets [id2score[idx]] creates a nested structure.

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