The first iterative retrieval-augmented framework that translates natural-language regulatory descriptions into executable Scenic DSL scenarios for CARLA — driven by an interactive chatbot and grounded in regulatory knowledge.
An interactive interpreter refines the query, a dual RAG retriever grounds generation in Scenic code and regulations, and a component-wise generator (Spatial Relation → Ego → Object → Restriction) emits an executable Scenic script for CARLA.
CP, CoT, ICL, RAG-ICL) and a benchmark against SOTA methods.Validating autonomous driving systems requires diverse, regulation-compliant test scenarios. In simulation-based testing, scenarios are defined as executable DSL scripts that parametrically specify road topology, actor behaviors, and environmental conditions for simulators such as CARLA. Yet automatically generating such scripts from complex regulatory descriptions remains an open challenge, and existing approaches face fundamental trade-offs: retrieval-assemble methods achieve reasonable compilation rates but lack scalability, while retrieval-based full-script generation suffers from low compilation success. We present Chat2Scenic, the first iterative retrieval-augmented framework to automatically translate natural-language regulatory descriptions into executable Scenic DSL scripts. Chat2Scenic provides a chatbot interface for interactive scenario refinement and integrates RAG to ground scenario generation in regulatory knowledge and DSL syntax. We further propose an open benchmark comprising 123 scenarios drawn from NHTSA, United Nations Vehicle Regulations, and the CARLA Leaderboard. Chat2Scenic achieves a Compilation Success Rate of 76.42% and a Framework Accuracy of 58.17%, outperforming retrieval-assemble (30% CSR, 11.03% FA) and retrieval full-script generation (16.26% CSR, 10.08% FA). We release our open-source code to facilitate future developments.
Chat2Scenic ships two interactive tools — a conversational scenario generator and a dedicated human-evaluation interface — enabling end-to-end scenario creation and verification.
The Chat2Scenic chatbot lets users describe any driving scenario in plain natural language. The system iteratively retrieves relevant DSL knowledge via RAG, applies chain-of-thought prompting, and generates a component-wise executable Scenic DSL script ready for CARLA simulation. Users can refine the scenario through follow-up messages, inspect the generated code, and re-run the simulation — all within a single chat session.
To assess scenario alignment, we built a dedicated annotation tool that presents evaluators with the original benchmark description alongside the CARLA simulation video (BEV, FPV, TPV views). Annotators rate five alignment layers — Road Layout (RL), Traffic Infrastructure (TI), Temporal Modifications (TM), Dynamic Objects (DO), and Environment (EN) — each on a binary pass/fail basis. The aggregated scores feed directly into the Scenario Quality (SQ) and Framework Accuracy (FA) metrics reported in our results.
Generated scenarios rendered in CARLA across benchmark categories. Each scenario shows all three camera views — BEV (Bird's-Eye), FPV (First-Person), TPV (Third-Person) — with the original benchmark description.
All experiments use CARLA 0.9.15 + Scenic 3.1.0 on a Dell Alienware R15 (Intel i7-13700KF, NVIDIA RTX 4090, 128 GB RAM). The best configuration C11 (CP + CoT + ICL + CodeICL) with Gemini-3-Flash significantly outperforms all baselines.
Click any numeric column header to sort. ↑ = higher is better, ↓ = lower is better.
| ID | CP | CoT | ICL | RAG-ICL | CSR (%) ↑ | RT (s) ↓ | Tokens ↓ | Scenario Alignment ↑ | FA ↑ | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CodeICL | DocICL | RL ↑ | TI ↑ | TM ↑ | DO ↑ | EN ↑ | SQ ↑ | ||||||||
*C1 is zero-shot baseline (Gemini-3-Flash). CP: Contextual Prompting, CoT: Chain-of-Thought, ICL: In-Context Learning, RAG-ICL: Retrieval-Augmented ICL (Code/Doc). CSR: Compilation Success Rate, RT: Response Time, Tokens: token usage. Alignment layers — RL: Road, TI: Traffic Infrastructure, TM: Temporal Modifications, DO: Dynamic Objects, EN: Environment. SQ: Scenario Quality, FA: Framework Accuracy.
Injects domain-specific knowledge directly into the prompt — syntax constraints, hierarchical type systems (e.g., NetworkElement → LinearElement → {Road, Lane}), and available operators.
Structures generation into explicit reasoning steps per component (Understand → Examine → Select → Define → Instantiate → Validate), completing each step incrementally.
Contrastive few-shot examples: positive examples show correct syntax patterns while negative examples present error-correction pairs, anchoring the model to concrete instances.
Dynamic retrieval on top of ICL: CodeICL retrieves the top-3 similar code snippets per query, while DocICL retrieves relevant documentation chunks — always tailored to the component being generated.
Click any numeric column header to sort. ↑ = higher is better, ↓ = lower is better.
| Model Variant | CSR (%) ↑ | RT (s) ↓ | Tokens ↓ | Scenario Alignment ↑ | FA ↑ | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| RL ↑ | TI ↑ | TM ↑ | DO ↑ | EN ↑ | SQ ↑ | |||||
CSR: Compilation Success Rate, RT: Response Time. Alignment layers — RL: Road, TI: Traffic Infrastructure, TM: Temporal Modifications, DO: Dynamic Objects, EN: Environment. SQ: Scenario Quality, FA: Framework Accuracy (CSR × SQ). Highlighted rows: Chat2Scenic and SOTA baselines.
The first regulation-grounded benchmark for autonomous-driving scenario generation from natural language, comprising 123 scenario specifications drawn from real-world regulatory sources. Browse all scenarios by source below.
@inproceedings{chat2scenic2026,
title = {Chat2Scenic: An Iterative RAG-Based Framework for
Scenario Generation in Autonomous Driving},
author = {Gao, Yuan and Miao, Wenting and Piccinini, Mattia and
Wang, Haoyu and Song, Qunying and Betz, Johannes},
booktitle = {Proceedings of the IEEE/RSJ International Conference on
Intelligent Robots and Systems (IROS)},
year = {2026},
eprint = {2607.14387},
archivePrefix = {arXiv},
primaryClass = {cs.RO}
}