Latent-Variable Representations › Key Parameters

Michael BrenndoerferJune 15, 20262 min read
World Models HandbookAll chapters
Part 3 of 12Representing Agents and Worlds
Chapter 15Latent-Variable Representations › Key Parameters
Reading section 8 of 11 · Key Parameters · 2 minSection 8 of 11 · 2 min

Book contents

Section 8 of 11 · 2 min read

Latent-Variable Representations › Key ParametersOne section · Sections in this chapter8 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The key parameters for the VAE and VQ-VAE are:

  • dim_z: Latent dimensionality. Two dimensions are enough to embed this dataset's one-angle snapshot manifold and make its geometry directly plottable; a dynamical pendulum state generally also includes angular velocity. In general, dim_z is a design choice for latent representational capacity. Intrinsic dimension informs it, but topology, uncertainty parameterization, and the chosen coordinate family can require more coordinates. Too small a bottleneck destroys necessary information; too large a bottleneck can leave redundant or collapsed dimensions and may expose downstream models to nuisance variation unless they learn to ignore it.
  • beta: Bottleneck strength multiplying the KL term. Larger values penalize posterior rate more strongly and can reduce active dimensions or cause full collapse. Sweep it and measure reconstruction, KL, geometry, and downstream sufficiency.
  • n_codes: Number of codebook entries in the VQ-VAE. Eight codes quantize the ring into arcs; too many invite dead codes, too few lose fidelity. The right number depends on the desired rate-distortion tradeoff, task, data distribution, architecture, and optimization, so usage diagnostics and sweeps are essential.
  • lambda_commit: VQ-VAE commitment-loss weight, separate from the VAE KL multiplier β\beta. It keeps encoder outputs near assigned codes. The original VQ-VAE used 0.25; treat it as a historical baseline and sweep it for the application.
  • dim_h: Hidden layer width shared by encoder and decoder. A width of 128 reduces the likelihood of an obvious capacity bottleneck here, but a failure still requires checks across optimization, likelihood, seed, and architecture.