Skip to content
data

DreamerV3Config

extendsWorldModelConfig
DreamerV3Config(sample_size: int | tuple[int, int] = WORLD_MODEL_IMAGE_SIZE, in_channels: int = 3, out_channels: int = 3, act_fn: GenerativeActivation = 'silu', action_dim: int = 1, stoch_size: int = 32, deter_size: int = 4096, hidden_size: int = 512, cnn_depth: int = 32, min_std: float = 0.1, mean_only: bool = False, free_nats: float = 1.0, kl_weight: float = 1.0, discrete: int = 32, unimix: float = 0.01, blocks: int = 8, dyn_scale: float = 1.0, rep_scale: float = 0.1, pred_scale: float = 1.0, num_bins: int = 255, bin_range: float = 20.0, reward_hidden: int = 512, reward_layers: int = 1, actor_hidden: int = 512, actor_layers: int = 3, value_hidden: int = 512, value_layers: int = 3, horizon: int = 15, discount: float = 0.997, lambda_: float = 0.95, actor_entropy: float = 0.0003, actor_min_std: float = 0.1, return_ema_decay: float = 0.99, return_low: float = 5.0, return_high: float = 95.0, critic_ema: float = 0.02, critic_slowreg: float = 1.0, replay_value_scale: float = 0.3, pcont: bool = True, pcont_scale: float = 1.0, pcont_layers: int = 1, action_space: str = 'continuous', actor_max_std: float = 1.0, actor_outscale: float = 0.01, dense_init: DenseInit = 'fan_in_trunc_normal')

Frozen configuration for the DreamerV3 family.

Defaults are the paper's values at the 50m rung of the scaling ladder, whose 32-class categorical grid is the one the paper describes. Fields shared with the earlier world models are inherited from WorldModelConfig.

Parameters

act_fn(silu, swish, relu, gelu, elu)= "silu"
Activation throughout. DreamerV2 used ELU; this uses SiLU.
stoch_sizeint= 32
Number of categorical variables.
deter_sizeint= 4096, 512
Deterministic path and the RSSM heads' hidden width.
hidden_sizeint= 4096, 512
Deterministic path and the RSSM heads' hidden width.
cnn_depthint= 32
First encoder convolution's width.
free_natsfloat= 1.0
Free bits — the divergence is flat below this, per step. One nat is the paper's value, and the reason it no longer needs tuning.
kl_weightfloat= 1.0
Overall multiplier on the divergence, on top of the split below.
discreteint= 32
Classes per variable.
unimixfloat= 0.01
Uniform mass mixed into every categorical. Keeps a class from reaching probability zero, where its gradient would vanish.
blocksint= 8
Groups in the block-diagonal sequence model. The paper's recurrence is eight times the hidden width, split into eight independent blocks of that width — which is the only reason a 4096-unit recurrence fits inside a 50M-parameter model. Must divide deter_size.
dyn_scalefloat= 1.0, 0.1
βdyn\beta_{\mathrm{dyn}} and βrep\beta_{\mathrm{rep}} — how hard the prior is pulled toward the posterior against the reverse. The asymmetry is DreamerV2's KL balancing, restated.
rep_scalefloat= 1.0, 0.1
βdyn\beta_{\mathrm{dyn}} and βrep\beta_{\mathrm{rep}} — how hard the prior is pulled toward the posterior against the reverse. The asymmetry is DreamerV2's KL balancing, restated.
pred_scalefloat= 1.0
βpred\beta_{\mathrm{pred}} on the reconstruction, reward and continuation likelihoods.
num_binsint= 255
Bins in the reward and value heads' two-hot output.
bin_rangefloat= 20.0
The grid spans [-bin_range, +bin_range] in symlog space, so in reward units it reaches symexp(20) — roughly 5e8.
reward_hiddenint= 512, 1
Reward head. One hidden layer, as the reference's rewhead has — the three-layer stack is the actor's and the critic's.
reward_layersint= 512, 1
Reward head. One hidden layer, as the reference's rewhead has — the three-layer stack is the actor's and the critic's.
actor_hiddenint= 512, 3
Actor.
actor_layersint= 512, 3
Actor.
value_hiddenint= 512, 3
Critic.
value_layersint= 512, 3
Critic.
horizonint= 15
Imagination horizon. H in the paper's Table 4.
discountfloat= 0.997
Reward discount. Stated as a horizon of 333 steps in the released configuration, which is the same number.
lambda_float= 0.95
TD(λ\lambda) weighting.
actor_entropyfloat= 3e-4
Entropy bonus. Fixed across domains, which only works because the returns it competes with are normalised.
actor_min_stdfloat= 0.1, 1.0
Bounds on the continuous policy's standard deviation, which the released implementation's head (embodied/jax/heads.py, bounded_normal; policy.minstd and policy.maxstd in configs.yaml) spans with std = (max_std - min_std) * sigmoid(raw + 2) + min_std. The paper does not give the policy head. Without a floor the actor can drive the deviation to zero, which ends exploration and leaves the entropy bonus fighting a term that has already collapsed; the ceiling is what keeps the entropy bonus from being satisfied by widening the policy until it is uniform. Both are ignored when action_space="discrete".
return_ema_decayfloat= 0.99
Decay of the moving return-spread estimate.
return_lowfloat= 5.0, 95.0
Percentiles whose difference is that spread.
return_highfloat= 5.0, 95.0
Percentiles whose difference is that spread.
critic_emafloat= 0.02
Rate at which the critic's slow copy follows it. DreamerV2 used a hard copy every hundred steps; this is a continuous average.
critic_slowregfloat= 1.0
Weight on the term pulling the critic toward its own slow copy. The slow copy is a regulariser here, not the source of the targets — the returns are bootstrapped from the live critic, which is the opposite of DreamerV2's arrangement.
replay_value_scalefloat= 0.3
Weight on the critic's loss over replayed trajectories, in addition to imagined ones.
pcontbool= True
Build the continuation head, which predicts whether the episode is still running one step on. With it, the discount applied to an imagined step is that predicted probability rather than the constant discount, so a trajectory stops being credited once the model expects it to have ended — the difference between a world model that knows about termination and one that assumes the episode runs forever. Costs one filtered step per sequence, because the last one has no successor to label it, so training needs sequences of at least two.
pcont_scalefloat= 1.0
Weight on the continuation head's loss within the world-model objective.
pcont_layersint= 1
Hidden layers in that head. One is enough because it predicts a single Bernoulli from a state the RSSM has already built.
action_space(continuous, discrete)= "continuous"
What an action is, as in DreamerV2.
actor_max_stdfloat= 0.1, 1.0
Bounds on the continuous policy's standard deviation, which the released implementation's head (embodied/jax/heads.py, bounded_normal; policy.minstd and policy.maxstd in configs.yaml) spans with std = (max_std - min_std) * sigmoid(raw + 2) + min_std. The paper does not give the policy head. Without a floor the actor can drive the deviation to zero, which ends exploration and leaves the entropy bonus fighting a term that has already collapsed; the ceiling is what keeps the entropy bonus from being satisfied by widening the policy until it is uniform. Both are ignored when action_space="discrete".
actor_outscalefloat= 0.01
Scale applied to the policy's output layer at initialisation, with its bias started at zero (policy.outscale in configs.yaml; the paper is silent on it), so the actor begins near uniform (discrete) or near N(0, 0.89) around zero (continuous) instead of committing to whatever its random weights happen to prefer. The reward and value heads need no such knob: the paper starts their output weights at exactly zero, and they do.
dense_init(fan_in_trunc_normal, default)= "fan_in_trunc_normal"
How every dense layer starts — the decoder's lift, the RSSM's projections and block-diagonal gates, and the reward, critic, continuation and policy heads. "fan_in_trunc_normal" is the release's winit: trunc_normal_in with a zero binit: a normal truncated at two standard deviations, scaled so the draw has standard deviation 1/fanin1/\sqrt{\text{fan}_{in}}. The output layers then take their own start on top of it (actor_outscale, and zero for the reward predictor and both critics). "default" keeps lucid.nn.Linear's Kaiming-uniform kernel and uniform bias, which is what this family did before the release's was matched. The convolutional encoder and decoder are not dense layers and keep their default either way.

Notes

Reference: Hafner, Pasukonis, Ba, and Norouzi, "Mastering Diverse Domains through World Models", Nature 640 (2025), 647-653 (arXiv:2301.04104).

The scaling ladder moves five quantities together, so it is a table rather than a knob — see DREAMER_V3_SIZES and the factories built from it:

======== ======= ======== ======= ===== ===== size deter hidden classes depth units ======== ======= ======== ======= ===== ===== 12m 2048 256 16 16 256 25m 3072 384 24 24 384 50m 4096 512 32 32 512 100m 6144 768 48 48 768 200m 8192 1024 64 64 1024 400m 12288 1536 96 96 1536 ======== ======= ======== ======= ===== =====

Two details of that table are worth writing down. Its 12m column prints 1024 recurrent units where the stated rule — eight times the hidden size — gives 2048; the released implementation uses 2048, and so does this. And the paper's own default is the 200m rung for every benchmark except the two control suites, which use 12m; the defaults here are 50m, the middle of the ladder, because a 200M default would make merely constructing the model an expensive operation. Use dreamer_v3_200m for the paper's setting.

The released implementation carries a few things the paper does not report — extra dynamics layers, an absolute posterior variant, and a value- and advantage-normalisation pair disabled in every published configuration. Where the two disagree the paper is followed, as it is for the earlier families.

Examples

>>> from lucid.models.generative.dreamer_v3 import DreamerV3Config
>>> cfg = DreamerV3Config(action_dim=6)
>>> cfg.stoch_size, cfg.discrete, cfg.free_nats
(32, 32, 1.0)
>>> cfg.discount, cfg.horizon, cfg.num_bins
(0.997, 15, 255)

Used by 3

Properties

2
prop

latent_size

→int
latent_size: int

Width of [h; s], with s the flattened categorical grid.

prop

stoch_width

→int
stoch_width: int

Flattened width of the stochastic latent — stoch_size * discrete.