Actions, Inverse Dynamics, and Latent Actions › Latent Action Alignment with Real Controls
World Models HandbookAll chapters Actions, Inverse Dynamics, and Latent Actions › Latent Action Alignment with Real ControlsOne section · Sections in this chapter5 / 10 ↓
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
Even a well-trained latent action model has no reason to place its latent actions on the same axis as the real ones. The learned is a knob that happens to be useful for prediction. Your downstream planner, on the other hand, has to issue a real command.
Alignment is the process of connecting a learned latent action to a real action. It sounds like a small engineering step, but it is a fundamental limitation. Unlabeled latent action discovery alone leaves a free reparametrization, and alignment must break that symmetry.
This is worth pausing on. The need for alignment is not a failure of any particular algorithm. It is a mathematical property of the problem. From the perspective of unlabeled data alone, the latent action space is defined only up to a symmetry group, and any element of the orbit is as good as any other. Breaking the symmetry requires information that is not in the unlabeled data, which is why every alignment method must import something external: a small labeled set, an assumption about statistics, a shared structure across views, or a prior on the action space.
Sources of Misalignment (Gauge Freedom)
Linear systems make the problem crisp. If the true dynamics are
where:
- : the true state at time
- : the true action at time
- : the true state transition matrix
- : the true action matrix
- : the true next state at time
and a latent action model learns , then any works for any invertible matrix that keeps . In particular, the two models agree when we can write
where:
- : the true state transition matrix
- : the true action matrix
- : the true state at time
- : the true action at time
- : the action matrix learned by the latent action model
- : the learned latent action at time
- : an invertible matrix relating the learned and true action spaces, satisfying
The latent action is therefore identified only up to a linear reparametrization: any invertible satisfying yields an equally valid latent action . On nonlinear systems the gauge freedom is even larger. If the true transition is and the latent model learns , then any diffeomorphism of the action space gives another valid model via , with .
where:
- : the true transition function
- : the learned latent transition function
- : a diffeomorphism of the action space
- : the latent action induced by the reparametrization
The practical consequences are concrete. Two different random seeds training the same architecture on the same data may produce latent actions that are sign-flipped, permuted, or scaled versions of each other. If the model is then used for planning, the policy that was trained on top of one version will fail on the other. If you have two robots, each with a latent action space, they may not be directly comparable even if the physical systems are pixel-identical.
For discrete latent actions, the analogue is a permutation of the codebook: code 7 might mean "jump forward" in one training run and "duck" in another. For continuous latent actions, the ambiguity is both a linear map and a smooth bijection, which is even harder to detect from data alone. Estimating the misalignment from data is possible when enough paired samples exist, but the number of samples grows with the dimension of the action space and with the richness of the diffeomorphism class you are trying to fit.
The terminology "gauge freedom" comes from physics: when two descriptions of the same physical system are related by a transformation that has no measurable consequences, the transformation is called a gauge transformation, and the space of such transformations is the gauge group. In latent action modeling, the gauge group is whatever class of reparametrizations leaves the reconstruction loss invariant. Identifying the gauge group tells you exactly what additional data or assumption is needed to fix a unique latent action space.
Linear Probes and Decoder Heads
The most direct way to break the symmetry is to pay for a little supervision. Suppose you have a small paired dataset with both latent actions and real actions . Two standard approaches follow.
- Linear probe. Fit a linear map such that . This tests whether the observed relationship is close to linear over the sampled operating range. It is cheap to fit, but it can still overfit, so alignment must be measured on held-out transitions and, ideally, under relevant distribution shifts.
- Decoder head. Add a small head to the latent action model and train it on the paired data while the rest of the model is frozen or slowly updated. The head absorbs the nonlinear part of the misalignment. Decoder heads are more expressive but need more paired data and can overfit if the paired set is tiny.
Both approaches work well when the paired data has the same distribution as the unlabeled data. If it does not, the alignment map will be biased. A common practical variant is to include a small amount of paired data in the original training objective, so the model learns a latent action space that is already partially aligned. This is sometimes called semi-supervised latent action learning, and it can be more sample-efficient than fitting the probe as a post-hoc step.
How many paired transitions a probe needs depends on latent dimension, conditioning, noise, model class, and distribution coverage. Learning curves on held-out trajectories are more reliable than a fixed sample-count rule. A low-dimensional linear map can require far less data than the world model, but only if the representation already exposes the relevant action structure.
Contrastive and Distributional Alignment
When labeled pairs are scarce, distributional constraints can supplement alignment. Matching marginal statistics of latent and real actions can remove selected ambiguities, but it generally cannot recover a pointwise correspondence: many reparametrizations preserve the same distribution.
A few techniques are relevant.
- Invariance to nuisance factors. Require to be unchanged when the same transition is seen from a different viewpoint, background, or sensor. This forbids the encoder from encoding nuisance variables, which shrinks the gauge group.
- Cross-modal alignment. If the same action was performed, its latent action should match across two different views of the same event. This is a contrastive task with positive pairs defined by actions. Instead of labeling actions directly, you label which transitions should have the same latent action, which is often easier.
- Canonicalization. Normalize the latent action space so that and is identity. This does not fix the rotation but it removes scale. Canonicalization is a small, cheap operation that eliminates an entire class of gauge freedom.
- Mutual information maximization. Encourage to be high with respect to whatever partial labels exist, which is a soft version of alignment. The mutual information term is a general formulation that subsumes several specific alignment losses as special cases.
Distributional alignment is weaker than paired supervision in what it guarantees. It can leave rotations, permutations, or nonlinear symmetries unresolved and can match marginals while pairing individual actions incorrectly. Paired anchors or structural assumptions are needed when the downstream system requires a specific real-control mapping.
Discrete Action Alignment
Discrete latent actions are a special case because alignment becomes a matching problem. If you have latent codes and real actions, and some paired data, you can solve an optimal assignment problem: match each latent code to the real action it most often co-occurs with. When and the mapping is bijective, this is a clean linear assignment that can be solved exactly in polynomial time by the Hungarian algorithm.
Discrete alignment is a matching problem, and the next figure shows it as a co-occurrence heatmap. The selected assignment is marked on the matrix, making the mapping from latent codes to real actions explicit.
import numpy as np
from scipy.optimize import linear_sum_assignment
rng_assign = np.random.default_rng(7)
K_latent, M_real = 4, 4
cooccur = rng_assign.integers(1, 30, size=(K_latent, M_real))
cooccur += np.eye(K_latent, dtype=int) * 50
row_ind, col_ind = linear_sum_assignment(-cooccur)
assignment = np.zeros_like(cooccur, dtype=bool)
assignment[row_ind, col_ind] = True
When , you have to decide whether to merge or split codes, and this is essentially a form of action abstraction.
An overcomplete latent codebook can represent several modes within one nominal real action, but simply ignoring infrequent codes may discard meaningful behavior. Utilization and transition semantics should be measured before codes are merged or pruned. When , alignment is no longer a one-to-one assignment and requires an explicit many-to-one, one-to-many, or abstraction policy.
How Much Alignment Do You Need?
It is tempting to demand perfect alignment between latent and real actions. In practice the bar is set by the downstream task.
- Planning inside a learned simulator. An unaligned latent may suffice to optimize imagined trajectories. If the plan must be executed in the real environment, however, the chosen latent still needs a reliable map to executable controls.
- Behavior cloning. A policy can imitate latent labels without naming their semantics, but deployment still requires either a latent-to-real action decoder or an environment that accepts those same latent controls.
- Deployment on hardware. The policy has to output a valid real action. Some alignment strategy is mandatory; whether a linear probe is sufficient must be established on held-out interventions.
- Transfer across robots. Alignment has to produce compatible action spaces, which is much stronger than alignment to a single robot's actions. It requires a shared coordinate system that survives domain shift, in addition to an alignment map for each embodiment.
The required alignment depends on the deployment interface. A planner that only explores imagined rollouts has different needs from a policy that must actuate hardware. Deciding that interface early determines whether pretraining needs paired anchors or can defer the mapping to a downstream decoder.