Genie
9 memberslucid.models.generative.genieGenie — a playable world model learned from unlabelled video.
Bruce et al., ICML 2024 (arXiv:2402.15391). A spatiotemporal video tokenizer, a latent action model that invents a controller of eight buttons from videos with no actions in them, and a MaskGIT dynamics model that answers each button press with the next frame.
Bruce, Jake, et al. "Genie: Generative Interactive Environments." Proceedings of the 41st International Conference on Machine Learning, PMLR, vol. 235, 2024, pp. 4603–4623.
Genie turns unlabelled video into a playable environment. A user gives it one image and presses one of buttons; it answers with the next frame, and keeps answering. Nothing in its training data says what the buttons are --- the meaning of each is learned, and emerges as left, right, jump and no-op on the platformer games it was trained on.
Three models, one block. Each component is a spatiotemporal (ST) transformer over a video of frames, each cut into patches. A block attends spatially over the tokens of one frame, then temporally over the tokens at one position under a causal mask, and only then applies a single feed-forward layer:
The cost is rather than , which is what makes 16 frames of 920 tokens trainable at all.
The latent action model reads frames and emits a continuous vector for the transition , which is quantised against a codebook of eight entries. A decoder must then rebuild from the past frames and that code alone, so the code has to carry exactly what the history does not already predict --- the choice. Eight codes are too few to smuggle the next frame through, which is the whole point.
The dynamics model is a MaskGIT transformer over the tokens of a separately trained VQ video tokenizer. The paper writes its objective over the whole next frame,
with the input tokens masked at a rate drawn from and the embedding of latent action added rather than concatenated. Read literally that predicts frame from the frames before it alone, which cannot be refined: the 25 MaskGIT steps a frame is generated over need the tokens revealed so far to re-enter the model. So the frame is filled in in place here --- frame 's masked tokens, conditioned on , on what is already revealed of , and on --- and the loss covers the masked positions, as MaskGIT's does.
At play time a frame starts fully masked and is revealed over those steps, keeping the most confident samples each time. Only the latent action model's codebook is needed then: a user's button is an index into it. The paper reports 10.7B parameters --- a 200M tokenizer, a 300M latent action model and a 10.1B dynamics model.
Classes
GenieConfig5 methodsFrozen configuration for the Genie family.
GenieForWorldModeling3 methodsGenie played as an environment: a prompt frame, then latent actions.
GenieModel12 methodsGenie's three networks and their objectives.
GenieOutput1 methodsThe three training objectives, and what each was computed from.
GenieRolloutOutput1 methodsFrames generated by playing the learned environment.
Functions
genie→ GenieModelConstruct the Platformers Genie — tokenizer, latent actions, dynamics.
genie_coinrun→ GenieModelConstruct the CoinRun case study — Genie at single-accelerator scale.
genie_coinrun_world_model→ GenieForWorldModelingConstruct the CoinRun case study as a playable environment.
genie_world_model→ GenieForWorldModelingConstruct the Platformers Genie as a playable environment.