Cosmos and Omnimodal World Foundation Models › Conditioning, Guardrails, and Customization
World Models HandbookAll chapters Cosmos and Omnimodal World Foundation Models › Conditioning, Guardrails, and CustomizationOne section · Sections in this chapter4 / 8 ↓
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
Conditional control, screening, and adaptation make a generative model useful in specific workflows. They are separate capabilities: having one does not establish the others. The Cosmos releases offer examples of each, with different interfaces and evidence requirements.
Conditioning modalities
Broadly, conditioning signals fall into four groups. An omnimodal family may support several input–output combinations across them, but supported combinations and optional inputs depend on the particular model and task. The groups also differ in how strongly they constrain output and how failures should be measured.
- Semantic and stylistic: text prompts can describe scene, weather, time of day, or camera behavior. Language leaves many pixels unspecified, so adherence to a particular object or trajectory needs separate checks.
- Structural and geometric: depth maps, semantic segmentation, edge maps, LiDAR returns, 3D bounding boxes, camera intrinsics and extrinsics, and trajectories from a planner. These can constrain geometry and improve label alignment, but generated pixels still need adherence checks before the original labels are reused.
- Appearance reference: a first frame or an image of a specific object can guide identity and texture. Whether the generated clip preserves either across frames must be tested.
- Control and action: steering, throttle, joint velocities, latent actions inferred from observed changes, or discrete keyboard-style actions can condition a future on a proposed choice when a compatible model was trained for them. A causal counterfactual additionally needs adequate action coverage and assumptions about confounding; supplying an action token alone is insufficient.
Two useful architectural patterns for injecting them are sequence concatenation and parallel control branches. The choice changes what can be constrained and how the model is adapted.
Sequence concatenation. Modality encoders can produce tokens that enter a shared transformer with modality identifiers and attention masks. Training on missing-modality patterns can let one model accept several subsets without changing its network shape; concatenation alone does not guarantee every subset works. Attention also gives a soft influence rather than a hard geometric or action constraint. This is a general pattern, not a claim that every Cosmos 3 modality uses one undifferentiated stream.
Parallel control branches. A side network injects spatial controls into a frozen main network through zero-initialized projections, following the ControlNet pattern. At initialization the side branch contributes zero, so the composite model matches the base model. Once trained, that branch can change outputs, and neither the pretrained prior nor control adherence is protected automatically. Branch weights can be scaled, including over space and time when the implementation supports it.
Cosmos-Transfer1 reports adaptive multimodal control: multiple spatial conditions, including depth and segmentation, can receive different weights at different locations. This can help the generator use stronger signals where they are informative, but 3D consistency and adherence are measured outcomes, not consequences guaranteed by the architecture. For a driving dataset, inspect alignment separately for near-field objects, the horizon, and small labeled regions.
For labeled training data, measure whether generated pixels still match simulator segmentation. A visually better clip with mismatched labels can damage a downstream learner. The options are to reject it, relabel it, or validate that the remaining mismatch is acceptable for the specific task; appearance quality is not a substitute for this check. Part VI discusses data quality in world-model learning.
Guidance and its calibration hazard
Classifier-free guidance is one common way to trade sample diversity for condition adherence. In its usual form, a model trained with conditioning randomly dropped combines conditional and unconditional predictions:
When this formula returns the model's plain conditional velocity. Larger extrapolates away from its unconditional velocity. In many generators that improves condition adherence at the cost of diversity and can introduce artifacts or suppress a mode. The effect depends on the trained fields and condition; no fixed guidance weight has a universal interpretation as a calibrated probability distribution.
Guidance can change event frequencies in the sampled distribution, beyond visible appearance differences. Even if unguided samples were calibrated for a particular event and evaluation set, increasing would require a new calibration check. In the toy experiment below, we call a sample a crossing-branch outcome when its lateral position exceeds m. This branch-frequency diagnostic differs from the later monitor's stricter conflict-line event at m. At , guidance drives the measured crossing-branch frequency below the analytic mixture weight. That direction and size of bias are properties of this toy model, not a general collision-risk correction factor.
guidance_values = [1.0, 2.0, 4.0, 8.0]
c_probe = 0.35
analytic_p_go = float(mixture_weight(c_probe))
guided = {}
for w in guidance_values:
s = sample_model(model, c_probe, 2000, steps=100, guidance=w, seed=7)
guided[w] = {"samples": s, "p_go": float((s > 0.5).mean())}
hist_w1, hist_edges_g = np.histogram(
guided[1.0]["samples"], bins=density_grid, density=True
)
hist_w8, _ = np.histogram(
guided[8.0]["samples"], bins=density_grid, density=True
)
hist_centers_g = 0.5 * (hist_edges_g[:-1] + hist_edges_g[1:])analytic crossing-branch mixture weight | c=0.35: 0.389 guidance w=1 sampled crossing-branch frequency=0.393 absolute difference=0.004 guidance w=2 sampled crossing-branch frequency=0.278 absolute difference=0.111 guidance w=4 sampled crossing-branch frequency=0.132 absolute difference=0.258 guidance w=8 sampled crossing-branch frequency=0.052 absolute difference=0.337 In this toy, guidance suppresses the minority crossing mode. This is useful to demonstrate a tradeoff in generation, but those samples should not be used as calibrated event probabilities without independent validation.


Guidance settings should be recorded with generated samples. If sampled futures inform risk estimates, validate event-frequency calibration on independent data for the exact model, guidance setting, context range, and sampling procedure. Using avoids extrapolative guidance but does not itself make a learned model calibrated. Appearance-tuned and decision-analysis sample streams can be kept separate; neither should be presented as a safety probability without validation.
Guardrails in three layers
"Guardrail" can refer to different checks. NVIDIA's documented Cosmos guardrails cover prompt and generated-content safety. Physical-plausibility screening and runtime risk monitoring are separate system components proposed here; the latter is not a shipped Cosmos safety feature.
Layer one: input and data filtering. Corpus preparation may screen personal or licensed material. Separately, the documented Cosmos pre-guard checks text prompts with a blocklist and content-safety classifier. Those mechanisms enforce a content policy; they do not verify physical dynamics or label fidelity, and their coverage depends on the classifier and release.
Layer two: output screening. The documented Cosmos post-guard screens generated frames for disallowed visual content and blurs faces. A physical-AI data pipeline also needs separate checks for interpenetrating objects, inconsistent scale or shadows, implausible motion, and label mismatches. These are dataset-validity or physical-plausibility problems, not proof that the shipped content filter detects them.
Layer three: runtime risk monitoring, if a world model is placed in a decision loop. An application might estimate event frequency from rollouts and compare it with warning or fallback thresholds. Such a monitor must be calibrated, stress-tested for shift, and backed by independent safeguards before deployment. It is not supplied by the content guardrails above, and a thresholded sample estimate alone is not a certified controller.
The following toy monitor only shows how distribution shift from guidance can change a thresholded decision. Its thresholds are illustrative, not operating limits for a vehicle.
from math import erf, sqrt
def normal_survival(x, mu, sigma):
"""P(N(mu, sigma^2) > x)."""
return 0.5 * (1.0 - erf((x - mu) / (sigma * sqrt(2.0))))
def analytic_conflict(c, threshold=risk_threshold):
"""Ground-truth probability that the pedestrian ends beyond the conflict line."""
p = float(mixture_weight(c))
return p * normal_survival(threshold, MODE_GO, MODE_SIGMA) + (
1 - p
) * normal_survival(threshold, MODE_STOP, MODE_SIGMA)
def safety_monitor(samples, threshold=risk_threshold, warn=0.20, block=0.45):
"""Apply illustrative thresholds to sampled toy futures, not a safety policy."""
p_conflict = float((samples > threshold).mean())
if p_conflict >= block:
action = "block"
elif p_conflict >= warn:
action = "warn"
else:
action = "proceed"
return p_conflict, action
monitor_rows = []
for c_value in (0.1, 0.35, 0.5, 0.9):
s = sample_model(model, c_value, 2000, steps=64, seed=21)
p_conflict, action = safety_monitor(s)
monitor_rows.append(
{
"c": c_value,
"p_conflict": p_conflict,
"analytic": analytic_conflict(c_value),
"action": action,
}
)
guided_probe = safety_monitor(
sample_model(model, c_probe, 2000, steps=64, guidance=8.0, seed=21)
)
unguided_probe = safety_monitor(
sample_model(model, c_probe, 2000, steps=64, guidance=1.0, seed=21)
) condition c P(conflict) analytic monitor
-----------------------------------------------
0.10 0.18 0.15 proceed
0.35 0.23 0.26 warn
0.50 0.28 0.33 warn
0.90 0.42 0.50 warn
same situation, guidance w=1: P(conflict)=0.23 -> warn
same situation, guidance w=8: P(conflict)=0.01 -> proceed
The toy threshold rule depends on the distribution it measures. Sampling with
strong guidance changed its output without changing the situation.
Two further mechanisms matter for a deployed design, although this notebook does not implement them. Independently trained ensembles can reveal some epistemic disagreement; changing a random seed in one fixed model chiefly measures sampling variability, not epistemic uncertainty. Support and shift detection asks whether the current context resembles those used to train and calibrate the model. Outside that domain, calibration evidence may not transfer. Both checks can motivate a fallback, but neither guarantees that a rollout is safe or physically correct.
Customization
Pretrained generators can be specialized in several ways. The following options differ in their training data, changed parameters, and evaluation burden; their cost ordering depends on implementation and scale.
Instruction and control tuning. Fine-tune on paired (condition, video) data to add or improve a camera, weather, time-of-day, or layout control. Whether this is cheaper than an adapter depends on the parameters updated and data required; its adherence must be tested on held-out conditions.
Parameter-efficient adaptation. Low-rank adaptation adds to a frozen weight , where and . For a large weight, is typically much smaller than ; the tiny first layer in the toy below is an exception. With initialized to zero, the combined network equals the base model at step zero. Training changes the adapter, so original-domain behavior must be rechecked. Small adapters can be stored separately for site or camera variants when the serving implementation supports swapping them.
Subject and scene personalization. Reference images and a subject identifier can adapt a generator toward a particular car, robot, or site, in the style of DreamBooth. Identity persistence across frames is a result to evaluate, not a property guaranteed by the method.
Preference and reward-based post-training. Optimize against human preferences or a learned reward for domain-specific outputs. This can encourage reward hacking or physical-distribution drift, so retain an independent fidelity check rather than treating reward improvement as proof of physical validity.
Let's implement LoRA on our toy flow model and adapt it to a shifted one-dimensional geometry: the stopping-position mean moves laterally from to m and the crossing-position mean from to m. These are lateral coordinates, not physical forward/backward distances. This is an adapter mechanics exercise, not an adaptation experiment on a world foundation model or a real site.
SHIFT_STOP, SHIFT_GO, SHIFT_SIGMA = -0.6, 2.6, 0.30
def sample_shifted(yield_amount, n, rng):
"""The new site: same decision structure, different geometry and noise."""
complete = rng.random(n) < mixture_weight(yield_amount)
centre = np.where(complete, SHIFT_GO, SHIFT_STOP)
return centre + rng.normal(0, SHIFT_SIGMA, n)class LoRAVelocity(nn.Module):
"""A frozen base flow model plus rank-r adapters on both hidden layers."""
def __init__(self, base, rank=4, alpha=8.0):
super().__init__()
self.base = base
for p in self.base.parameters():
p.requires_grad_(False)
self.a1 = nn.Linear(3, rank, bias=False)
self.b1 = nn.Linear(rank, self.base.fc1.out_features, bias=False)
self.a2 = nn.Linear(self.base.fc2.in_features, rank, bias=False)
self.b2 = nn.Linear(rank, self.base.fc2.out_features, bias=False)
nn.init.zeros_(self.b1.weight)
nn.init.zeros_(self.b2.weight)
self.scale = alpha / rank
def forward(self, x):
h1 = self.base.act(self.base.fc1(x) + self.scale * self.b1(self.a1(x)))
h2 = self.base.act(
self.base.fc2(h1) + self.scale * self.b2(self.a2(h1))
)
return self.base.fc3(h2)rng_lora = np.random.default_rng(17)
lora_model = LoRAVelocity(model, rank=4, alpha=8.0)
trainable = [p for p in lora_model.parameters() if p.requires_grad]
opt_lora = torch.optim.Adam(trainable, lr=5e-3)
for step in range(1500):
n = 256
c = rng_lora.uniform(0.0, 1.0, size=n)
y1 = sample_shifted(c, n, rng_lora)
y0 = rng_lora.normal(0.0, 1.0, size=n)
t = rng_lora.uniform(0.0, 1.0, size=n)
y_t = (1 - t) * y0 + t * y1
features = torch.tensor(np.stack([y_t, t, c], axis=1), dtype=torch.float32)
labels = torch.tensor(y1 - y0, dtype=torch.float32)[:, None]
loss = ((lora_model(features) - labels) ** 2).mean()
opt_lora.zero_grad()
loss.backward()
opt_lora.step()
n_base_params = sum(p.numel() for p in lora_model.base.parameters())
n_lora_params = sum(p.numel() for p in trainable)frozen base : mean=+0.36 m mass near +2.6 m = 0.19 base + LoRA : mean=+0.95 m mass near +2.6 m = 0.46 trainable parameters: 780 of 5,261 total (14.8%) About 15% of this toy model's parameters were trainable adapters.
This toy compares base and adapted outputs on the shifted domain, but it does not test retention on the original domain. Frozen base weights alone cannot establish retention because active adapters alter old-domain inputs too. The rank-four adapter constrains the update to the second-layer weight; for the first layer it is not low-rank relative to the base matrix and uses 268 adapter weights versus 192 base weights. Choose ranks by layer and held-out performance, and measure both domains before claiming successful specialization. The 14.8% trainable share is specific to this small network, not a full-scale adaptation-cost estimate.