[draft] add end-to-end RL training#6
Draft
m1fisher wants to merge 57 commits into
Draft
Conversation
This reverts commit f5b9baf.
Owner
|
This looks really cool, thanks for bringing it to my attention! Let me know if you need my input on anything :-) |
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.
Intent
Add the Dreamer 4 reinforcement learning training pipeline, enabling policy optimization in imagination. We introduce behavioral cloning + reward head finetuning (
agent.py,train_agent.py) and imagination-based policy gradient training (train_imagination.py).Context
train_agent.py: Finetunes the pretrained dynamics model by training Behavior Cloning and Reward prediction MLP heads on the dynamics model's hidden states. BC uses masked per-dimension supervision on expert data; the reward head uses symexp two-hot categorical predictions. Both heads use multi-token prediction (MTP) to forecastL steps ahead. To facilitate realism in longer rollouts, includes a new experimental autoregressive rollout loss mode (optional) that unrolls the dynamics model for K steps feeding its own outputs back, supervised against ground-truth
latents.
train_imagination.py: Trains a policy and value function in imagined latent rollouts with frozen dynamics/reward model. Currently contains implementations of both Dreamer 3 REINFORCE (which mastered DMControl), and Dreamer 4 PMPO (which is less proven for continuous action-space control).Status
End-to-end RL is not yet producing consistent reward improvement in Phase 3. Through extensive experimentation (18+ training runs across cartpole-swingup and walker-walk), we identified several potential challenges:
finetuning loss is our attempted mitigation but is still experimental.
Validation
A detailed report of our efforts and findings thus far is attached here