Part of World Models Handbook
Curation determines what a world model can learn. Examines deduplication, filtering, balancing, synthetic data, mixture weights, and contamination risks.
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
Data Curation and Synthetic Data
Consider a log with 160 episodes and 6,400 transitions. Thirty episodes are exact copies, 40 have severe observation noise, and only 10 begin in the wide-state regime where the dynamics are most nonlinear. The transition count is correct, yet it is a poor description of what the dataset can teach. Later in this chapter, we will build exactly this controlled example and measure what deduplication, filtering, balancing, and synthetic augmentation change. The result is more useful than a slogan that curation always helps: filtering improves this particular misspecified model, while aggressive balancing can hurt because data cannot repair the model class. Curation determines both the evidence presented to the learner and the trade-offs hidden by an aggregate count.
That is why data curation deserves its own chapter rather than a paragraph in a training-loop appendix. A world model is fitted to statistics of its training distribution. If that distribution is dominated by a robot sitting still, an ordinary average-risk objective emphasizes stillness over uncommon motion. If noisy sensor logs dominate, a model without an explicit observation-noise mechanism can conflate measurement error with dynamics. If procedurally generated trajectories from one physics engine dominate, simulator-specific regularities can be learned alongside the intended dynamics. These outcomes depend on the objective, architecture, and labels, but the common point is simple: changing which regions appear, and how they are weighted, changes the fitted model even when the underlying physical system is identical.
In Interaction Data and Passive Observation, we asked where transitions come from: teleoperation, autonomous play, human video, logged fleet data, scripted policies, and simulators. This chapter takes that raw stream as given and asks what to do with it. We will work through four problems that show up in every serious pipeline:
- Trajectory quality and diversity. What makes an episode worth training on, and how do we measure coverage of the state-action space without pretending coverage is the same thing as quality?
- Deduplication, filtering, and balancing. How to detect and remove redundancy, how to remove corruption without creating blind spots, and how to re-weight a skewed distribution toward the one your planner will query.
- Simulation and procedural generation. How synthetic data expands coverage, what it costs in fidelity, and why models trained on their own outputs quietly collapse.
- Data mixtures, provenance, and contamination. How to choose mixture weights, how to track where every episode came from, and why the usual random train/test split is a trap for world models specifically.
A theme runs through all four: curation is a modeling decision expressed through data. Every filter encodes an assumption about what the model should learn. Every mixture weight encodes a guess about where the policy will operate. Making those choices explicitly, and measuring their consequences, is the difference between data engineering and data science. The distinction is not merely aesthetic. A data engineer asks "is this pipeline correct?" A data scientist asks "what did this pipeline make my model believe, and is that belief true?" The rest of this chapter is about turning the second question into something you can systematically answer.
Trajectory Quality and Diversity
A world model trains on trajectories , where is the observation at time , is the action at time , is the trajectory length, and each adjacent triple for is a transition. Two important properties of a trajectory collection are how trustworthy each trajectory is and how broadly the collection covers the situations the model will be asked about. They are distinct rather than strictly orthogonal: collection choices can affect both. A pristine recording of a robot waving its arm in place for an hour may have high signal quality and little behavioral diversity. A varied hour containing recoveries and falls may have broad behavioral coverage even if some transitions are corrupted. Dataset size alone therefore cannot summarize either quality or coverage.
What "quality" means for a world model
Quality is not a scalar property of a file. It is a set of separate failure modes, and each one demands a different detector. It helps to think of each failure mode as a specific corruption process acting on an otherwise clean signal, because then the question "is this defect present?" becomes "how would I detect this specific corruption?", which is a much more tractable engineering problem:
-
Signal-to-noise ratio. Sensor noise, motion blur, compression artifacts, and dropped frames can corrupt observations. Without a model that separates observation noise from process noise, the learned transition distribution may attribute measurement variability to the environment. That misattribution can distort uncertainty estimates used by a planner; the direction of the control error depends on how the planner uses uncertainty, as discussed in Stochasticity and Uncertainty.
-
Temporal alignment. The action paired with must match the timing convention used by the model. Actuation latency, clock drift between the control loop and the camera, and buffered logging can break this correspondence. The data may still look plausible frame by frame while the fitted model learns a delayed or smeared action effect. Detecting the defect therefore requires checking action-observation timing rather than individual frames alone.
-
Action fidelity. Commanded actions, measured joint torques, and realized end-effector velocities are different variables. Training with one action representation and querying the model with another creates a systematic interface mismatch. More data expressed through the same mismatched interface does not identify the missing mapping; calibration, paired measurements, or an explicit actuator model can.
-
Episode completeness. Truncated episodes can create false terminal targets if the training pipeline treats the final recorded frame as a genuine terminal state, pads it as stationary, or otherwise ignores censoring. If truncation correlates with failures, an unmodeled termination indicator can also leak logging behavior into the learned dynamics.
-
Label and state-estimate correctness. If states come from a filter or tracker, estimation failures can be absorbed into the learned dynamics unless uncertainty or invalidity is represented. A simulator can expose its internal state directly, avoiding a tracker in simulator coordinates, although those states and the simulated physics can still differ from reality.
The uncomfortable part is that quality is model-relative and task-relative. Repeated noisy observations can help a stochastic model identify a deployment-relevant noise process, but only when the noise is represented appropriately and can be distinguished from latent dynamics. Aggressive, jerky actions may be irrelevant to one task and essential for learning actuator saturation in another. Before you write a filter, name the downstream consumer, the decisions it will make, and which quality dimensions affect those decisions. Filtering removes information as well as corruption, so retain the raw, provenance-linked source whenever policy permits.
Diversity, coverage, and the difference between them
It is tempting to reduce diversity to a single number and optimize it. Don't. Two distinct quantities matter:
- Coverage asks: which regions of the reachable state-action space have support in the data? A query outside that support requires extrapolation, where accuracy is not constrained directly by observations.
- Density asks: how many samples fall in each region under a chosen representation and resolution? Density affects estimation error within a region, but sample count alone does not guarantee a good fit or calibrated uncertainty.
Coverage and density problems can produce different symptoms, but neither has a unique signature. Out-of-support queries may yield implausible rollouts or deceptively smooth ones, while sparse in-support regions may show high error without an explicit rise in predictive variance. Nearest-neighbor distances, histograms, and kernel-density estimates in a task-relevant embedding are diagnostics rather than proofs: their conclusions inherit the representation and distance metric.
The plot below puts the two quantities side by side on the raw dataset. Density is the number of points packed into a region; coverage is whether a region has any points at all. The narrow cloud saturates the nearby region, while the wide cloud reaches far from the origin but is thin.

The separation matters because the two problems suggest different interventions. More data in a covered region can increase density but does not extend empirical support. A simulator or generator can place samples in a previously empty region, but those samples add useful evidence only to the extent that the generator is faithful there.
For a dataset , where is the -th trajectory, a practical coverage diagnostic is the distribution of distances from each held-out query point to its nearest training state. If most held-out states have a nearest neighbor within and a few are far away, you have a localized hole. If the whole distribution shifts outward, you have a global mismatch.
Useful diversity summaries include:
- State-space effective dimension. Fit a PCA or an autoencoder to all observed states and look at how quickly the explained-variance curve saturates. A curve that saturates at two components while the environment is six-dimensional means your data is effectively planar.
- Action spread. For discrete actions, empirical entropy can summarize concentration. For continuous actions, differential entropy is coordinate- and scale-dependent, so pair it with units, marginals, or coverage over a discretized action grid. A concentrated marginal action distribution can still encode many state-dependent decisions; inspect when that distinction matters.
- Regime coverage. A hand-labeled or clustered partition of episodes into qualitatively different situations (walking, turning, recovering, standing still) and the number of episodes per regime.
- Trajectory-shape diversity. The distribution of episode-level summaries such as duration, total displacement, energy, and contact count. Datasets collected by a single scripted controller often have a suspiciously narrow shape distribution.
A frequent pathology is concentration of the behavior policy. If 95% of the data was collected by one scripted controller, the resulting state-action distribution may occupy a narrow region. A learned dynamics model can be accurate there while remaining unconstrained elsewhere. This is the collection-side failure discussed in Interaction Data and Passive Observation, restated as a metric that can be tracked as collection policies change.
There is a persistent tension between collecting data that is typical (representative of what the deployed agent will experience) and data that is informative (unusual enough to constrain the dynamics). A dataset pulled entirely from the deployment distribution is easy to fit but teaches the model nothing about the boundaries of its validity. A dataset pulled entirely from rare events is informative but leaves the routine regime underdense. Good mixtures deliberately contain both, and the mixture weight between them is a knob you tune, not a constant you inherit.
Deduplication, Filtering, and Balancing
Once you can measure quality and diversity, the mechanical work begins. A useful default order is deduplicate, filter, then balance: copies otherwise distort empirical thresholds, and balancing before filtering can amplify corrupted episodes. The order is not universal. For example, source-specific filters may need to run before cross-source deduplication, and protected rare regimes may need separate thresholds before any global pass. Record the order because each step changes the statistics seen by the next.
Deduplication
Duplicates are the most common and most underestimated defect in robot and agent datasets.
- Exact duplicates arise from replay-buffer re-logging, retried uploads, and resumption after a crash. They are trivial to detect with a hash over the episode's bytes, but they are rarely the interesting case.
- Near-duplicates require a task-dependent similarity rule. A robot standing still for a minute while a camera logs at 30 Hz produces 1,800 highly correlated transitions. Repeated grasps or narrowly randomized simulations can likewise form large similarity clusters. Such clusters may dominate an unweighted empirical loss while adding less independent information than their file count suggests. "Effective sample size" has several formal definitions, so use it only with a stated estimator rather than treating it as a property that directly drives gradient descent.
Near-static segments place extra weight on approximately identity transitions. Under a capacity-limited model and an average one-step loss, that weighting can bias predictions toward small changes at the expense of less common motion. Whether rollouts or subsequent collection become conservative depends on the planner, uncertainty treatment, and data-collection loop; it is a failure mode to test, not a guaranteed chain of events.
Practical detectors, roughly in increasing order of cost:
- Exact hashing. A tuple of a few rounded state and action values, or a hash of the serialized episode.
- Summary-statistic bucketing. Discretize episode-level features (net displacement, action range, first state, duration, spectral content) and hash the bucket. Cheap, catches the standing-still family immediately.
- MinHash over sets of action shingles, or SimHash over fixed-dimensional sequence features. MinHash estimates set overlap; SimHash supports similarity search for vectors. Neither identifies contiguous subsequences unless sequence structure is first encoded in shingles or features.
- Embedding-space nearest neighbors. Encode each episode with a documented sequence representation, then flag pairs below a calibrated distance threshold for removal or downweighting. Effectiveness and cost depend on the encoder, index, and dataset size.
- Perceptual hashing of frames. For vision-heavy data, a pHash or a learned frame fingerprint catches scene-level duplication, which is often distinct from action-level duplication.
A useful rule is to inspect duplicates at more than one granularity. Duplicate episodes and repetitive transitions are different problems: an episode with a unique outcome may still contain hundreds of waiting transitions. Transition-level novelty scores or residuals from a preliminary model can support downsampling, but a high residual can also mark corruption and a low residual can mark a common transition that still matters for calibration. Validate any pruning rule against per-regime downstream error.
Filtering
Filtering flags episodes that survived deduplication but may not be trustworthy for a specified use. Candidate signals include roughness under an assumed dynamics prior, residuals from a reference model, forward-backward tracker consistency, signal-to-noise estimates, numeric finiteness, and checks against known bounds such as joint limits. These signals can reveal logging or sensor faults, but legitimate rare dynamics can also look unlike the rest of the dataset.
## Illustrative skeleton: how the pieces fit together
def rough_dedup(episodes, sig_fn):
seen, kept = set(), []
for ep in episodes:
s = sig_fn(ep)
if s in seen:
continue
seen.add(s)
kept.append(ep)
return kept
def filter_low_quality(episodes, score_fn, keep_quantile=0.75):
scores = np.array([score_fn(ep) for ep in episodes])
threshold = np.quantile(scores, keep_quantile)
return [ep for ep in episodes if score_fn(ep) <= threshold], float(
threshold
)Two cautions are worth stating plainly:
- Aggressive filtering creates covariate shift. If your quality score penalizes jerky motion, you will remove precisely the aggressive, dynamic episodes that a controller needs in order to learn what happens near actuator limits. The model then becomes confident and wrong exactly where it matters. The fix is not to loosen the filter uniformly but to filter conditionally: apply a strict quality bar within the routine regime and a looser bar (or none) in regimes you know are intrinsically rough, such as contact, recovery, or high-speed maneuvers.
- Relative and absolute thresholds answer different questions. Quantiles or robust scale estimates adapt to a dataset's numerical range but always retain a fixed fraction, even when the whole dataset is bad. Absolute limits encode external knowledge but require calibration across sensors and embodiments. In practice, combine a relative rule with validated physical or instrumentation bounds when those bounds exist.
Balancing
After deduplication and filtering you often have a distribution that is clean but wrong: several hundred episodes of the robot walking and nine episodes of it turning. Balancing reshapes that distribution toward a target.
The three mechanisms are not interchangeable:
- Reweighting. Keep every episode but assign each a loss weight , where is a regime label, is the desired regime distribution, and is the empirical regime distribution. This requires support overlap: if where , reweighting cannot create evidence. Large weights can produce high-variance gradients. Clipping them trades variance for bias and should be treated as a tuned estimator choice, not a universal rule.
- Resampling. Draw episodes with replacement so the empirical distribution matches the target. Simple and stable in the sense that every batch looks balanced, but oversampling a 9-episode regime eightfold creates near-duplicates of those nine episodes, which is deduplication's problem reintroduced through the back door.
- Stratified or group-robust objectives. Replace or augment average loss with per-group constraints or a worst-group objective. This can emphasize a scarce predefined group, but the result depends on group definitions, regularization, and optimization; naive group DRO need not improve worst-group generalization.
Whatever mechanism you choose, state what means. It might approximate the deployed policy's query distribution, a safety-weighted distribution that deliberately overrepresents hazards, a uniform diagnostic distribution, or a mixture of these. No single choice is correct for every objective. Writing the target and evaluation weights down makes resampling and loss weighting auditable, although it does not mechanically determine filter thresholds or resolve uncertainty about deployment.
Simulation and Procedural Generation
Real data can be expensive or slow to collect, and safety constraints can make some outcomes rare. Synthetic data can target those gaps, with a fidelity cost. The term covers a wide spectrum, and the spectrum matters:
- Scripted simulation. A fixed scenario in a physics engine, replayed for many episodes.
- Domain randomization. The same scenario with scene layout, textures, lighting, mass, friction, latency, and actuator gains resampled every episode.
- Procedural generation. Layouts, object placements, and task configurations synthesized from a grammar or a sampler, producing combinatorially many distinct scenes.
- Learned generation. A generative model of trajectories, scenes, or videos, trained on real data, used to emit new samples.
The core idea in all four cases is the same: you trade physical fidelity for controllable coverage. A simulator with imperfect contact dynamics but perfect state labels and unlimited scenario variation may be far more useful for training a world model than a dataset of flawless real recordings that only ever show the robot succeeding. The trade only pays off when the simulator's imperfections are smaller than the gap it fills, which is why the ranking of "how useful is this simulator" depends entirely on where in the state space you are looking.
What synthetic data is good for
It helps to separate three distinct benefits, because they have different failure modes:
- Coverage expansion. Simulation can sample rare, dangerous, or expensive scenarios without executing them on hardware. These samples constrain the learned model only to the extent that the simulator is valid in those scenarios; targeted real tests remain the stronger evidence when they are feasible.
- Counterfactual branching. Starting from a simulator state, you can roll out several action sequences and obtain action-conditional transitions that were absent from the behavior-policy log. Branching from an estimated real state is only as valid as the state mapping and simulator. This complements the identifiability limits discussed earlier in Actions, Inverse Dynamics, and Latent Actions.
- Privileged labels. Simulators can expose internal state, poses, contacts, object identities, and unoccluded geometry without a perception pipeline. These labels are exact with respect to the simulator's own state, not necessarily with respect to the real system or the representation needed for control.
The fidelity gap is a distribution shift, not a verdict
Simulation creates a distribution shift between and . If the training target were exactly the kernel mixture
at a fixed , then total variation obeys the identity
This identity describes the idealized mixture distribution, not the error of a learned model. Finite samples, model misspecification, optimization, and different state-action marginals add other error terms.
Two consequences follow. First, simulated data is most valuable where real data has no support, because there the alternative is zero coverage rather than a small bias. Second, adding simulated data to a well-covered real regime can actively hurt: you are injecting bias in exchange for density you did not need. The mixture weight should be high where the coverage gap is large and low where it is small, which is exactly the trade-off the next section formalizes. Practically, this means you should define coverage per region before you set any synthetic weight, so that the entire allocation step is a function of measurements rather than intuitions.
Model-based synthetic data and collapse
Another form of synthetic data is to roll out a learned world model and train on those results. Dyna architectures integrate learned models with planning and learning, as discussed in Model-Based Reinforcement Learning. Short rollouts limit how far each synthetic trajectory can drift, but they do not remove model bias.
Recursive training can fail when generated samples replace or overwhelm the original data. Shumailov and colleagues call the resulting loss of information about the original distribution model collapse and demonstrate tail loss for several model families. Collapse is not inevitable under every recursive protocol: retaining real anchors, accumulating data, using faithful generators, or changing the estimator can alter the outcome. For world models, the corresponding risk is that rollout errors and underrepresented regimes are fed back into later training rounds.
The following controlled illustration isolates one collapse mechanism: selection against tails. It starts from 4,000 samples from a Student- distribution with three degrees of freedom, fits a Gaussian, generates 4,500 candidates, retains only the central 95%, and repeats for ten rounds with seed 7. The plotted statistic is the empirical 99th percentile of . The central-selection step, not maximum likelihood by itself, drives the monotone contraction; a Gaussian fit resampled without truncation would fluctuate around a stable variance in expectation.

This example should not be read as proof that every self-training loop collapses. It shows how a plausible selection rule can compound: once tail samples are discarded, the next fitted generator sees a narrower target and produces fewer candidates that could restore them.
The practical defenses are:
- Keep a frozen anchor set of real data in every training round and record a positive minimum weight for it.
- Maintain a real-data validation set and monitor divergence between model rollouts and real trajectories per regime.
- Bound the rollout horizon for training data drawn from the model, since error compounds with horizon (a theme we developed in Predictive and Generative Objectives).
- Track mode coverage of the generated data with the same diagnostics you use for real data, and treat any decline as a stop signal.
- Diversify generators. Ensembling several differently-seeded or differently-configured simulators reduces the chance that one model's blind spots become the training set's laws.
A useful mental model is that real observations provide evidence about the deployed system, while synthetic data contributes assumptions from a simulator or learned generator. Synthetic samples can be valuable where real evidence is scarce, but their weight should depend on validation against real held-out trajectories.
Data Mixtures, Provenance, and Contamination
The final stage turns curated sources into a training distribution. Mixture choices can shift performance between regimes, while leakage across a split boundary makes the evaluation optimistic and can hide regressions. The size of either effect is empirical; it should be measured rather than assumed.
Mixtures and how to choose them
Suppose you have sources, each with its own distribution over trajectories, and you train on
where:
- : the number of data sources being mixed
- : the distribution of trajectories from source
- : the mixture weight assigned to source , a non-negative scalar with
- : the resulting mixture distribution over trajectories
The weights are hyperparameters that change the population risk being optimized. They do not change the formal model class, but they can change which fitted solution the training procedure favors. Three practical approaches to setting them are:
- Proxy sweeps. Train smaller proxy models under candidate mixtures and compare them on a regime-stratified development set. This is useful only when proxy rankings predict the full training run; check that assumption on a few mixtures before relying on it.
- Direct weight fitting. Estimate development loss as a function of the mixture, then optimize the fitted response surface for a stated target risk. The response model and extrapolation range become additional assumptions to validate.
- Domain balancing heuristics. Equalize transitions per regime, target a desired per-regime contribution, or upweight groups with poor development performance. These rules are simple, but what they equalize encodes the objective.
Sampling and loss weighting can target the same expected objective when their probabilities and weights are matched correctly. Their finite-batch gradient variances depend on the losses, sampling scheme, and normalization; neither is uniformly lower variance. Mixture weights should be revalidated when source distributions, deployment goals, or the model class change.
Provenance
Every episode should carry metadata answering: where did this come from, collected by what, with which version of the code, under which license, and what processing steps has it been through? Concretely, the provenance record for a world-model dataset typically includes:
- Source identity: real robot, specific simulator build, human video, learned generator, and the generator's checkpoint hash.
- Collection context: date, location, operator, policy version, task specification, and the seed for any randomized component.
- Processing history: every filter, deduplication pass, resampling operation, and transformation applied, in order, with parameters.
- License and consent: critical for human video, and often forgotten until a model ships.
Provenance supports reproducibility, regression tracing, and answers to questions such as "did we train on this episode?" It also enables contamination audits: without source identifiers and transformation history, mechanical split checks cannot reconstruct how an example entered the dataset.
Contamination
Contamination means evaluation data, or information derived from it, has influenced training or model selection in a way the reported protocol does not allow. For world models, leakage can occur at several correlated units: transitions, trajectories, collection sessions, scenes, embodiments, and simulator configurations.
Consider the naive split: shuffle all transitions and assign 90% to train, 10% to test. Adjacent transitions from one trajectory are strongly dependent and can share observations, so this split does not measure generalization to new trajectories. An episode-level split is better for that question but still does not measure generalization across sessions, scenes, robots, or calibrations when those factors appear on both sides. A model can exploit shared nuisance variation and score well without transferring to a new setting.
Design the split around the factor you want the model to generalize across:
- If you care about generalization to new scenes, split by scene, and ensure no scene appears on both sides.
- If you care about generalization across days or calibration drift, split by collection session.
- If you care about generalization across embodiments, split by robot or by simulator configuration.
- If you care about generalization from simulation to reality, hold out reality entirely.
Then verify identifiers and content mechanically rather than trusting folder structure. Exact IDs and hashes catch direct reuse; perceptual hashes can flag near-duplicate frames; nearest-neighbor searches in a documented embedding can surface suspicious cross-split similarity for review. A small distance is not by itself proof of leakage, because legitimate repeated states can be close.
There is a second contamination channel through synthetic generation. If a generator is fitted using evaluation examples and then emits training samples, information from the evaluation set has influenced training even if no generated sample is byte-identical to it. Hold out evaluation data before fitting any generator used for training data, and keep generator selection and tuning on the development split.
Finally, note the interaction between contamination and curation: a filter tuned on the evaluation set is itself a leak. If you choose your roughness threshold by looking at which threshold maximizes held-out rollout accuracy, you have fit the threshold to the test set, and the reported number is optimistic. Tune filters on a development split, and keep a third split untouched until the end. This three-way split, train on train, tune on dev, report on test, is a small amount of extra discipline that pays off every time you need to trust your own numbers.
A Worked Curation Pipeline
Let us build the pipeline end to end on a small, fully controlled system where the data-generating dynamics are known. The experiment measures how each step changes one fixed linear estimator; it does not estimate how valuable that step will be for a different model or task. We use a two-dimensional nonlinear system with control input:
where:
- : the state at time (two-dimensional)
- : the control input at time
- : the state transition matrix
- : the control input matrix
- : a small scalar coefficient controlling the strength of the cubic nonlinearity
- : the elementwise cube of , i.e.,
- : process noise, a two-dimensional Gaussian with zero mean and covariance
- : the process noise standard deviation
- : the identity matrix
The cubic term makes the dynamics nonlinear, with a contribution that grows with state magnitude. A linear model fitted only in the small-state regime cannot represent that term and can extrapolate poorly at larger magnitudes. Wider-state data reveals the misspecification, although data alone cannot make the linear class express the cubic dynamics. This distinction becomes important when we interpret balancing below.
We deliberately construct a problematic dataset: it contains exact duplicates, is dominated by a narrow region of state space, and includes 40 observation-corrupted episodes out of 160. We then run deduplication, quality filtering, balancing, and synthetic augmentation, measuring autoregressive rollout error on held-out trajectories from both regions. Feeding each prediction back as the next model input exposes compounding transition error. It is still not a full control evaluation because no planner selects actions from the learned model.
Building the deliberately bad dataset
We start with the known dynamics and a trajectory generator. Actions follow a slowly varying AR(1) process rather than independent draws, so action jitter contributes less to the roughness score used later. Every episode has the same small process-noise scale; the corrupted group receives additional independent observation noise after latent-state generation. This distinction matters because filtering legitimate process stochasticity would change the environment regime rather than repair a sensor defect. The smooth action process is an experimental design choice, not a universal property of real control logs: when commanded actions contain abrupt changes, a quality detector should condition on them rather than equating state roughness with corruption.
import numpy as np
# Ground-truth nonlinear dynamics, with weak control authority.
A_TRUE = np.array([[0.93, 0.11], [-0.09, 0.86]])
B_TRUE = np.array([[0.06, 0.00], [0.00, 0.06]])
CUBIC = 0.05
HORIZON = 40def make_episodes(n, process_noise, rng, s0_scale=1.0, observation_noise=0.0):
"""Generate latent dynamics, then optionally corrupt the observations."""
episodes = []
for _ in range(n):
s0 = s0_scale * rng.uniform(-1.0, 1.0, size=2)
action = np.zeros(2)
actions = []
for _t in range(HORIZON):
action = 0.97 * action + 0.20 * rng.standard_normal(2)
actions.append(action.copy())
actions = np.asarray(actions)
state = s0.copy()
states = [state.copy()]
for a in actions:
state = A_TRUE @ state + B_TRUE @ a - CUBIC * state**3
state = state + process_noise * rng.standard_normal(2)
states.append(state.copy())
latent_states = np.asarray(states)
if observation_noise > 0:
observed_states = (
latent_states
+ observation_noise * rng.standard_normal(latent_states.shape)
)
else:
observed_states = latent_states.copy()
episodes.append(
{
"states": observed_states,
"actions": actions,
"s0": observed_states[0].copy(),
"process_noise": process_noise,
"observation_noise": observation_noise,
"scale": s0_scale,
}
)
return episodesNow we assemble the corrupt dataset. It has four populations: 80 clean narrow episodes, 40 noise-corrupted narrow episodes, only 10 wide-region episodes, and 30 exact copies of the first 30 clean episodes. The imbalance is intentional and exaggerated, so that every curation step has an obvious effect on the resulting model. In real data the imbalance is usually milder but is spread across many more sources, which is what makes it so hard to spot by eye.
rng = np.random.default_rng(20240517)
clean = make_episodes(80, process_noise=0.01, rng=rng, s0_scale=1.0)
for ep in clean:
ep["group"] = "clean-narrow"
noisy = make_episodes(
40,
process_noise=0.01,
rng=rng,
s0_scale=1.0,
observation_noise=0.35,
)
for ep in noisy:
ep["group"] = "noisy-narrow"
wide = make_episodes(10, process_noise=0.01, rng=rng, s0_scale=3.0)
for ep in wide:
ep["group"] = "clean-wide"
duplicates = [
{
"states": ep["states"].copy(),
"actions": ep["actions"].copy(),
"s0": ep["s0"].copy(),
"process_noise": ep["process_noise"],
"observation_noise": ep["observation_noise"],
"scale": ep["scale"],
"group": "duplicate",
}
for ep in clean[:30]
]
raw_dataset = clean + noisy + wide + duplicatesEpisodes in raw dataset : 160
Transitions per episode : 40
Total reported transitions: 6,400
clean-narrow: 80 episodes
noisy-narrow: 40 episodes
clean-wide: 10 episodes
duplicate: 30 episodesThe headline count is misleading. Thirty of the "episodes" are byte-identical copies, so about 19% of the reported dataset carries no new information at all. That is the first thing deduplication will fix.
Scoring quality
Our quality score is the mean Euclidean norm of the second difference of the observed state sequence. For an additive scalar observation-noise sequence with independent terms of variance , the noise component of has variance . The score therefore amplifies independent high-frequency noise, but it also responds to action changes and genuine nonlinear acceleration. It is model-free in the sense that it does not fit a dynamics model; it is not assumption-free.
def roughness(episode):
"""Mean Euclidean norm of the second difference of the state sequence."""
second_diff = np.diff(episode["states"], n=2, axis=0)
return float(np.mean(np.linalg.norm(second_diff, axis=1)))
for ep in raw_dataset:
ep["roughness"] = roughness(ep)
scores_by_group = {
g: np.array([ep["roughness"] for ep in raw_dataset if ep["group"] == g])
for g in ["clean-narrow", "clean-wide", "duplicate", "noisy-narrow"]
} clean-narrow: mean roughness = 0.0260 max = 0.0308
clean-wide: mean roughness = 0.0433 max = 0.0716
duplicate: mean roughness = 0.0266 max = 0.0297
noisy-narrow: mean roughness = 1.1212 max = 1.4169In this seeded toy dataset, the mean roughness of the noisy group is more than an order of magnitude above each clean-group mean. Let us inspect the full distribution before selecting a threshold.

The orange marks are medians. In this constructed example every high-noise episode has a larger roughness score than every clean episode, including the wide-region trajectories whose larger states produce more curvature. A quantile threshold need not lie in that gap, however: the 75th-percentile rule below retains seven of the 40 noisy episodes because it is defined to keep 75% of the deduplicated data. When score distributions overlap, conditional or multi-signal rules may preserve rare valid dynamics better than a global cutoff.
Deduplication and quality filtering
Now the mechanics. We deduplicate with an exact fingerprint over the initial state and the first few actions, then filter the noisiest quartile.
def signature(episode, decimals=8):
"""Cheap exact-match fingerprint: initial state plus the first few actions."""
key = np.concatenate([episode["s0"], episode["actions"][:4].ravel()])
return tuple(np.round(key, decimals))
def deduplicate(episodes):
seen, kept = set(), []
for ep in episodes:
sig = signature(ep)
if sig in seen:
continue
seen.add(sig)
kept.append(ep)
return kept
deduped = deduplicate(raw_dataset)
scores = np.array([ep["roughness"] for ep in deduped])
threshold = float(np.quantile(scores, 0.75))
filtered_deduped = [ep for ep in deduped if ep["roughness"] <= threshold]raw : 160 episodes {'clean-narrow': 80, 'clean-wide': 10, 'duplicate': 30, 'noisy-narrow': 40}
after dedup : 130 episodes {'clean-narrow': 80, 'clean-wide': 10, 'noisy-narrow': 40}
roughness threshold (q75): 0.9692
after quality filter : 97 episodes {'clean-narrow': 80, 'clean-wide': 10, 'noisy-narrow': 7}Deduplication removes the 30 constructed copies. The 75th-percentile quality filter removes 33 of the 40 noisy episodes and retains all 90 clean episodes, including the 10 wide-region episodes. Those counts validate the rule only for this seeded construction. In a real project, select the statistic and threshold on a development split, report per-regime retention, and test sensitivity to the cutoff.
Balancing coverage of the state space
What remains is clean but radically imbalanced. The wide-region episodes are a tiny fraction of the whole, so any model fitted to this data will be dominated by the narrow regime. We rebalance by resampling the smaller bucket with replacement up to the size of the larger one.
def region_label(episode):
return "wide" if episode["scale"] > 2.0 else "narrow"
def resample_balanced(episodes, regions=("narrow", "wide"), seed=0):
"""Resample every region up to the size of the largest region."""
local_rng = np.random.default_rng(seed)
buckets = {
r: [ep for ep in episodes if region_label(ep) == r] for r in regions
}
non_empty = {r: b for r, b in buckets.items() if b}
target = max(len(b) for b in non_empty.values())
balanced = []
for region, bucket in non_empty.items():
idx = local_rng.integers(0, len(bucket), size=target)
balanced.extend(bucket[i] for i in idx)
return balanced, target
counts_before = {
r: sum(region_label(ep) == r for ep in filtered_deduped)
for r in ("narrow", "wide")
}
balanced_deduped, target_per_region = resample_balanced(
filtered_deduped, seed=3
)
counts_after = {
r: sum(region_label(ep) == r for ep in balanced_deduped)
for r in ("narrow", "wide")
}before balancing: {'narrow': 87, 'wide': 10} (total 97)
after balancing: {'narrow': 87, 'wide': 87} (total 174)
target per region: 87
Balancing is not free. Oversampling the ten wide episodes up to parity repeats each of them many times, deliberately changing their loss contribution without adding support. Generating new wide-region samples can avoid exact repetition, but only by importing assumptions from the generator. The next step demonstrates that trade-off.
Synthetic augmentation
We fit a linear transition model to the cleaned toy data and use it as a lightweight generator, sampling fresh wide-region initial states and the same action process used in the real-data generator. This is not independent evidence: the synthetic transitions inherit the fitted linear model's bias. They increase the number of distinct sampled trajectories in a target region, while their fidelity remains bounded by the learned generator.
def fit_linear_model(episodes):
"""Least-squares fit of s_{t+1} = A s_t + B a_t over all transitions."""
x = np.concatenate(
[np.hstack([ep["states"][:-1], ep["actions"]]) for ep in episodes]
)
y = np.concatenate([ep["states"][1:] for ep in episodes])
theta, *_ = np.linalg.lstsq(x, y, rcond=None)
return theta
def step(theta, state, action):
"""Apply a fitted linear transition model."""
return state @ theta[:2] + action @ theta[2:]
theta_clean = fit_linear_model(clean)True A: [[ 0.93 0.11] [-0.09 0.86]] Fitted A from clean narrow episodes only: [[ 0.913 0.108] [-0.09 0.847]]
For this seeded fit, the diagonal entries are smaller than those of . The cubic term contributes state-dependent contraction, and least squares absorbs part of its average effect into the fitted linear coefficients. At larger state magnitudes, the omitted cubic contribution is stronger, so the linear model cannot represent the true transition with one constant matrix. Additional narrow-regime data can reduce estimation variance but cannot identify large-state behavior that is absent from the sample or remove this model-class misspecification.
def synthesize(theta, n, s0_scale, process_noise, rng, label="synthetic"):
"""Roll out a fitted model to produce new, region-targeted episodes."""
episodes = []
for _ in range(n):
s0 = s0_scale * rng.uniform(-1.0, 1.0, size=2)
action = np.zeros(2)
actions = []
for _t in range(HORIZON):
action = 0.97 * action + 0.20 * rng.standard_normal(2)
actions.append(action.copy())
actions = np.asarray(actions)
state = s0.copy()
states = [state.copy()]
for a in actions:
state = step(theta, state, a) + process_noise * rng.standard_normal(
2
)
states.append(state.copy())
episodes.append(
{
"states": np.asarray(states),
"actions": actions,
"s0": s0,
"process_noise": process_noise,
"observation_noise": 0.0,
"scale": s0_scale,
"group": label,
"roughness": roughness({"states": np.asarray(states)}),
}
)
return episodes
theta_gen = fit_linear_model(filtered_deduped)
synthetic_wide = synthesize(
theta_gen,
n=40,
s0_scale=3.0,
process_noise=0.01,
rng=rng,
label="synthetic-wide",
)The generator inherits the linear model's misspecification and the weighting of its fitting set. It starts trajectories in the wide region, but those transitions follow the learned linear dynamics rather than the known cubic dynamics. The synthetic episodes therefore increase nominal regional coverage while remaining imperfect in fidelity. We evaluate that distinction against real held-out trajectories from each region below.
Comparing data mixtures
We now fit the same linear model class to six versions of the same source and evaluate each by autoregressive rollout on held-out trajectories from both regions. The model's predictions are fed back as inputs while the recorded actions remain fixed. This measures open-loop action-sequence prediction with closed-loop state recursion; it does not measure a planner choosing actions from the model. We also include a balanced, clean "reference collection" of 150 narrow and 150 wide episodes. It is a data reference, not an oracle model: the fitted predictor is still linear while the true dynamics are cubic.
# Held-out evaluation trajectories from both regions.
eval_rng = np.random.default_rng(99)
eval_narrow = make_episodes(15, process_noise=0.01, rng=eval_rng, s0_scale=1.0)
eval_wide = make_episodes(15, process_noise=0.01, rng=eval_rng, s0_scale=3.0)
eval_sets = {"narrow": eval_narrow, "wide": eval_wide}
# A clean, balanced reference collection for the same misspecified model class.
reference = make_episodes(
150, process_noise=0.01, rng=rng, s0_scale=1.0
) + make_episodes(150, process_noise=0.01, rng=rng, s0_scale=3.0)def rollout_error(theta, episodes):
"""Mean per-step error when the model feeds its own predictions back in."""
errors = []
for ep in episodes:
state = ep["states"][0].copy()
for action, target in zip(ep["actions"], ep["states"][1:]):
state = step(theta, state, action)
errors.append(float(np.linalg.norm(state - target)))
return float(np.mean(errors))
mixtures = {
"raw": raw_dataset,
"dedup": deduped,
"dedup + filter": filtered_deduped,
"dedup + filter + balance": balanced_deduped,
"dedup + filter + balance + synth": balanced_deduped + synthetic_wide,
"reference mix": reference,
}
mixture_errors = {}
for name, data in mixtures.items():
theta = fit_linear_model(data)
mixture_errors[name] = {
k: rollout_error(theta, v) for k, v in eval_sets.items()
} mixture | episodes | narrow | wide
----------------------------------------------------------------------
raw | 160 | 0.172 | 0.284
dedup | 130 | 0.178 | 0.299
dedup + filter | 97 | 0.110 | 0.163
dedup + filter + balance | 174 | 0.119 | 0.175
dedup + filter + balance + synth | 214 | 0.116 | 0.172
reference mix | 300 | 0.102 | 0.145
Read the chart with three questions in mind:
- What did deduplication and filtering change? Exact deduplication alone moves mean per-step error from 0.172 to 0.178 in the narrow region and from 0.284 to 0.299 in the wide region. Equal copies change the empirical objective but do not guarantee a better estimator. Filtering then lowers the errors to 0.110 and 0.163, respectively, in this seeded run.
- Did balancing solve the coverage problem? No. Resampling to parity raises the errors to 0.119 and 0.175. The wider states expose stronger cubic dynamics, but the fitted class is linear. Repeating those episodes cannot express the missing term and shifts the compromise fit in a way that hurts both reported regions. This is why balancing must be validated with the intended model class rather than judged by counts.
- What did synthetic augmentation contribute? Relative to the resampled mixture, adding learned synthetic wide trajectories lowers the errors to 0.116 and 0.172, but it does not beat the filtered-only mixture. The synthetic generator shares the linear model's bias. The clean balanced reference collection performs best in this run (0.102 narrow, 0.145 wide), while retaining error from the misspecified linear model. Better collection policies could improve the evidence available to a suitable model; we return to that idea in Active Perception, Dual Control, and Exploration.
The synthetic-augmented mixture is not best on wide-region error in this run. Here we know the generator is biased because it omits the cubic term; in a real pipeline the result could also reflect sampling variance, optimization, or an unsuitable target mixture. Synthetic data can expand nominal coverage, but fidelity must be tested on real held-out trajectories.
Limitations & Impact
Every technique in this chapter is a heuristic that trades one kind of error for another, and none of them is free.
- Curation optimizes proxies. Roughness, prediction residuals, cluster counts, and nearest-neighbor distances do not by themselves establish downstream performance. A dataset can score well on aggregate data-quality metrics while missing an action-alignment defect or control regime. When the intended consumer is a planner, validate material curation choices by retraining the model and measuring planner outcomes as well as data statistics.
- Filters have a horizon problem. A filter tuned for one-step residuals can favor episodes already handled well by the preliminary model, removing difficult but valid regimes along with corruption. Conditional filtering can use looser thresholds in intrinsically rough regimes, but those regime definitions are themselves modeling assumptions that require validation.
- Balancing can conflict with deduplication. As the worked example showed, resampling a scarce regime up to parity repeats a handful of episodes and changes their loss weight without creating new support. Generating new samples with a simulator avoids exact repetition but imports simulator bias instead. Choose the trade-off by measuring per-regime downstream error and calibration.
- Synthetic data adds information from its generator, not new empirical evidence about the deployed system. A simulator, procedural generator, or learned rollout model can make assumptions explicit and cheaply explore them. Its mixture weight should depend on measured real-data coverage, simulator validation, and the cost of the target error; plentiful real data does not by itself imply a zero synthetic weight.
- Contamination can inflate evaluation. Transition-level random splits share trajectory context across train and test, while episode-level splits can still share scene, session, or calibration factors. Report the split unit and the generalization factor it is designed to test.
- Provenance and licensing constrain which data may be used and how results can be reproduced. For human video, record source, consent basis, license, processing history, and applicable retention restrictions when the data enters the pipeline; reconstructing that record later can be difficult or impossible.
Together, these techniques let you state and test what evidence a model receives. Deduplication changes repeated examples' weight; filtering trades suspected corruption against selection bias; balancing changes the target risk; simulation adds controllable but assumption-laden trajectories; and provenance makes those choices traceable. None guarantees competence outside the training support. They make the limitations measurable, which is the prerequisite for using the decision-centric models discussed in Part VIII: Decision-Centric Research Lineages.
The natural next question is what happens when data does not stop arriving. Real fleets produce a continuous stream, and a curated static dataset is a snapshot of a moving target. Distribution shift, replay, forgetting, and the choice between training from scratch and updating in place are the subject of Online, Offline, and Continual Learning.
Summary
- A world model is a compression of its training distribution, so curation determines what the model can learn. It is a modeling decision, not a preprocessing chore.
- Quality is not one number: it decomposes into signal-to-noise, temporal alignment, action fidelity, episode completeness, and label correctness, each with its own detector. It is also model- and task-relative, so define the target before writing filters.
- Coverage and density are distinct diagnostics. Nearest-neighbor distances and density estimates in a task-relevant embedding can flag holes or sparse regions, but they inherit the representation and are not proofs of model error.
- Deduplication can operate at episode and transition granularity. Exact hashing catches exact copies; shingled or embedding-based similarity rules flag candidates for calibrated downweighting or removal.
- Filtering suspected corruption changes the training distribution. Relative thresholds adapt to scale, absolute thresholds encode external bounds, and both require per-regime validation.
- Balancing reshapes the training objective toward a stated target distribution. Reweighting, resampling, and group-robust objectives have different bias, variance, and repetition properties; resampling repeats examples from scarce groups.
- Synthetic data trades empirical fidelity for controllable coverage. Simulation, procedural generation, and learned rollouts inherit their specifications and must be validated against real held-out data.
- Recursive training can lose tails or modes when generated data replaces or overwhelms real data. Frozen real anchors, bounded rollout horizons, generator diversity, and per-regime monitoring are useful safeguards, not guarantees.
- Mixture weights change the population risk optimized within a fixed model class. Choose them with validated proxy sweeps, direct response-surface fitting, or explicit balancing heuristics, and write down the target distribution.
- Provenance records source, collection context, processing history, and license for every episode. It is the prerequisite for reproducibility, for debugging, and for compliance.
- Split by the factor you want to generalize across, such as trajectory, scene, session, or embodiment, and verify identifiers, exact reuse, and suspicious near-duplicates mechanically. Hold out evaluation data before training any generator used for augmentation.
- Match evaluation to the downstream decision. The worked example measures autoregressive state rollout under fixed recorded actions; a planner-facing claim additionally requires running the planner and reporting task outcomes per regime.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about data curation and synthetic data for world models.
Data Curation and Synthetic Data
Reference
Citation details
Cite or share this article.
Continue with the full handbook
This chapter is part of World Models Handbook. Use the handbook page to browse the complete table of contents and continue reading in sequence.
Explore World Models HandbookStay up to date
Get articles, book updates, and news delivered to your inbox.
No spam, unsubscribe anytime.
Join the community
Sign in to remove popups, track your reading progress, and join the discussion.

Comments
No comments yet. Be the first to share your thoughts!