## 2 Materials and Methods
### System Architecture
#### 2.1.1 Modular Layered Design
In our architecture, this layer is crucial for training both the triage decision models and any language models on distributed text corpora (whether labeled or unlabeled, which dictates the specific learning objective but does not alter the underlying privacy guarantees). For example, if several hospitals use the system, they can collaboratively fine-tune an embedded LLM on their combined clinical note data without sharing actual notes with each other, thereby adapting the LLM to their medical domain jargon in a compliant manner. We also incorporate periodic evaluation rounds in FL--e.g., a set of common validation cases--to assess the performance of the global model after each round and ensure it is improving consistently. Figure 2 details the message exchange between local FL clients, the secure-aggregation service, and the privacy monitor. FL synchronization in our proposed system occurs periodically, typically at defined intervals such as daily or weekly, depending on institutional preference and clinical workflow constraints. During each synchronization round, local models are trained independently at each participating institution on their respective patient data. Only the resulting model updates--specifically encrypted gradients or weight differentials--are securely transmitted to a central coordinator. The coordinator aggregates these updates using secure aggregation methods, such as federated averaging, and returns the updated global model to the institutions. This methodology significantly minimizes communication overhead by avoiding the exchange of large datasets or frequent updates. Figure 2: FL and Privacy Workflow. Note that secure aggregation prevents the coordinator from viewing individual gradients, addressing GDPR concerns. 4. **LLM Layer. ** This layer embeds one or more LLMs into the CDSS for tasks involving natural language understanding and generation. The LLMs (such as a fine-tuned version of the LlaMA-3 [48] of Meta or an open medical model like MedAlpaca [49]) can serve multiple functions: * **Clinical Text Understanding. ** The LLM processes unstructured inputs--e.g., the free-text note of a triage nurse describing the symptoms of a patient--and extracts structured information or meaning. It can perform clinical NER (finding mentions of conditions, medications), summarization of patient history, or translation of layperson language into medical terminology. * **Question Answering and Reasoning. ** Clinicians can query the system in natural language, and the LLM will attempt to answer. For instance, a doctor might ask, \"What is the recommended triage level for a 45-year-old patient with chest pain and sweating?\". The LLM, using its medical knowledge and the data of the patient, can provide an answer or explanation. This is akin to having a knowledgeable assistant that has read vast amounts of medical literature and patient cases). Our system uses the LLM to generate differential diagnoses or triage justification texts that accompany the decision support output. * **Integration with Decision Logic. ** Outputs from the LLM layer feed into the DSE. For example, the LLM might flag that a note of the patient contains the phrase \"central crushing chest pain,\" which is suggestive of a myocardial infarction. This finding can be passed as a feature into a rule-based triage algorithm or combined with structured data (like an elevated troponin lab result) to determine a high-acuity triage classification. To further improve factual grounding and reduce hallucinations, the LLM can be integrated with Retrieval-Augmented Generation (RAG) pipelines that retrieve relevant documents during inference [50]. The LLM layer thus augments traditional CDSS algorithms with knowledge extracted from text that would otherwise require manual review. This layer also synergizes with the FL layer when fine-tuning LLMs on local data.