Manuscript Offprint

arXiv:2608.12304

Constructing Dynamic Master Logic Models as Knowledge Graphs for Complex System Diagnostics Using Retrieval-Augmented Large Language Models

Saman Marandi, Yu-Shu Hu, Mohammad Modarres

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Dynamic Master Logic (DML) provides a hierarchical framework for representing system behavior by linking functional objectives to underlying structural elements. Unlike event-based approaches such as Fault Tree Analysis, DML captures system objectives, functional dependencies, and unanticipated failure scenarios within a unified functional hierarchy. However, DML construction typically relies on expert interpretation of technical documentation, limiting scalability for complex systems. This study presents a framework for automated construction of DML models from system descriptions and their representation as Knowledge Graphs (KG-DML), leveraging Retrieval-Augmented Generation and Large Language Models as the enabling tools. Building upon prior work on small-scale systems, the present work introduces automated construction and evaluation of KG-DML models, extending the paradigm to substantially larger and more complex systems. The proposed approach performs model construction across the hierarchy using targeted retrieval, preserving hierarchical dependencies and explicit logical relationships. The resulting KG-DML supports diagnostic reasoning, safety assessment, and graph-based analysis through upward failure propagation and downward dependency tracing. The framework is evaluated through a multi-level validation methodology that combines layer-specific precision and recall, logical gate consistency analysis, and an aggregate integrity metric capturing both element-level accuracy and system-level structural completeness. Application to the Low-Pressure Coolant Injection system of a decommissioned Boiling Water Reactor demonstrates consistent reconstruction across repeated runs and highlights factors influencing model stability. The results show that automated KG-DML construction can transform technical documentation into executable functional models for diagnostic and reliability analysis.

Keywords: Dynamic Master Logic, Functional Modeling, Knowledge Graphs, Fault Diagnosis, Retrieval-Augmented Generation, Large Language Models

1. Introduction

Modern engineered systems are often composed of many interacting components organized across multiple levels of abstraction. Therefore, modeling these systems accurately requires representations that can account for complex interactions and dependencies. Traditional diagnostic models such as Event Tree Analysis (ETA) [1], [2] and Fault Tree Analysis (FTA) [3], [4] rely on event-driven representations in which faults or initiating events are traced through predefined causal sequences. While effective for known failures, event-driven models require exhaustive fault-event listings, making them inherently incomplete when failure sequences are not anticipated during model development. As systems grow in complexity, tracing failure pathways also becomes increasingly infeasible using event-based logic alone.

Functional modeling offers an alternative approach for complex systems. Functional models describe what the system is intended to accomplish, how objectives are decomposed into functions, and how those functions are realized through interactions among components 1^{1} [5]. By focusing on functions and their dependencies rather than individual events, functional models provide a clearer representation of how component behavior contributes to system-level objectives under both normal and abnormal conditions [6].

Dynamic Master Logic (DML), introduced by Hu and Modarres [7], is a functional modeling framework that represents system behavior through a hierarchy linking functional objectives to underlying structures. DML has been applied in reliability and safety analysis to support reasoning about system behavior and failure mechanisms [8], [9], [10]. In practice, however, constructing DML models has largely relied on manual, expert-driven processes, where developers analyze system descriptions and specifications to interpret system behavior and construct the model. This limits scalability and restricts the use of explicit functional representations needed for reliable reasoning over complex engineering systems documented through extensive technical documentation.

Recent advances in Artificial Intelligence (AI), particularly Large Language Models (LLMs), create new opportunities to support the construction of functional models. Large language models are effective in tasks such as semantic interpretation, text summarization, and generation [11], making them promising tools to help engineers construct functional models from technical documentation. However, LLMs also exhibit important limitations, including inconsistent reasoning, lack of persistent structure, and the potential to generate unsupported information [11], [12]. Recent research has further highlighted the challenge of enabling language models to reason explicitly about actions and their consequences [13]. This limitation is particularly significant in engineering diagnostics that rely on functional models, where accurate reasoning requires not just recognizing relevant information but understanding the functional relationships that govern system behavior. Without an explicit structured representation, an LLM cannot reliably reason about which functions support which objectives or how a component failure cascades through the system. Dynamic Master Logic addresses this limitation by linking objectives, functions, and dependencies into an explicit structured representation that supports traversal and enables LLM agents to reason about functional dependencies and the consequences of component failures, rather than relying solely on generalized language model knowledge. Consequently, accurate DML models provide an explicit knowledge representation that enables grounded LLM-assisted diagnostic reasoning over complex engineering systems.

In our prior work [14], we explored the use of LLMs to construct a Knowledge Graph (KG)-based DML representation for a small-scale system. That study demonstrated the feasibility of generating explicit functional representations capable of supporting LLM-assisted diagnostic reasoning, but did not address scalable construction from large and document-intensive system descriptions. In addition, the evaluation framework was relatively simple and did not systematically assess hierarchical consistency or structural completeness. As systems grow in complexity, these limitations motivate the need for a scalable and rigorously evaluated approach. More importantly, reliable diagnostic reasoning depends on accurate and complete KG-DML models that explicitly capture functional objectives, dependencies, and failure propagation. In practice, constructing such models has relied on manual expert effort, limiting their scalability.

To enable scalable construction of explicit engineering functional representations for grounded diagnostic reasoning, this study presents a framework for automated construction of DML functional models from engineering documentation. Retrieval-Augmented Generation (RAG) is employed as the underlying extraction mechanism to support scalable retrieval from large system descriptions. The

1^{1} In complex systems, components refer its active and passive constituents of the system, they could be complex such a subsystem composed of multiple components in a train of the system, or a simple component.

framework constructs KG-based DML models that closely reflect expert-derived DML structures using information retrieved from authoritative engineering documentation, though the resulting models should be regarded as LLM-informed and require validation against domain expertise. The model is constructed sequentially along the DML hierarchy, with each layer generated from documentation passages retrieved based on the semantic definition of the layer and the parent nodes established in earlier stages. The resulting model is represented as a KG [15] referred to as a KG-DML, which preserves the hierarchical and logical structure of DML.

Since diagnostic reasoning in the proposed framework is performed through deterministic graph traversal and Boolean propagation over the KG-DML, the structural quality of the KG-DML directly determines the quality of the resulting diagnostic inferences. During interaction, the LLM agent is responsible only for interpreting user queries and invoking the appropriate graph-based tools. Errors such as missing elements, incorrect relationships, or incomplete dependency paths can therefore propagate through the model, leading to inaccurate or misleading diagnostic conclusions. Therefore, the proposed evaluation framework examines both layer-specific accuracy and overall structural consistency, combining these into an integrity score that reflects the quality and completeness of the constructed KG-DML.

From a reliability engineering perspective, the proposed framework represents a step in the evolution from manually constructed DML models toward automated, documentation-driven construction, extending the KG-DML paradigm while preserving the functional hierarchy and logical dependency structure that distinguish DML from conventional KG approaches. The resulting executable KG-DML supports diagnostic reasoning, safety assessment, and resilience-oriented analysis through explicit representation of functional dependencies. This work makes three main contributions. First, it introduces an automated approach for constructing DML models from system documentation, leveraging retrieval-augmented LLMs as enabling tools, enabling functional decomposition and dependency identification from unstructured text. Second, it extends our previous small-scale approach to support construction for substantially larger, document-intensive systems. Third, it develops a structured, multi-level evaluation framework for assessing the constructed KG-DML, combining layer-level accuracy metrics with an integrity measure of structural completeness and consistency. The novelty of this work lies not in the individual use of established technologies such as RAG, LLMs, schema-constrained extraction, or graph databases, but in their integration into a coherent framework for automated DML construction from engineering documentation, together with an executable KG-DML representation for engineering safety applications and a principled evaluation methodology.

The remainder of this paper is organized as follows. Section 2 provides background on functional modeling, DML, and the role of LLMs in fault diagnosis. Section 3 presents the research overview. Section 4 describes the proposed framework, including DML model construction, evaluation and interaction. Section 5 presents the case study. Section 6 reports results including evaluation and sample diagnostic insights. Section 7 discusses the findings, limitations, and future work. Section 8 concludes the paper.

References (69)