【BUG】wrong implementation of zero-centered mean when normalizing advantages
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.5k
- Forks
- 1.3k
- Avg merge
- 5h 36m
- Merged PRs (30d)
- 22
Description
In slime/utils/distributed_utils.py,
def distributed_masked_whiten(...),
when shift_mean = False, 'whitened_values += global_mean' may be wrong?
I think the correct implementation may be 'whitened_values = values * torch.rsqrt(global_var + epsilon)', am I right?
while the original implementation is 'whitened_values = (values - global_mean) * torch.rsqrt(global_var + epsilon) + global_mean', it's inequal to the above implementation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in slime/utils/distributed_utils.py and inspect distributed_masked_whiten, focusing on the shift_mean=False branch and the two normalization formulas described in the issue. Compare the expected zero-centered behavior with the current global_mean handling, then add or update regression coverage so the selected behavior is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- distributed-systems, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100