Think Inside the Chunk: RegulaRAG for Regulation-Compliant Scenario Generation using LLMs: A Case Study of UN Regulation No. 152
Organizations: Chair of Robotics, Artificial Intelligence (AI) and Embedded Systems, Technical University of Munich, Munich, Germany
Abstract
Generating regulation-compliant test scenarios is essential for validating safety-critical automotive systems, yet Large Language Models (LLMs) struggle to ground outputs in long, hierarchical standards. We present RegulaRAG, a Retrieval-Augmented Generation (RAG) pipeline that couples SmartChunking, reference-aware enrichment of paragraphs and tables via graph traversal, with Smart Retrieve & Rerank over these enriched units. To test our system, we evaluate on a manually curated dataset covering all scenarios in UN Regulation No. 152 (AEBS). Our study comprises: (i) a three-step progressive search that identifies near-optimal retrieval parameters without exhaustive grid search; (ii) head-to-head comparisons against five baseline RAG systems; and (iii) a robustness stress test that scales the source corpus with distractor content. Outputs are evaluated using a customized penalized scoring metric. Across all experiments, RegulaRAG achieves the highest average Meta-Score (82.99), outperforming the next-best system by 43% (NoRAG: 57.94), while operating at 14k-25k tokens per query versus up to 500k for graphcentric baselines. It maintains strong performance, remaining stable even as the number of regulatory sources grows, whereas competing RAG systems degrade sharply in both quality and robustness.
Figures & tables
| Category | Condition | Num Scenarios |
| CtoStC | unladen | 12 |
| laden | 12 | |
| CtoMoC | unladen | 8 |
| laden | 7 | |
| CtoP | MassRun | 10 |
| MaxMass | 10 |
| RAG System | Model | CtoStC ( ) | CtoMoC ( ) | CtoP ( ) | Mean ( ) | stdev ( ) | Meta-Score ( ) | Avg. 3 LLMs ( ) |
| RegulaRAG | GPT-4o | 76.92 | 96.55 | 100.00 | 91.16 | 10.16 | 80.99 | 82.99 |
| DeepSeek-chat | 85.71 | 96.55 | 97.44 | 93.23 | 5.33 | 87.90 | ||
| Llama-3.3 | 76.92 | 96.55 | 91.89 | 88.45 | 8.37 | 80.08 | ||
| R&R+RCS | GPT-4o | 8.00 | 88.89 | 91.89 | 62.93 | 38.86 | 24.07 | 8.88 |
| DeepSeek-chat | 0.00 | 0.00 | 97.44 | 32.48 | 45.93 | -13.45 | ||
| Llama-3.3 | 76.92 | 0.00 | 91.89 | 56.27 | 40.26 | 16.01 |
| Two vehicles of Category M1 AA saloon shall be positioned. The subject vehicle that performs the braking and the lead vehicle. |
| Both vehicles should face in the same direction of travel. |
| The subject vehicle shall approach the lead vehicle in a straight line for at least 2 s before the functional part of the test commences. |
| The subject vehicle should travel at the speed of 10 km/h (with a tolerance of 0/ 2 km/h) when the vehicle brakes. |
| The functional part of the test shall start at a distance corresponding to a Time To Collision (TTC) of at least 4 seconds from the target. |
| The subject vehicle is unladen. |
| The lead vehicle is stationary. |
Retrieval-Augmented Generation
Retrieval-augmented generation connects language models to external knowledge so answers can use current, domain-specific evidence.
See all 792 papers