This paper presents an event-chain-driven, LLM-empowered workflow for generating validated, automotive code from natural-language requirements. A Retrieval-Augmented Generation (RAG) layer retrieves relevant signals from large and evolving Vehicle Signal Specification (VSS) catalogs as code generation prompt context, reducing hallucinations and ensuring architectural correctness. Retrieved signals are mapped and validated before being transformed into event chains that encode causal and timing constraints. These event chains guide and constrain LLM-based code synthesis, ensuring behavioral consistency and real-time feasibility. Based on our initial findings from the emergency braking case study, with the proposed approach, we managed to achieve valid signal usage and consistent code generation without LLM retraining.
翻译:本文提出了一种事件链驱动、基于大语言模型(LLM)赋能的工作流,用于从自然语言需求生成经过验证的汽车代码。检索增强生成(RAG)层从庞大且不断演进的车辆信号规范(VSS)目录中检索相关信号,作为代码生成的提示上下文,从而减少幻觉并确保架构正确性。检索到的信号在转换为编码因果与时序约束的事件链之前,会经过映射和验证。这些事件链引导并约束基于LLM的代码合成,确保行为一致性和实时可行性。基于我们在紧急制动案例研究中的初步发现,采用所提出的方法,我们成功实现了有效的信号使用和一致的代码生成,且无需对LLM进行重新训练。