Skip to content

fix(pu): stabilize MuZero RND KeyCorridor minigrid reproduction - #497

Merged
puyuan1996 merged 3 commits into
mainfrom
fix/minigrid-muzero-rnd-reproduction
Aug 14, 2026
Merged

fix(pu): stabilize MuZero RND KeyCorridor minigrid reproduction#497
puyuan1996 merged 3 commits into
mainfrom
fix/minigrid-muzero-rnd-reproduction

Conversation

@puyuan1996

Copy link
Copy Markdown
Collaborator

Summary

  • fix the MiniGrid/Gymnasium interface: apply the real episode horizon on the unwrapped environment, expose the actual FlatObs space, preserve reward shape/dtype, and handle uint8 vectors at model boundaries
  • fix the MuZero RND pipeline: train all supported input modes, derive sequence length instead of hard-coding six observations, keep the RND replay on CPU, and exclude segment padding
  • restore an opt-in max-priority insertion path for sparse-reward PER while preserving legacy behavior by default
  • update the provided config to target MiniGrid-KeyCorridorS3R3-v0 with the intended MuZero+SSL+RND setup, and add a separate 1M-step config with temperature/RND annealing

Reproduction status

This work was prompted by a community report that the checked-in config trained on Empty/DoorKey but did not reproduce the KeyCorridorS3R3 curve.

With the repaired 2M baseline, learning is no longer stalled: at 1.158M env steps, the latest collector reward was 0.661 (recent-10 mean 0.604, peak 0.832). Evaluation remained around 0.318 because only one of the three deterministic evaluation layouts was solved. The run also showed that the original temperature threshold was expressed in learner iterations and therefore kept collection temperature at 1.0 throughout this window. RND predictor error fell substantially, while batch-normalized novelty remained non-zero.

The added 1M config addresses those observations by lowering the temperature threshold, linearly annealing the intrinsic-reward coefficient to zero, using td_steps=20, and limiting replay to 300k recent transitions. Full performance validation of that config is still pending GPU availability; this PR does not claim that the paper's ~0.8 score has already been reproduced.

Tests

  • 17 passed: RND schedule, observation preparation, MLP representation, KeyCorridor config, FlatObs space, horizon, and reward shape/dtype
  • end-to-end CPU smoke test: real KeyCorridor environment + CTree + RND + PER + AdamW, including learner updates

@puyuan1996 puyuan1996 changed the title fix(minigrid): stabilize MuZero RND KeyCorridor reproduction fix(pu): stabilize MuZero RND KeyCorridor minigrid reproduction Aug 14, 2026
@puyuan1996 puyuan1996 added enhancement New feature or request polish Polish algorithms, tests or configs labels Aug 14, 2026
@puyuan1996
puyuan1996 merged commit 997553f into main Aug 14, 2026
1 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request polish Polish algorithms, tests or configs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant