Scenario-based testing of automated driving systems must cover safety-critical corner cases, which are difficult to collect on real roads and laborious to script in simulation.
Language models can write programs in Scenic, a human- and machine-readable domain-specific language for driving scenarios. However, generating diverse, executable scenarios that faithfully reflect the user's query remains challenging. Existing frameworks face two recurring limitations.
Limited query-alignment feedback
Open-loop methods generate or assemble Scenic programs for execution in CARLA without using rendered scenarios to guide refinement. Code-feedback loops use compiler or runtime errors to improve executability, but these checks do not establish whether the rendered scenario matches the query.
Limited multimodal retrieval
Methods such as Talk2Traffic use a VLM to convert visual inputs into text and retrieve code snippets indexed by text alone, which ignores how a stored scenario unfolds in simulation.
What Loop2Scenic contributes
Self-refining, closed-loop pipeline
A self-refining, closed-loop pipeline for safety-critical driving scenario generation, combining multimodal retrieval and VLM feedback to refine Scenic programs.
Multimodal benchmark
A multimodal benchmark of 250 safety-critical queries across five input modalities from simulator-generated and real-world sources, on which Loop2Scenic and four state-of-the-art methods are evaluated.
Closed-loop testing
Evaluation against four state-of-the-art methods on executability, query alignment, and scenario criticality, and closed-loop testing of three state-input RL policies and three VLA driving stacks under non-reactive and reactive traffic.
Comparison of Scenic scenario generation methods
Loop2Scenic is the only compared method combining multimodal input and RAG with iterative generation and reactive traffic.
| Method | UI | Input | RAG | G | Loop | Bench. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| T | I | V | T | C | S | V | ||||||
| Assemble | ||||||||||||
| ChatScene | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | C | |||
| Ext-Scenic | ✕ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | C | |||
| TrafficAlign | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | C | |||
| Generation | ||||||||||||
| ScenicNL | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | F | |||
| Dashcam2Sim | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | F | |||
| Talk2Traffic | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | C | |||
| Rubavicius et al. | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | F | |||
| NL2Scenic | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | F | |||
| ScenGE | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | F | |||
| ARISE | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | C | |||
| Chat2Scenic | ✓ | ✓ | ✕ | ✕ | ✓ | ✓ | ✕ | ✕ | I | |||
| D-V2S | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | F | |||
| Loop2Scenic (ours) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | I | |||
UI: user interaction. Input: T text, I image/sketch, V video. RAG: T text, C code examples, S seed program, V video. G: F full DSL, C separate scenario components, I iterative generation. Loop: open, code checks/human, indirect visual feedback, direct VLM feedback. Bench.: none, modular ADS, plus end-to-end (E2E) models, plus reactive traffic.
Read the abstract
Scenario-based testing of automated driving systems must cover safety-critical corner cases, which are difficult to collect on real roads and laborious to script in simulation. Existing methods use language models to generate programs in Scenic, a human- and machine-readable domain-specific language for representing driving scenarios. However, generating diverse, executable scenarios that faithfully reflect the user's query remains challenging. We present Loop2Scenic, a self-refining agentic framework for multimodal driving scenario generation with closed-loop visual feedback, uniquely combining text, image, and video inputs with retrieval-augmented generation. Given a text, image, or video query, it retrieves a Scenic program as a seed and executes it in CARLA. A vision-language model (VLM) critic evaluates rendered views and actor trajectories against query-derived criteria, guiding program acceptance, targeted repair, or regeneration. Further, we introduce a multimodal benchmark of 250 queries across five input modalities with human-written criteria for evaluating whether generated scenarios match their queries. On this benchmark, five-round Loop2Scenic achieves a compilation success rate (CSR) of 100% and framework accuracy (FA) of 80.2%, outperforming four state-of-the-art methods using the same underlying model. The strongest baseline achieves 65.2% CSR and 54.5% FA. Mean scenario quality rises from 70.5% at zero rounds to 79.0% at three and 80.2% at five. Further, Loop2Scenic achieves observed mean SafeBench scores 2.7–14.1% lower than the four baselines on matched queries, averaged over three reinforcement learning (RL) policies, indicating more critical scenarios. We further evaluate driving systems on the generated scenarios, extending Scenic-based closed-loop testing from modular systems to vision-language-action (VLA) driving stacks and from non-reactive to reactive traffic.
Retrieve, execute, critique, refine
Loop2Scenic combines multimodal retrieval with VLMs serving as Scenic generator and visual critic. Unlike compiler or runtime checks, the critic evaluates query alignment on rendered views and actor trajectories, and its feedback drives the refinement loop.
A text, image, or video query is interpreted, and a Scenic program is retrieved from the scenario database as a seed using joint multimodal embeddings.
The program is executed in CARLA and rendered as bird's-eye and first-person views, together with actor trajectories.
The critic checks the rendered scenario against query-derived criteria on road layout, traffic infrastructure, static objects, dynamic actors, and environment.
Its feedback guides iterative refinement with three options, repeated for up to five rounds.
The final programs support SafeBench criticality tuning and closed-loop testing of RL policies and VLA driving stacks under non-reactive and reactive traffic.
250 safety-critical queries, five modalities
The compared state-of-the-art methods lack a unified multimodal benchmark for scenario executability and query alignment. Each query comes with human-written criteria for judging whether a generated scenario matches it.
From query to CARLA scenario
Up to three generated scenarios per input modality, each with 100% scenario quality: the benchmark query and the five-round Loop2Scenic scenario executed in CARLA, in first-person and bird's-eye views.
Bird's-eye legend: green = ego vehicle, yellow = adversarial actors, orange = props, dots = traffic lights. The clips are re-runs of each final five-round program in CARLA, cut once the scenario has played out; scores are the VLM judge's scenario quality for that program. Both views play at 1.5× speed.
Executable, aligned, and more critical
All methods use the same underlying model. FA weights scenario quality by executable coverage: FA = CSR × SQ / 100.
Compilation success rate
Every one of the 250 queries yields an executable scenario.
Framework accuracy
Five-round Loop2Scenic on all 250 benchmark queries.
Framework accuracy by method
FA (%) on the 250-query benchmark; higher is better.
Scenic generation comparison and ablations
The paper's Table 2: success rates, cost, scenario alignment per layer, and framework accuracy on all 250 queries.
| Method | GSR (%) | CSR (%) | RT (s) | Tokens | Scenario alignment (%) | FA (%) | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| RD | TI | TM | DO | EN | SQ | ||||||
| ChatSceneretrieval-assemble, components | 87.6 | 29.2 | 839 | 24,871 | 90.2 | 75.0 | 87.5 | 58.6 | 86.7 | 76.6 | 22.4 |
| ScenicNLgeneration, full DSL | 100.0 | 29.6 | 851 | 33,936 | 83.1 | 61.1 | 91.7 | 66.3 | 91.4 | 78.1 | 23.1 |
| NL2Scenicgeneration, full DSL | 97.2 | 26.4 | 899 | 30,575 | 96.5 | 75.0 | 83.3 | 83.7 | 93.1 | 90.6 | 23.9 |
| Chat2Scenicgeneration, iterative components | 100.0 | 65.2 | 1274 | 74,893 | 91.1 | 80.0 | 71.9 | 71.2 | 96.4 | 83.6 | 54.5 |
| Loop2Scenic | |||||||||||
| without retrieval and loop | 100.0 | 60.8 | 260 | 97,917 | 91.9 | 73.1 | 53.6 | 68.3 | 99.4 | 83.0 | 50.5 |
| without loop, 0 rounds | 100.0 | 100.0 | 533 | 73,119 | 86.0 | 79.1 | 40.0 | 44.7 | 96.3 | 70.5 | 70.5 |
| 1 round | 100.0 | 100.0 | 619 | 121,799 | 87.2 | 70.9 | 62.5 | 55.1 | 98.3 | 75.7 | 75.7 |
| 3 rounds | 100.0 | 100.0 | 862 | 204,417 | 88.0 | 73.3 | 65.0 | 62.2 | 98.3 | 79.0 | 79.0 |
| 5 rounds | 100.0 | 100.0 | 1085 | 279,516 | 88.8 | 75.6 | 80.0 | 63.6 | 98.8 | 80.2 | 80.2 |
250 queries, Qwen3.8-Max. GSR/CSR: Generation/Compilation Success Rate. FA: Framework Accuracy. RT: Response Time. SQ: Scenario Quality. RD: Road Layout. TI: Traffic Infrastructure. TM: Temporary Modifications. DO: Dynamic Objects. EN: Environment. Rounds: refinement updates (default: five). Costs cover model calls per program. SQ is computed on each method's executed outputs.
Refinement rounds
Mean scenario quality (%) after 0, 1, 3, and 5 critic-guided rounds.
Show as table
| Rounds | SQ (%) | FA (%) | Tokens |
|---|---|---|---|
| 0 | 70.5 | 70.5 | 73,119 |
| 1 | 75.7 | 75.7 | 121,799 |
| 3 | 79.0 | 79.0 | 204,417 |
| 5 | 80.2 | 80.2 | 279,516 |
Scenario criticality (SafeBench)
Observed mean overall score (OS), averaged over SAC, PPO and TD3, on each baseline's matched queries; lower OS means more safety-critical scenarios. With five refinement rounds, Loop2Scenic achieves the lowest observed OS across three RL policies on matched queries, with policy-averaged scores 2.7–14.1% lower than the four baselines.
Safety-criticality evaluation with SafeBench
The paper's Table 3. Left: each method on its own available scenarios (N). Right: baseline / five-round Loop2Scenic OS on the same queries, per RL policy.
| Method | N | Safety | Functionality | Etiquette | OS ↓ | vs. Loop2Scenic (same queries, 5 rounds)* | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CR ↑ | RR ↑ | SS ↑ | OR ↑ | RF ↓ | Comp ↓ | TS ↑ | ACC ↑ | YV ↑ | LI ↑ | SAC ↓ | PPO ↓ | TD3 ↓ | OS ↓ | |||
| ChatScene | 73 | 0.290 | 0.062 | 0.062 | 0.020 | 0.894 | 0.619 | 0.079 | 0.297 | 0.194 | 0.053 | 0.804 | 0.7670.646 | 0.8320.684 | 0.8120.756 | 0.8040.695 |
| ScenicNL | 73 | 0.329 | 0.167 | 0.014 | 0.022 | 0.830 | 0.496 | 0.064 | 0.323 | 0.196 | 0.082 | 0.769 | 0.7110.631 | 0.7990.705 | 0.7960.792 | 0.7690.709 |
| NL2Scenic | 64 | 0.247 | 0.148 | 0.049 | 0.021 | 0.857 | 0.688 | 0.121 | 0.297 | 0.281 | 0.090 | 0.814 | 0.7550.624 | 0.8500.681 | 0.8370.793 | 0.8140.699 |
| Chat2Scenic | 162 | 0.325 | 0.299 | 0.069 | 0.012 | 0.819 | 0.559 | 0.087 | 0.307 | 0.220 | 0.080 | 0.754 | 0.7100.681 | 0.7690.739 | 0.7840.782 | 0.7540.734 |
| Loop2Scenic (3 rounds) | 250 | 0.357 | 0.317 | 0.063 | 0.015 | 0.814 | 0.566 | 0.087 | 0.322 | 0.203 | 0.109 | 0.737 | 0.679 | 0.733 | 0.799 | 0.737 |
| Loop2Scenic (5 rounds) | 250 | 0.373 | 0.331 | 0.066 | 0.017 | 0.814 | 0.536 | 0.085 | 0.326 | 0.198 | 0.104 | 0.725 | 0.667 | 0.711 | 0.798 | 0.725 |
N: available scenarios. CR: Collision Rate. RR: Red-Light-Running. SS: Stop-Sign-Running. OR: Out-of-Road Distance. RF: Route-Following Stability. Comp: Route Completion. TS: Time. ACC: Acceleration. YV: Yaw Velocity. LI: Lane Invasion. OS: Overall Score. Mean over SAC, PPO, and TD3 after tuning against SAC. Arrows indicate greater scenario criticality. *Baseline rows report baseline OS (top) and Loop2Scenic OS (bold) on the baseline's N queries. Loop2Scenic rows report OS on all 250 queries.
Where the gains come from
Further analyses from the appendix: per-modality results, coverage at fixed quality, ablations of seed retrieval and the critic, alternative backbones, retrieval, criticality across scene sets, execution failures, and the validation of the VLM judge.
Framework accuracy by input modality
FA (%) of each method on the 50 queries of each modality; Loop2Scenic at five rounds achieves the highest FA in every modality.
Executable coverage at fixed scenario quality
Percentage of all 250 queries whose output executes and reaches judge SQ ≥ the threshold. At five rounds, 60.4% of queries reach SQ ≥ 0.8, against 15.2–45.2% for the baselines.
Seed retrieval and the visual loop
FA (%) on all 250 queries as components are added. Labels give the paired gain with its 95% confidence interval.
With a fixed random subset of 50 seeds instead of 200, three rounds still return executable programs for all queries (78.4 vs. 79.0 FA, Δ = −0.6, 95% CI [−2.5, 1.3]).
Critic controls
On 125 queries, critic-guided refinement against controls that remove or replace the critic.
Alternative model backbones
FA (%) on all 250 queries with the same framework and five rounds; every backbone reaches 100% CSR.
Qwen3.8-Flash FA is available-case, using 249 judged outputs.
Retrieval encoders by query modality
HIT@1 (%) for retrieving the matching scenario from the database. Native multimodal encoders index text and video jointly; text-only encoders see video through a caption bridge.
Criticality across scene sets
ΔOS = Loop2Scenic − baseline on the same queries, averaged over the shared policies, with its 95% paired query-bootstrap interval. Negative values indicate more safety-critical Loop2Scenic scenarios. Set 1 uses the Table 3 scenes. Sets 2–3 sample fresh scenes from the same tuned ranges.
| Baseline | Set 1 | Set 2 | Set 3 | Mean 2–3 |
|---|---|---|---|---|
| ChatScene | −.113[−.178, −.045] | −.075[−.134, −.016] | −.076[−.133, −.020] | −.075[−.132, −.020] |
| ScenicNL | −.059[−.120, .004] | −.066[−.120, −.013] | −.058[−.110, −.006] | −.061[−.113, −.010] |
| NL2Scenic | −.115[−.173, −.057] | −.086[−.147, −.027] | −.083[−.143, −.024] | −.085[−.144, −.027] |
| Chat2Scenic | −.020[−.061, .022] | −.030[−.067, .006] | −.028[−.066, .009] | −.029[−.065, .007] |
In all three scene sets and their mean, Loop2Scenic has lower observed OS than every baseline on matched queries: all 16 ΔOS point estimates are negative. Matched-query gaps are supported against ChatScene and NL2Scenic in all three sets and against ScenicNL in sets 2 and 3 and their mean.
Why baseline programs fail to execute
Of 250 queries per method: programs generated, programs that execute (route and videos), and the causes of the remaining failures. Executed / 250 is each method's CSR in Table 2.
| Outcome | ChatScene | ScenicNL | NL2Scenic | Chat2Scenic | Loop2Scenic |
|---|---|---|---|---|---|
| Program generated | 219 | 250 | 243 | 250 | 250 |
| Executed (route + videos) | 73 | 74 | 66 | 163 | 250 |
| Not executed | 146 | 176 | 177 | 87 | 0 |
| No valid scene | 95 | 51 | 46 | 22 | 0 |
| Invalid Scenic usage / type error | – | 39 | 40 | 33 | 0 |
| Random value in control flow | – | 19 | 34 | 10 | 0 |
| Non-existent API | 21 | 14 | 23 | 8 | 0 |
| Empty sampling domain | 20 | 11 | 15 | 7 | 0 |
| Syntax / parse error | 3 | 33 | 15 | 3 | 0 |
| Undefined variable | 6 | 1 | 4 | 1 | 0 |
| Ego never moved | – | 6 | 0 | 3 | 0 |
| Simulator hang or crash | 1 | 2 | 0 | 0 | 0 |
For each program, the first failing execution stage is recorded. Missing programs are model-API timeouts, and dashes mark categories not recorded for ChatScene.
Validation of the VLM judge
Agreement between the VLM judge and human scores (Krippendorff's α; α ≥ 0.8 indicates reliable agreement).

Stress-testing VLA stacks and RL policies
After SafeBench adversarial tuning, the 250 generated scenarios are used for closed-loop testing under non-reactive and reactive traffic. Increasing refinement from three to five rounds lowers the driving score (DS) by 1.9–5.1 points and the success rate (SR) by 0.2–6.0 percentage points across all driving stacks.
Driving performance at three and five rounds
Lower values on five-round scenarios indicate a stronger stress test.
| Policy | DS ↑ | SR (%) ↑ | Eff. ↑ | Comf. ↑ |
|---|---|---|---|---|
| VLA driving stacks | ||||
| SimLingo | 43.6 / 39.6 | 26.6 / 23.6 | 236.8 / 231.9 | 37.8 / 41.6 |
| ORION | 50.1 / 48.2 | 20.6 / 19.6 | 134.0 / 132.2 | 10.1 / 9.9 |
| OpenDriveVLA | 32.0 / 28.8 | 9.4 / 7.6 | 230.1 / 227.3 | 3.9 / 4.7 |
| State-input RL policies | ||||
| SAC | 39.3 / 37.4 | 16.8 / 14.4 | 236.5 / 237.6 | 41.8 / 42.8 |
| PPO | 52.4 / 47.3 | 23.8 / 17.8 | 193.1 / 193.5 | 27.4 / 27.4 |
| TD3 | 46.2 / 43.3 | 15.8 / 13.8 | 163.0 / 149.9 | 38.2 / 39.0 |
| Policy | DS ↑ | SR (%) ↑ | Eff. ↑ | Comf. ↑ |
|---|---|---|---|---|
| VLA driving stacks | ||||
| SimLingo | 43.6 / 39.9 | 27.8 / 24.6 | 252.7 / 250.9 | 39.2 / 42.6 |
| ORION | 51.3 / 49.2 | 21.0 / 20.8 | 138.9 / 138.0 | 11.1 / 10.7 |
| OpenDriveVLA | 30.8 / 28.2 | 9.0 / 7.2 | 241.7 / 239.9 | 4.5 / 5.1 |
| State-input RL policies | ||||
| SAC | 42.3 / 40.4 | 19.2 / 17.0 | 254.9 / 253.4 | 42.0 / 42.7 |
| PPO | 53.6 / 49.1 | 25.0 / 20.0 | 205.9 / 203.4 | 27.6 / 27.5 |
| TD3 | 49.3 / 45.6 | 19.6 / 16.6 | 174.8 / 161.3 | 36.9 / 37.0 |
3 rounds / 5 rounds. DS: Driving Score. SR: Success Rate. Eff.: Efficiency. Comf.: Comfort. Higher is better for the policy. The RL policies take state input.
Closed-loop episodes
The three VLA driving stacks in the same generated scenario, under non-reactive and reactive traffic (front-camera views, 2× speed). The three scenarios come from text queries among the 250 five-round scenarios of the driving evaluation; the figure above shows a different scenario, from an image-only query. Collision times count from the start of each episode.
Matched driving-score differences against the baselines
Loop2Scenic minus baseline driving score (DS) on the same queries, for each policy. Negative values mean more safety-critical Loop2Scenic scenarios. Loop2Scenic has lower observed DS in 19/24 non-reactive and 20/24 reactive comparisons; eight 95% intervals per traffic mode lie entirely below zero, and none lies entirely above zero.
BibTeX
The arXiv identifier will be added here once the preprint is released.
@misc{gao2026loop2scenic,
title = {{Loop2Scenic}: A Self-Refining Agentic Framework with Closed-Loop
Visual Feedback for Multimodal Safety-Critical Driving Scenario Generation},
author = {Gao, Yuan and Li, Chen and Lim, Yung Loon and Sch{\"a}fer, Finn Rasmus and
Jahncke, Felix and Piccinini, Mattia and Song, Qunying and
Schmidt, Sebastian and Betz, Johannes},
year = {2026}
}


