Manuscript Offprint

arXiv:2609.04921

One Diffusion Model, Two Roles: Guided Trajectory Planning and Safety-Critical Scenario Generation in Closed-Loop Simulation

Arka Pal, Rajesh Kumar, Hannes Eriksson, Rémi Lacombe, Arvid Laveno Ling, Ankit Gupta, Maciej Wozniak

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Arka Pal∗,1^{*,1}, Rajesh Kumar∗,1^{*,1}, Hannes Eriksson2^{2}, Rémi Lacombe2^{2}, Arvid Laveno Ling2,3^{2,3}, Ankit Gupta2^{2}, and Maciej Wozniak1,2^{1,2}

1^{1} KTH Royal Institute of Technology, Sweden {arkap, rajeshk, maciejw}@kth.se

2^{2} Zenseact AB, Sweden {hannes.eriksson, remi.lacombe, ankit.gupta}@zenseact.com

3^{3} Chalmers University of Technology, Sweden laveno@chalmers.se

∗^{*}Equal contribution, Master's thesis performed at Zenseact.

Abstract. Diffusion probabilistic models can capture the multi-modal, interaction-rich distribution of joint future trajectories in driving scenes. We show that a single pretrained diffusion traffic model can serve two complementary roles in the autonomous driving development loop: as an ego motion planner, and as a controllable generator of safety-critical scenarios for stress-testing the planners. On the planning side, we introduce a Single-Stream Dual-Stream (SSDS) diffusion-transformer decoder that fuses scene context via joint attention rather than late cross-attention, improving closed-loop performance on nuPlan. We further propose Decoupled Annealing Posterior Sampling with Energy (DAPSE), a training-free guidance scheme that injects arbitrary energy functions (e.g., target speed) at the clean-sample level, avoiding the first-order approximation errors of diffusion posterior sampling while requiring no auxiliary networks. Beyond planning, we leverage the same diffusion model as a controllable scenario generator to create realistic long-tail driving interactions for closed-loop evaluation. Through inference-time guidance, selected agents are steered toward safety-critical behaviors, including aggressive cut-ins, lead-vehicle braking, and combined longitudinal-lateral interactions, while preserving realistic traffic behaviors. Evaluated in closed-loop nuPlan simulations with independent black-box planners, the generated scenarios expose failure modes that remain hidden under standard benchmarks. In particular, evaluated planners frequently rely on reactive braking responses rather than proactive evasive maneuvers when facing complex multi-agent interactions, revealing a limitation of current learned planners. Although the SSDS-based planner achieves stronger nominal performance, it experiences larger degradation under these challenging scenarios, demonstrating that benchmark superiority does not necessarily translate to robustness. These results demonstrate that a single learned traffic prior can simultaneously improve motion planning and provide a realistic framework for systematic planner robustness evaluation.

A. Pal et al.

Keywords: Diffusion models · Motion planning · Safety-critical scenario generation · Closed-loop simulation

1 Introduction

Learning-based planners for autonomous vehicles must satisfy two requirements that are usually studied separately: they must produce safe, human-like trajectories in interactive traffic [22], and they must be evaluated against the rare, safety-critical interactions that the real world has to offer [8]. Imitation-based planners trained on expert demonstrations struggle with the first requirement because standard regression objectives tend to average over the multi-modal set of plausible behaviors [18,43]; standard benchmarks struggle with the second because logged data is dominated by nominal driving, so strong benchmark scores do not imply robustness in long-tail interactions [13].

Diffusion Probabilistic Models (DPMs) [11] can address both problems with the same mechanism. By learning the joint distribution of future trajectories of the ego vehicle and its neighbors conditioned on scene context, a DPM (i) captures multi-modality natively, and (ii) exposes an inference-time control surface: the reverse process can be steered by gradients of arbitrary energy functions without retraining. Steering the ego towards low-energy (safe, comfortable, rule-compliant) trajectories yields a planner; steering a neighbor towards high-risk interactions with the ego yields an adversarial scenario generator.

This paper develops both directions, as presented in Figure 1, on top of a Diffusion Transformer (DiT)-based [25] traffic model trained on nuPlan [1], an autonomous driving planning benchmark with 1500 hours of human driving data, and makes the following contributions:

  1. SSDS-DiT decoder for joint prediction and planning. We replace the standard DiT decoder with a Single-Stream Dual-Stream architecture adapted from latest video generation models. Dual-stream blocks process trajectory and context tokens in separate streams that interact through joint attention; a subsequent single-stream stage fuses the unified representation.

  2. DAPSE: Training-free exact guidance for zero-shot trajectory steering. To bypass the costly retraining of existing safety-steering methods, we propose Decoupled Annealing Posterior Sampling with Energy (DAPSE), enabling zero-shot enforcement of driving constraints on our pre-trained diffusion-based planner.

  3. Controllable safety-critical scenario generation in closed loop. We repurpose the same pretrained diffusion model as a behavior generator for a designated adversary within a fully closed-loop nuPlan simulation. We generate controllable and realistic safety-critical highway interactions, including aggressive cut-ins and sudden braking events, where the adversary challenges the ego planner through targeted driving behaviors.

Figure

Fig. 1: The dual planner and scenario generator framework. A shared scene encoder produces a scene condition used by two trajectory decoders: the ego decoder and the adversarial decoder are sampled independently, with the adversarial decoder being steered at each denoising step by the gradient of a scenario-specific energy (e.g. ETTC,Elc,Ebrake\mathcal{E}_{TTC}, \mathcal{E}_{lc}, \mathcal{E}_{brake}). Both trajectories are tracked by an LQR controller, and the resulting histories are fed back for the next timestep.

References (44)