# Generating Safety-Critical Driving Scenarios from Role-Typed Signal Temporal Logic Specifications Drafted by Large Language Models

DevFeed: [Generating Safety-Critical Driving Scenarios from Role-Typed Signal Temporal Logic Specifications Drafted by Large Language Models](<https://devfeed.tech/articles/generating-safety-critical-driving-scenarios-from-role-typed-signal-temporal-logic-specifications-drafted-by-large-language-models-151489.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.29800>)

Author: Zifan Zeng, Qunli Zhang, Peng Wang, Shiming Liu, Feng Liu, Zheng Hu

Published: 2026-11-24T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [autonomous vehicles](<https://devfeed.tech/topics/autonomous-vehicles.md>), [AI agents in autonomous vehicles](<https://devfeed.tech/topics/ai-agents-in-autonomous-vehicles.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>)

Tags: [automated](<https://devfeed.tech/tags/automated.md>), [crash](<https://devfeed.tech/tags/crash.md>), [critical](<https://devfeed.tech/tags/critical.md>), [cs-ro](<https://devfeed.tech/tags/cs-ro.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [diffusion](<https://devfeed.tech/tags/diffusion.md>), [diffusion-models](<https://devfeed.tech/tags/diffusion-models.md>), [driving](<https://devfeed.tech/tags/driving.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [language-models](<https://devfeed.tech/tags/language-models.md>), [large-language-model](<https://devfeed.tech/tags/large-language-model.md>), [logic](<https://devfeed.tech/tags/logic.md>), [motion](<https://devfeed.tech/tags/motion.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [planner](<https://devfeed.tech/tags/planner.md>), [safety](<https://devfeed.tech/tags/safety.md>), [signal](<https://devfeed.tech/tags/signal.md>), [specifications](<https://devfeed.tech/tags/specifications.md>), [temporal](<https://devfeed.tech/tags/temporal.md>), [test](<https://devfeed.tech/tags/test.md>)

## AI overview

The method uses role-typed signal temporal logic to turn scenario descriptions into constrained edits of diffusion-generated driving scenes. A large language model drafts the specification, a type checker validates it, and a compiler derives the optimization; clauses specify which agent may be changed and which agents may be read, with the attacker optimized against the unreacted test vehicle before its response. On nuScenes and CommonRoad, one parameter set yielded valid scenarios at a rate 0.14 higher than objectives tuned separately for each scenario type. Descriptions produced at least one valid scenario for 11 of 16 pre-crash types expressible in the public data. Learned planners failed more often on generated scenarios than on their seeds; fine-tuning reduced failure on critical scenarios, with the gain size set by the required time headway clause.

## Source excerpt

arXiv:2611.29800v1 Announce Type: cross Abstract: Safety-critical scenarios are rare in recorded driving and must be generated to test and train motion planners of automated vehicles. In guided diffusion models, each scenario type needs its own weighted objective, separate from the validity check. Optimized together with the attacker, the vehicle under test can cancel the attack or draw it toward itself. We state each scenario as a signal temporal logic specification with clauses typed by role. Every clause names the agent it may change and the agents it may read, and the vehicle under test reads the attacker only from the attack onset. A large language model drafts the specification from a description, and a type checker accepts it. A compiler derives the optimization: it edits a diffusion model's samples by the smallest change that satisfies the specification, each clause moves only its owner, the attacker is solved against the unreacted vehicle under test before its response, and the monitor of the same specification decides acceptance. On nuScenes and CommonRoad, judged independently of the specification, one parameter set produced valid scenarios at a rate 0.14 above a weighted objective tuned per scenario type, and descriptions yielded at least one valid scenario for 11 of the 16 pre-crash types expressible in the public data. Learned planners fail more often on the generated scenarios than on their seeds. Fine-tuning on them lowers a planner's failure rate on critical scenarios, and the time headway one clause of the label requires, not the generator, sets the size of the gain.