We present ChatScene, a Large Language Model (LLM)-based agent that leverages the capabilities of LLMs to gener-ate safety-critical scenarios for autonomous vehicles. Given unstructured language instructions, the agent first generates textually described traffic scenarios using LLMs. These scenario descriptions are subsequently broken down into several sub-descriptions for specified details such as behaviors and locations of vehicles. The agent then distinctively transforms the textually described sub-scenarios into domain-specific languages, which then generate actual code for prediction and control in simulators, facilitating the creation of diverse and complex scenarios within the CARLA simulation environment. A key part of our agent is a comprehensive knowledge retrieval component, which efficiently translates specific textual descriptions into corresponding domain-specific code snippets by training a knowledge database containing the scenario description and code pairs. Extensive experimental results underscore the efficacy of ChatScene in improving the safety of autonomous vehicles. For instance, the scenarios generated by ChatScene show a 15% increase in collision rates compared to state-of-the-art baselines when tested against different reinforcement learning-based ego vehicles. Furthermore, we show that by using our generated safety-critical scenarios to fine-tune different RL-based autonomous driving models, they can achieve a 9% reduction in collision rates, surpassing current SOTA methods. ChatScene effectively bridges the gap between textual descriptions of traffic scenarios and practical CARLA simulations, providing a unified way to conveniently generate safety-critical scenarios for safety testing and improvement for AVs. The code is available at https://github.com/javyduck/ChatScene.
한 줄 요약
ChatScene은 LLM을 활용해 CARLA 시뮬레이션에서 안전-critical 시나리오를 생성하는 에이전트로, 15% 높은 충돌률을 보인다.
핵심 기여도
- LLM 기반 에이전트를 사용하여 언스트럭처드 언어 입력으로 CARLA 시뮬레이션 코드를 생성.
- Scenic 코드 스니펫 기반의 검색 데이터베이스를 구축하여 텍스트-코드 변환 효율성 향상.
- 생성된 시나리오로 자율주행 모델을 미세조정하여 충돌률 9% 감소.
- Safebench 플랫폼에서 15% 높은 충돌률, 16% 낮은 종합 점수를 기록.
핵심 아이디어
ChatScene은 LLM을 활용하여 텍스트 기반의 안전-critical 시나리오를 생성하고, 이를 Scenic 언어로 변환하여 CARLA 시뮬레이션에 적용하는 시스템이다. 기존 방법은 직접 코드 생성에 제한이 있었으나, ChatScene은 LLM을 사용해 텍스트를 분해하고, Scenic 코드 스니펫을 검색하여 조합하는 방식을 채택함으로써 실행 가능한 시뮬레이션 코드를 생성한다. 특히, 텍스트 설명과 코드 쌍을 포함한 지식 데이터베이스를 학습하여 효율적인 텍스트-코드 변환을 가능하게 한다. 이는 기존의 직접 생성 방식보다 안정성과 실행 가능성 측면에서 우수한 결과를 제공한다.
기술적 접근법
- **LLM 기반 텍스트 생성**: 사용자 입력 언어를 바탕으로 시나리오 텍스트를 생성.
- **텍스트 파싱 및 특징 추출**: 시나리오 설명을 차량 행동, 위치 등 하위 설명으로 분해.
- **벡터 인코딩 및 코드 검색**: 특징을 벡터로 변환하여 사전 학습된 Scenic 코드 스니펫을 검색.
- **Scenic 스크립트 생성**: 검색된 코드 조각을 조합하여 실행 가능한 Scenic 스크립트를 생성.
- **CARLA 시뮬레이션 실행**: 생성된 스크립트로 시나리오를 시뮬레이션 환경에 적용.
- **하이퍼파라미터**: 미세조정 시 학습률 0.0001, 에포크 500 사용.
주요 결과
- **Safebench 평가**: ChatScene 생성 시나리오가 기존 최신 기법 대비 15% 높은 충돌률을 기록.
- **미세조정 성능**: 생성 시나리오로 RL 기반 자율주행 모델을 트레이닝한 결과, 충돌률 9% 감소.
- **ADE 지표**: 시나리오 다양성 측면에서 ADE 지표에서 최고 성능 기록.
- **종합 점수**: 기존 베이스라인 대비 16% 낮은 종합 점수를 보여 시나리오의 복잡도 증가를 입증.
의의 및 한계
ChatScene은 텍스트 기반의 시나리오 생성과 시뮬레이션 코드 생성을 통합한 체계적인 프레임워크로, 기존 방법보다 시나리오 생성의 범위와 다양성을 확장한다. 특히, LLM과 Scenic 언어의 결합은 텍스트-코드 변환의 효율성과 실행 가능성 문제를 해결하며, 자율주행 시스템의 안전성 테스트를 강화하는 데 기여한다. 그러나, 생성된 코드의 실행 가능성이나 API 호환성 문제는 여전히 존재하며, 더 많은 코드 예시와 데이터셋 확보가 필요하다. 또한, 모든 시나리오가 실제 운전 상황을 완벽히 반영하지 못할 수 있으며, 추가적인 현실성 검증이 요구된다.
실용적 활용
ChatScene은 자율주행 시스템 개발자들이 다양한 안전-critical 시나리오를 빠르게 생성하고 테스트할 수 있는 도구로 활용될 수 있다. 특히, 강화학습 기반 모델의 안정성 향상을 위한 미세조정 데이터 생성에 효과적이다. 또한, CARLA와 같은 시뮬레이션 플랫폼에서 사용 가능한 코드 생성 기능은 시나리오 테스트의 효율성을 높이며, 산업 현장에서의 실용성을 강화한다.