TL;DR
Imagine driving down a busy street when a cyclist suddenly darts out from behind a parked van; whether you crash depends entirely on the split-second gap between seeing them and hitting them. OnCue is a framework that generates realistic, occluded hazards inside real driving logs while giving engineers exact, dial-a-knob control over both when a hazard becomes visible and when a collision would occur. By decoupling visibility timing from traffic context, it diagnoses why autonomous planners fail—and provides safe avoidance maneuvers to train them to do better.
What Problem Does This Paper Address?
Testing self-driving cars on recorded traffic logs is standard practice, edit-free replay locks you into the exact timing of the original recording. To test rare, dangerous edge cases, researchers use adversarial scenario generators that alter how surrounding pedestrians or cars move to force a collision.
Here is the catch: existing generators focus on motion and collision, not visibility. In occluded scenarios—like a pedestrian stepping out from behind a bus—placement, speed, and line-of-sight are tightly tangled. Speed up the pedestrian to make the test harder, and you accidentally change when they step out of the shadows; move their starting point, and they miss the car entirely. Without joint control over exposure time (when the sensor first sees the hazard) and contact time (when the crash happens), engineers can’t systematically ask: "What happens in this exact traffic jam if the planner gets 1.0 second to react instead of 2.0?" Furthermore, when a planner does crash, a simple pass/fail metric doesn't tell you if the crash was physically unavoidable after the hazard appeared, or if the planner simply choked.
Methods
OnCue turns hazard timing into a controllable test variable using three main components:
- Fixed Reference & Timed Waypoints: To define timing independently of whatever AI planner is being tested, OnCue uses a standard rule-based vehicle (IDM) following the logged route as a "reference ego." Given a desired conflict point and a requested reaction window ($W^*$), OnCue works backward using ray-casting geometry to find the exact spot along the hazard's route where it first enters the sensor's line of sight. This yields two explicit conditions: an exposure waypoint $(p_e, t_e^*)$ and a contact waypoint $(p_c, t_c^*)$, plus a hidden starting state.
- Geometry-Guided Trajectory Generation: While standard Motion Transformer (MTR) encoders process the map and surrounding traffic, OnCue’s novelty lies in injecting those geometry-derived timed waypoints directly into the motion decoder's attention layers. The model outputs spline trajectories that smoothly connect the hidden start, hit both timed waypoints on cue, and look like natural human motion.
- Offline Response Oracle: Once a scenario is generated, a planner-independent "oracle" brute-forces 1,316 kinematic maneuvers (combinations of braking and swerving) to see if a crash is avoidable. It labels tests as Reactive (a safe maneuver exists after the hazard becomes visible) or Anticipatory (safe avoidance was only possible if the car slowed down before seeing the hazard, as if occluders were transparent). Safe oracle rollouts are saved as training demonstrations.
Datasets
OnCue trains and evaluates on real-world driving logs from the Waymo Open Motion Dataset (WOMD), running closed-loop simulations inside MetaDrive. From 33,648 validation logs (where direct replay contained only three qualifying occluded reference conflicts), OnCue synthesizes thousands of valid pedestrian, cyclist, and vehicle tests, sampling a 644-test benchmark across classes and reaction windows for closed-loop planner evaluation.
Key Insights and Ideas
- Occlusion crashes aren't always "unfair": When filtering for collisions that only happen when an obstacle is hidden, you might assume the car simply didn't have time to stop. OnCue’s oracle reveals that 62.5% of such failures for a top planner (PDM-Closed) were actually Reactive—meaning a safe post-exposure maneuver existed, and the planner just missed it.
- More time isn't always safer for learned planners: Intuitively, giving a driver a 3-second warning instead of 1 second should reduce crashes. Rule- and proposal-based planners follow this logic. Surprisingly, the learned planner LatentDriver crashed more when given longer reaction windows against cyclists. Why? In 1-second windows, LatentDriver happened to drive aggressively ahead of the reference pace, shooting through the intersection before the fast-moving cyclist arrived—an accidental "pass-first" behavior masked by single-window metrics.
- Safety vs. Progress trade-offs: Fine-tuning a learned planner on OnCue's oracle demonstrations dramatically teaches it to yield to pop-out hazards, but introduces noticeable conservatism (slower progress in empty streets).
Key Results
- Pinpoint Temporal Control: Across pedestrians, cyclists, and vehicles, 90.1% to 96.6% of OnCue's valid trajectories hit both requested exposure and contact times within $\pm 0.2\text{ s}$.
- Outperforming Adversarial Baselines: On 2,624 shared vehicle requests, OnCue matched the requested reaction window 92.8% of the time, compared to at most 42.1% for adapted adversarial generators (like KING, CAT, and SEAL), while cutting road-edge violations down to 3.9% (vs. 20.4–42.7% for baselines).
- Planner Diagnosis & Adaptation: Extending cyclist reaction windows from $1\text{ s}$ to $3\text{ s}$ dropped PDM-Closed collisions from 59.1% to 5.5%. Fine-tuning LatentDriver with OnCue demonstrations slashed its collision rate on held-out Reactive tests by 54.8 percentage points (raising safe-response success from 6.5% to 37.8%), though no-target driving distance over 8 seconds dropped by 12.7 m.
Limitations and Future Work
The biggest limitation is non-reactive background traffic. Because surrounding cars strictly replay their recorded WOMD logs, they cannot brake or swerve for the newly inserted hazard—leading to target-background overlaps in roughly 37–46% of vehicle runs. Additionally, oracle labels are bounded by a fixed library of 1,316 maneuvers and perfect geometric visibility rules rather than raw sensor noise. The authors point toward integrating OnCue into interactive traffic simulations where surrounding road users dynamically respond to the generated hazards.
Summary updated