Chat2Scenic: Iterative RAG Framework for Autonomous Driving Scenarios

Chat2Scenic uses iterative RAG to generate autonomous driving test scenarios from regulations, achieving 76% compilation success rate.

domingo, 26 de julio de 2026 • 3 min read • Q2BSTUDIO Team

Aplicación de RAG iterativo en simulación de vehículos autónomos

Validating autonomous driving systems requires diverse, regulation-compliant test scenarios. In simulation-based testing, these scenarios are defined as executable scripts in domain-specific languages (DSL). However, automatically generating such scripts from regulatory descriptions remains an open challenge. 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 success rates. In this context, Chat2Scenic emerges, presented in arXiv:2607.14387v1, as the first iterative retrieval-augmented generation (RAG) framework to produce scenario scripts in Scenic DSL. This solution offers a conversational interface that supports interactive scenario refinement and integrates RAG to ground generation in regulatory knowledge and DSL syntax. Additionally, an open benchmark is proposed with 123 scenarios from regulations such as NHTSA and United Nations Vehicle Regulations. Evaluations with state-of-the-art language models (LLMs) show that Chat2Scenic achieves 76.42% Compilation Success Rate (CSR) and 58.17% Framework Accuracy (FA), significantly outperforming previous methods (Retrieval Assemble with 30.08% CSR, 11.03% FA and Retrieval full script generation with 16.26% CSR, 10.86% FA). The code is available on GitHub under an open license.

Chat2Scenic's innovation lies in its iterative architecture and use of RAG to combine regulatory document retrieval with LLM-assisted generation. Unlike previous approaches that treated generation as a single-shot process, Chat2Scenic allows users to engage in a dialogue with the system, adjusting parameters, fixing compilation errors, and refining scenario logic. This drastically reduces failure rates and improves regulatory fidelity. The benchmark includes complex scenarios such as priority intersections, lane changes, and emergency situations, demonstrating the method's applicability in real-world cases. Results confirm that combining human interaction with contextual retrieval is key to overcoming the limitations of purely generative techniques.

This technology has direct implications beyond autonomous driving. The ability to generate scripts from regulatory descriptions using artificial intelligence is applicable to any domain requiring rule-based validation. For example, in developing custom software, automating tests based on regulatory specifications can reduce costs and accelerate time-to-market. At Q2BSTUDIO, as a software and technology development company, we understand that integrating artificial intelligence into testing and validation processes is a differentiating factor. Our expertise in AI allows us to design solutions that, like Chat2Scenic, use LLMs and RAG to interpret technical documentation and generate test cases, automation scripts, or even specialized virtual assistants.

Moreover, the infrastructure required to run these systems demands robust cloud platforms. At Q2BSTUDIO we offer cloud AWS/Azure services that provide the scalability, security, and flexibility needed to deploy LLM- and RAG-based solutions. Cybersecurity is another fundamental pillar: when handling sensitive regulatory data and simulation scripts, it is crucial to implement protective measures. Our cybersecurity services ensure that cloud architectures and AI applications meet the most demanding standards. Likewise, scenario generation can benefit from historical data analysis using Business Intelligence tools. For example, using BI / Power BI it is possible to visualize failure patterns or scenario coverage, thus optimizing the validation strategy.

The trend towards autonomous AI agents capable of interacting with simulated environments is unstoppable. Chat2Scenic represents a step in that direction, but its true potential materializes when combined with process automation platforms. At Q2BSTUDIO we develop AI agents that not only generate scripts but can also execute them, analyze results, and provide continuous feedback to the system. This closed-loop vision is what we apply in digital transformation projects for clients across various sectors. The same RAG technology that powers Chat2Scenic can be adapted to build technical documentation assistants, contextual recommendation systems, or specialized support chatbots.

In summary, Chat2Scenic demonstrates that combining information retrieval, language models, and iterative interaction is a winning strategy for generating validation scenarios in autonomous driving. This approach not only improves compilation and accuracy metrics but also opens the door to new applications in custom software development, test automation, and applied artificial intelligence. At Q2BSTUDIO we accompany organizations on this path, offering comprehensive solutions ranging from cloud and cybersecurity consulting to custom software development and BI systems. The autonomous vehicle revolution is just beginning, and tools like Chat2Scenic will be essential to ensure their safety and reliability. Our expertise in technologies like AWS, Azure, Power BI, and the latest advances in AI positions us as the ideal partner to implement these innovations in production environments.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.