Randomizing Social Behavior in Simulation to Train Joint Trajectory Predictors

Self-driving cars and delivery robots have to forecast how a group of road users will move together: who yields at the merge, who goes first at the unprotected left turn. Models that predict all agents jointly are now good at this when trained and tested on the same kind of real driving logs. They struggle when deployment brings interactions the logs rarely contain, such as an assertive merge or a driver who refuses to yield. Robotics has a well-tested answer to "the training distribution is too narrow." Domain randomization trains a policy in a simulator whose parameters (friction, mass, lighting) are deliberately varied across episodes, so the policy cannot rely on any one setting and transfers to the real world without real fine-tuning. That method has never been applied to the thing joint predictors actually get wrong, which is the social parameters that decide interaction outcomes.

This note proposes behavioral domain randomization for joint multi-agent forecasting. We replay real road geometry and real initial agent states. We then hand control of the agents to reactive planners whose objectives are randomized per agent and per episode: how much each agent values its own progress, how much gap it will accept, how much it cares about others' progress, and how late it reacts. The planners are iterated until the scene settles into a mutually consistent outcome. The resulting synthetic scenes show the same intersection resolving in many different ways. A joint predictor trained on them, and asked to infer each agent's social type from its observed history, should transfer to an unseen real dataset better than a predictor trained on source-domain logs alone. The gains should concentrate on rare interaction outcomes.

Core Claim

The reality gap for joint trajectory prediction is mostly a gap in interaction outcomes, not in kinematics or map geometry. We therefore claim two things. First, randomizing the cost functions of reactive simulated agents placed on real maps produces coverage of interaction equilibria that real logs lack. Second, pairing that data with a per-agent latent "social type" avoids the dilution that naive data mixing causes. The testable consequence is concrete. Train a joint predictor on nuPlan logs plus behaviorally randomized simulation built only on nuPlan maps, then evaluate it zero-shot on the Waymo Open Motion Dataset (WOMD). It should beat the same model trained on nuPlan logs alone, with the largest margins on interactive pairs whose outcome is rare in the source data.

Why This Is Not Already Done

The research file shows the pieces exist separately. Physical randomization of mass, friction and latency for quadruped gaits (Sim-to-Real: Learning Agile Locomotion For Quadruped Robots) and visual randomization for drone flight ((CAD)$^2$RL) supply the method. Both randomize the physics or the pixels, never the intent of other agents.

SimScale is the closest driving work. It builds photorealistic reactive simulation from NAVSIM logs and co-trains planners on it. Its surrounding vehicles follow the fixed Intelligent Driver Model (a rule-based car-following controller), which the authors themselves say limits scenario diversity. SimScale randomizes the ego's trajectory; we randomize everyone else's objectives.

Discovering Diverse Multi-Agent Strategic Behavior via Reward Randomization shows that randomizing reward weights uncovers equilibria that standard training misses: a reward of about 257 versus about 75 for plain policy gradient in Monster-Hunt. It also shows that an adaptive policy trained over the randomized population handles unseen opponents. That paper motivates our design but works only in gridworlds and Agar.io. We carry its idea into continuous vehicle kinematics on real road graphs, and we use the generated population as training data for a predictor rather than as opponents for a policy.

Two papers handle distribution shift purely with real data. AdapTraj does multi-source domain generalization across real pedestrian datasets. CTP-Net aligns source and target features adversarially, which requires unlabeled target-domain data. Neither generates new interactions.

Joint predictors supply the model and the metrics: JFP, SMART and JointMotion. All three train only on recorded logs.

Constraints From Prior Work

Two results constrain the design rather than motivate it.

The first is AdapTraj's "averaging trap." Naively pooling heterogeneous trajectory sources makes backbones average away interaction patterns and degrades generalization. A pile of randomized synthetic behavior is exactly such a heterogeneous pool. That is why the predictor carries an explicit per-agent social latent instead of absorbing all the variation into one unconditional distribution.

The second pulls the other way. SMART reports power-law improvement as diverse multi-source data scales to a billion tokens. Which regime randomized synthetic data falls into is an open empirical question, and our experiments are built to answer it.

The domain-randomization literature also warns that overly wide ranges produce over-conservative behavior. We therefore test randomization ranges that are uniform and wide against ranges calibrated toward observed log statistics, in the spirit of Neural Posterior Domain Randomization.

Research Program

The generator. For each nuPlan scene we keep the map and the agents' states over the first second. Every agent then becomes a short-horizon sampling-based model-predictive planner, meaning a controller that repeatedly re-plans a few seconds ahead. Agent $i$ minimizes

$$J_i = \sum_t \big[ -w^{p}_i\,\text{prog}_i(t) + w^{c}_i\,\text{jerk}_i(t)^2 + w^{s}_i\,\text{risk}_i(t) - w^{k}_i \textstyle\sum_{j\neq i}\text{prog}_j(t) \big]$$

The terms are:

  • $\text{prog}_i(t)$ is route progress at step $t$.
  • $\text{jerk}_i(t)$ is the rate of change of acceleration, a comfort penalty.
  • $\text{risk}_i(t)$ is a time-to-collision penalty.
  • The courtesy weight $w^{k}_i$ rewards agent $i$ for others' progress, borrowing the linear-reward randomization of the reward-randomization paper.

On top of these cost weights we sample a reaction latency, a perception noise level on others' positions, and a desired speed. Agents re-plan by iterated best response for a few rounds per step, so outcomes are mutually reactive rather than replayed.

We discard rollouts with collisions or kinematically infeasible motion. We also cluster outcomes by which agent passes each conflict point first. We then resample so that rare orderings, such as the merging car going first, are well represented.

The predictor. The backbone is the SMART next-token transformer. It is open, reports strong realism, and has a published nuPlan-to-WOMD zero-shot number to compare against. We add a per-agent latent head that infers social type from the observed history. In simulation this head is supervised with the true sampled weights. On real data it is left unsupervised and regularized toward the simulation prior. This is the adaptive-policy idea from reward randomization, applied to prediction.

Analysis. We will measure three things:

  • How performance changes as the synthetic-to-real token ratio grows, which settles averaging trap versus power-law scaling.
  • Which randomized parameters matter.
  • Whether gains concentrate on rare interaction outcomes.

Secondary setting. We repeat the recipe in a lighter pedestrian setting. Crowd agents use randomized reciprocal-avoidance parameters, the predictor is trained on ETH/UCY plus simulation, and it is tested zero-shot on the Stanford Drone Dataset. This is a cheap check that the effect is not specific to driving.

Baselines

Naive reference points. The do-nothing reference is the identical SMART-style model trained only on nuPlan logs and evaluated zero-shot on WOMD. SMART reports a realism score of 0.72 on Waymo when trained only on nuPlan, against a meta-metric of 0.7614 for its WOMD-trained model. We will reproduce our own nuPlan-only number under our compute rather than rely on theirs, because challenge metric versions differ. The in-domain WOMD-trained model is an upper reference, not a competitor.

Fairness. All models get the same parameter count, the same number of gradient steps, and the same hyperparameter search budget. Real-only models see upsampled real data so that every arm trains on equal token counts. Beating the baseline means a statistically reliable improvement over the nuPlan-only model, across three seeds, on WOSAC realism and on joint minFDE and overlap rate on the WOMD interactive validation split.

Strongest simulation competitor. This is a SimScale-style pipeline: the same reactive simulator, but with agents running the Intelligent Driver Model at fixed parameters. It isolates whether randomization, rather than simulation per se, does the work.

Strongest real-data competitor. Here we pick per setting. For joint consistency it is JFP-style joint decoding; JFP reports overlap rate falling from 0.064 to 0.030 relative to MultiPath++ on WOMD interactive validation. Our predictor should not raise overlap above the real-only model. For pedestrians it is AdapTraj, which reports ADE 0.911 and FDE 1.670 on held-out SDD with a PECNet backbone (vanilla PECNet: 0.948 and 1.785). Beating it means lower SDD error with the same backbone and sources plus simulation.

Ablations. The key ablation splits the randomization. One arm randomizes only marginal parameters (desired speed, latency, noise). The other also randomizes the interaction parameters (gap acceptance, courtesy, risk weight). If the marginal-only arm matches the full arm, our central claim that interaction outcomes are the gap is wrong. Further ablations remove the social latent (tests the averaging trap) and swap calibrated ranges for uniform wide ranges (tests over-conservatism).

Why not just…?

Why not just scale real logs, as SMART does? This is the most serious threat. SMART's power-law results suggest that more real data may beat any synthetic substitute. Our data-ratio sweep settles it directly: we add synthetic tokens to fixed real budgets of 1%, 10% and 100% of nuPlan. If synthetic gains vanish at 100% and appear only in the scarce regime, we will report the contribution as a data-efficiency result rather than a transfer result. If they persist only on rare-outcome strata, that supports the claim that logs undersample those outcomes no matter how many are collected.

Why not just randomize the parameters of the Intelligent Driver Model? It is cheap, and it is the natural first try. The model is a single-lane car-following rule with no notion of negotiating a conflict point, however, and the Waymo Open Sim Agents Challenge (paper) finds such rule-based agents too simplistic for intersections. We include randomized-IDM as an extra arm. If it matches the cost-randomized planners, the planner machinery is unnecessary and we will say so.

Why not just perturb the logged trajectories, as SMART's token noise or SimScale's ego perturbations do? Perturbation creates off-distribution states but keeps the recorded outcome: the other agents' futures still follow the original log, so who-goes-first never changes. We test this with a log-perturbation arm matched in token count. The prediction is that it improves rollout stability but not rare-outcome joint accuracy.

Why not just use multi-source domain generalization, as AdapTraj does? AdapTraj needs several real source domains and still only recombines behaviors that were recorded. It is complementary rather than competing. In the pedestrian setting we run AdapTraj with and without the synthetic source to see whether the gains add up.

Decisive Checks

The central experiment is nuPlan-plus-randomized-simulation evaluated zero-shot on WOMD. We stratify WOMD interactive pairs by conflict-point ordering and by how rare that ordering is in nuPlan. The idea earns its keep if three things hold: the full model beats both the nuPlan-only and the fixed-IDM baselines, the margin grows on rarer strata, and the marginal-only ablation falls between them.

A secondary check is closed-loop. We plug the pedestrian predictor into the SICNav bilevel controller in CrowdSimPlus, where SICNav-Diffusion reports a success rate of 1.00 and a freezing frequency of 0.20 s⁻¹. We then raise test-time pedestrian assertiveness beyond the training logs and ask whether freezing rises less with our predictor. That experiment speaks to whether behavioral randomization can reduce reliance on hand-crafted reciprocal filters.

A negative result would also be informative. If synthetic data hurts as its ratio grows even with the social latent, that is direct evidence that the averaging trap applies to simulated behavior.