Aegis:An Advanced LLM -Based Multi-Agent for Intelligent Functional Safety Engineering (2024)

Abstract: Functional safety is a critical aspect of automotive engineering, encompassing all phases of a vehicle’s lifecycle, including design, development, production, operation, and decommissioning. This domain involves highly knowledge-intensive tasks. This paper introduces Aegis: An Advanced LLM-Based Multi-Agent for Intelligent Functional Safety Engineering. Aegis is specifically designed to support complex functional safety tasks within the automotive sector. It is tailored to perform Hazard Analysis and Risk Assessment (HARA), document Functional Safety Requirements (FSR), and plan test cases for Automatic Emergency Braking (AEB) systems. The most advanced version, Aegis-Max, leverages Retrieval-Augmented Generation (RAG) and reflective mechanisms to enhance its capability in managing complex, knowledge-intensive tasks. Additionally, targeted prompt refinement by professional functional safety practitioners can significantly optimize Aegis’s performance in the functional safety domain. This paper demonstrates the potential of Aegis to improve the efficiency and effectiveness of functional safety processes in automotive engineering.

## introduction the functional safety requirements cover all activities throughout the vehicle's lifecycle, including design, development, production, operation, and decommissioning (international organization for @xcite . according to iso 26262, functional safety activities for on-road vehicles, compliant with regulations and project experience, are organized according to the v-model, covering all critical activities from the concept phase to the decommissioning phase, as illustrated in figure 1 . implementing functional safety requires thorough knowledge of standards like iso 26262 and iec 61508, covering safety requirements from analysis to maintenance, and necessitates professional expertise @xcite . high-level systems thinking, statistical skills, and deep domain knowledge are essential for identifying hazards and analyzing risks using techniques like fault tree analysis (fta) and failure mode and effects analysis (fmea) @xcite . defining safety requirements and designing effective safety mechanisms involve interdisciplinary knowledge in hardware design, software development, and safety engineering. achieving safety integrity level (sil) requires rigorous verification and validation through extensive testing, including functional verification, software and hardware testing, system integration testing, and validation of safety of the intended functionality (sov) and safety of the intended use (soc) (international organization for standardization, 2011). configuration management and change control are crucial for maintaining system safety throughout the product lifecycle, involving tracking and assessing changes to prevent new risks (international organization for standardization, 2011). continuous learning and knowledge updates are essential due to evolving automotive e/e systems and advancements in autonomous driving algorithms @xcite . these characteristics fully demonstrate that functional safety activi-ties are knowledge-intensive work which refers to tasks that require significant cognitive effort and specialized expertise to complete. large language models (llms) are highly appropriate for addressing knowledge-intensive tasks owing to their robust capabilities in knowledge acquisition, storage, and application @xcite . llms have already been used in hara analysis @xcite . however, llms can sometimes generate inaccurate information, especially when dealing with domain-specific or complex issues @xcite . for instance, if an llm is provided with a functional requirement for automatic emergency braking (aeb) and tasked with conducting a hazard analysis and risk assessment (hara) in accordance with ul4600, it may not produce an accurate response if it has not been trained on the ul4600 regulations. to address such situations, retrieval-augmented generation (rag) can incorporate external knowledge from databases to solve these domain-specific, knowledge-intensive tasks @xcite . additionally, training and fine-tuning llms to locate and modify specific knowledge stored within the models can also address information gaps or inaccuracies @xcite @xcite . considering that pre-training large models is a resource-intensive process with high costs, and that fine-tuning still demands substantial computational resources-with costs varying according to task complexity, data volume, and model size @xcite -we propose using rag to extend llm knowledge in the specific domain of functional safety. rag allows for low-cost integration of new domain knowledge by incorporating both the internal and external functional safety regulations, automotive e/e system requirements, papers verification and validation processes, and other expert knowledge into external databases (vector database and file system). by employing retrieval, generation, and augmentation techniques, rag supports the entire functional safety lifecycle. this approach not only enhances the llm's capabilities in functional safety but also ensures that the system remains up-to-date with the latest domain-specific information. llms have the distinct capability of assuming different roles when given specific identity prompts, thereby simulating the social division of labor in the real world. llm-based multi-agents enhance task performance through social behaviors such as collaboration and competition. these agents can encourage divergent thinking, improve reasoning capabilities, and reduce hallucinations, making them well-suited for handling complex knowledge tasks. in functional safety activities, as illustrated in figure 1 , various roles such as functional safety manager, v&v engineer, and others are involved. these roles collaborate to accomplish complex functional safety tasks that span different domains, such as hara analysis and functional safety validation. by establishing a multi-agent system where each agent focuses on its specific tasks within the functional safety lifecycle, they can collectively achieve the overall functional safety goals through coordinated efforts. in this paper, we propose aegis, an llm-based multi-agent system designed to support functional safety activities. the system is specifically tailored to carry out hazard analysis and risk assessment (hara), functional safety requirements (fsr) documentation, and test case planning tasks for an automatic emergency braking (aeb) system. additionally, it automatically creates associations and mappings between safety goals (sg), fsr, and test cases. in comparison to existing tools like medini an-alyze® and vector informatik, aegis's key innovation lies in its higher level of automation. while current tools require significant manual input, aegis introduces a hierarchical multi-agent framework and retrieval-augmented generation (rag) to dynamically integrate external standards (e.g., iso 26262, vda 702), providing real-time compliance updates. this significantly enhances both the automation and precision of complex functional safety tasks. we designed three versions of aegis based on the llm qwen-max which is is a trillion-parameter large-scale language model from alibaba @xcite : we also introduced professional functional safety practitioners to provide few-shot prompts and conducted two rounds of targeted prompt refinement to guide the agents in performing higherquality functional safety activities. to evaluate the task outcomes, we established a set of assessment criteria derived from experienced functional safety experts and regulations. both gpt-4o and seasoned functional safety experts scored and assessed the agents' outputs multiple times. the findings indicate that aegis-pro, by adding more agent roles compared to aegis-lite, increased the accuracy of hara analysis and fsr generation while reducing incorrect responses. with improved prompts, the agents provided more accurate answers to detailed queries. furthermore, the inclusion of rag and reflection mechanisms in aegis-max enhanced the comprehensiveness of hara analysis and the coverage of generated test cases. ## aegis design aegis-max aims to automate functional safety activities for aeb requirements. its primary functions include performing functional safety hara analysis, developing fsrs, and writing test cases. aegis-max integrates multiple roles and components, including the functional safety manager, functional safety expert, and verification and validation (v&v) engineer, each with specific tasks and responsibilities. in aegis, agents independently perform tasks like hazard analysis or test case planning. each agent operates autonomously within its role and coordinates with others to achieve common goals, ensuring flexibility and efficiency in handling complex functional safety tasks. figure 2 shows the workflow of aegis-max and the description is below: input user provides the aeb requirement and poses the question: "please generate the functional activities with the input requirement {require-ment}." the document is divided into smaller chunks with a size of 2000 and an overlap of 10 to avoid issues caused by exceeding the length limitation of qwen-max. ## experiments and evaluation to evaluate aegis's performance in executing complex functional safety tasks, we tested and assessed aegis-lite, aegis-pro, and aegis-max. we conducted two types of evaluations: (1) human evaluation, and (2) gpt-4o evaluation @xcite . for vehicle functional safety, aegis provides 20 functional safety requirements and corresponding test cases for the vehicle each time it runs, presenting a comprehensive final solution. this solution is then compared with a single solution generated by the gpt-4o model. to ensure fairness, the gpt-4o was also provided with the relevant knowledge base documents and the same prompts. see appendix a.1 for details. ## future work the moa @xcite framework has demonstrated exceptional performance in complex natural language understanding and generation tasks by employing a layered architecture of collaborative agents. it optimizes the outputs of multiple llms to produce high-quality responses. inspired by moa, layered optimization utilizing multiple llms may further enhance the response quality of our multi-agent collaration system, which uses a single model per generation process. additionally, to improve memory capabilities, memorybank's @xcite storage, retrieval, and updating mechanisms could be integrated into our system for dynamic memory updating and efficient retrieval. this would enable more precise safety responses and personalized risk management. however, introducing these methods requires balancing additional consumption, such as response time and storage resources. we leave this for future research. currently, the system relies on expert-driven prompt optimization. to reduce this dependency and improve scalability, we are developing automated prompt generation using self-reflective mechanisms. this will reduce the need for expert intervention and make the system more adaptable to large-scale applications, improving its performance in various scenarios. while aegis currently focuses on functional safety, its multi-agent architecture and rag integration make it adaptable to other domains, such as anticipated functional safety and information security. the system can be applied to any product involving safety activities, providing a flexible framework for different safety engineering needs. future work will explore the system's effectiveness in these areas, expanding its applicability to other industries.