Manuscript Offprint
arXiv:2611.09232RAG-Enhanced LLMs for Interactive Explainability in Clinical Decision Support Systems
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Lorenzo Mannocci¹ (✉)[0000-0002-5556-3746], Francesca Naretto²[0000-0003-1301-7787], Lucia Passaro²[0000-0003-4934-5344], and Anna Monreale²[0000-0001-8541-0284]
¹ University of Pisa, Italy {lorenzo.mannocci}@di.unipi.it ² University of Pisa, Italy {francesca.naretto, lucia.passaro, anna.monreale}@unipi.it
Abstract. Artificial Intelligence (AI) is increasingly embedded in high-risks decision-making systems across domains such as healthcare, finance, and the judicial system. As reliance on predictive models grows, so does the demand for Explainable AI (XAI) to ensure transparency, trust, and interpretability. However, existing XAI approaches often fail to present explanations in a format accessible to domain experts, limiting their practical utility. Large Language Models (LLMs) have recently emerged as a bridge between complex models and end-users, offering natural language explanations. Yet, their use introduces new risks, including hallucinated outputs and lack of source traceability. To address these challenges, we propose a Clinical Decision Support System (CDSS) that not only combines standard predictive models with XAI techniques but also incorporates a Retrieval-Augmented Generation module as an interactive enhancer. This module grounds explanations in verified medical knowledge, reformulates technical outputs into a human-like format, and enables users—such as clinicians—to actively query the system. By fostering an interactive, human-in-the-loop environment, our approach empowers domain experts to explore model decisions, contextualize explanations, and build trust in AI-assisted diagnostics. The study concludes with preliminary experiments validating the proposed methodology.
Keywords: explainable AI · human computer interaction · retrieval-augmented generation · large language models · clinical decision support system.
- This is the preprint version of the conference paper published by Springer. Please cite the published version: Lorenzo Mannocci, Francesca Naretto, Lucia Passaro, and Anna Monreale (2026). RAG-Enhanced LLMs for Interactive Explainability in Clinical Decision Support Systems. Artificial Intelligence for Healthcare, and Hybrid Models for Coupling Deductive and Inductive Reasoning. HC_AIxIA_HYDRA 2025. Communications in Computer and Information Science, vol. 2830, pp. 50–63. Springer, Cham. https://doi.org/10.1007/978-3-032-16708-8_4
1 Introduction
Artificial Intelligence (AI) has rapidly evolved to become a crucial component in decision-making systems across various fields, including healthcare [42], finance [7], law enforcement [38], and the judicial system [34]. The increasing reliance on predictive models in these domains necessitates the development of methods to explain their outputs, a requirement that has led to the emergence of Explainable Artificial Intelligence (XAI) [20, 16]. XAI aims to make AI models more interpretable, transparent, and trustworthy, ensuring that domain experts and end-users can understand and assess the rationale behind automated decisions [10, 31]. The need for trust and transparency in AI decision-making has also been recognized at the regulatory level. The European Union's AI Act [37], one of the first comprehensive legal frameworks for AI, emphasizes the importance of explainability, particularly for high-risk AI applications. The AI Act mandates that AI systems used in critical sectors provide clear, understandable, and verifiable explanations to ensure accountability and fairness. This regulatory push further underscores the necessity of effective XAI techniques that can meet both ethical and legal standards while supporting domain experts in making informed decisions.
Many high-risk applications depend on predictive models that significantly impact human lives. In healthcare, AI-driven diagnostic systems assist doctors in detecting diseases, recommending treatments, and predicting patient outcomes [42]. In the judicial system, predictive models inform parole decisions and risk assessments [34]. Despite their effectiveness, these models often operate as black boxes, making it difficult for domain experts to verify their outputs and detect potential biases. Without proper interpretability, decision-makers may struggle to trust AI-driven recommendations, leading to ethical, legal, and social concerns. Indeed, these explanations might be difficult to interpret, particularly for professionals outside the field of computer science, such as doctors, lawyers, or policymakers. The challenge lies in presenting these explanations in a way that aligns with the expertise and expectations of the end-users [9]. For example, rule-based explainability methods may generate decision rules with numerical thresholds that do not align with conventional domain knowledge. In medical applications, an AI model might define a risk threshold for blood pressure or glucose levels that deviates from commonly accepted medical guidelines, creating confusion among clinicians. Without proper contextualization, such outputs can diminish trust in the AI system rather than enhancing its credibility. Moreover, existing XAI methods often fail to present explanations in a format that is intuitive and easily digestible for domain experts. This limitation has led to the integration of Large Language Models (LLMs) as interfaces for explainability, offering a more natural and human-like explanations for AI predictions [3].
LLMs have been increasingly employed as mediators between complex AI models and domain experts, translating complex mathematical justifications into human-like explanations. By reformatting and simplifying the outputs of XAI techniques, LLMs can substantially enhance the interpretability of AI-driven decisions [3]. In a healthcare setting, for instance, an LLM can transform a technical explanation of a machine learning model's prediction into a structured summary that aligns with a physician's diagnostic workflow [23, 30]. More recently, LLMs have been leveraged not only to translate explanations into natural language but also to enrich them with contextual information drawn from their pre-trained knowledge [36]. However, this approach introduces an additional layer of complexity and potential risk. LLMs are known to occasionally produce inaccurate or misleading outputs, a phenomenon referred to as hallucinations [24]. Furthermore, these models typically do not provide access to the underlying sources that support their responses, limiting transparency and traceability [27].
One promising approach to mitigating LLM hallucinations in XAI is the use of Retrieval-Augmented Generation (RAG) [26]. RAG enhances LLM-generated explanations by grounding them in an external, domain-specific knowledge base. Instead of relying solely on the LLM's pre-trained knowledge, RAG retrieves relevant information from a curated database to provide more accurate and reliable explanations. In the context of XAI, RAG can address two critical challenges. First, it reduces the risk of hallucinations by ensuring that explanations are based on verified sources rather than probabilistic text generation. Second, it allows for the integration of domain-specific knowledge, ensuring that explanations adhere to established medical, legal, or financial guidelines. By leveraging RAG, AI-generated explanations can be aligned more closely with experts' expectations, thereby increasing trust and usability in real-world applications.
In this work, we present, to the best of our knowledge, the first Clinical Decision Support System (CDSS) that integrates standard predictive models with XAI techniques and RAG-enhanced explanations. The proposed system consists of three key components:
- Predictive Model: A standard classifier, such as a neural network or a random forest, that generates predictions based on patient data;
- Explainer: An explanation method that provides insights into the model's decision-making process through feature importance-based explanations (e.g., LIME [39] and SHAP [28]), decision rules (e.g., LORE [19]) or exemplars and counter-exemplars [18];
- RAG-Based enhancer module: A module built on RAG that enhances explanations by grounding them in reliable medical knowledge, mitigating hallucinations, and transforming traditional explanations into more human-readable, context-aware formats. It also serves as an interactive tool, allowing end users to ask specific questions and explore the patient's clinical profile in relation to the model's predictions and explanations.
By combining standard classifiers with RAG-based explanations grounded in verified medical sources, our system enhances the trustworthiness and domain relevance of AI-driven medical decisions. This approach addresses key limitations of conventional XAI by providing interpretable, reliable insights tailored to healthcare professionals. The study concludes with preliminary experiments validating the proposed methodology.
We focus next on two key areas: post-hoc explanations, which analyze model behavior after predictions are made, and human-centered explanations, which adapt to user needs to improve interpretability.
2.1 Post-hoc explanations
In the context of post-hoc explanation methods for black-box models applied to tabular data, both local and global approaches have been extensively studied and benchmarked [5]. Local explanation methods aim to interpret individual predictions by approximating the model's behavior in the vicinity of a specific instance. One of the most widely known techniques in this category is LIME, which builds a simple surrogate model—usually linear—on a locally perturbed dataset to estimate the contribution of each feature [39]. Although popular, LIME suffers from instability due to its random neighborhood generation strategy. A more theoretically grounded alternative is SHAP, which relies on Shapley values from cooperative game theory to assign each feature an importance score based on its marginal contribution across all possible feature combinations [28]. SHAP ensures consistency and local accuracy, making it a robust choice for feature attribution. Another relevant method is LORE, which employs genetic algorithms to generate a neighborhood and extracts interpretable decision rules, offering both factual and counterfactual explanations [19]. Other approaches provide local explanations which are based on exemplars or better counter-exemplars, which enable a counterfactual reasoning that in some sense produce suggestions to users on what is possible to change for obtaining a different decision from the machine learning model [18].
On the other hand, global explanation methods focus on understanding the model's logic over the entire input space. RuleFit combines decision rules extracted from tree ensembles with linear models to produce sparse, interpretable explanations of model behavior. Building upon this idea, SkopeRules uses ensemble techniques to extract a set of high-precision rules that summarize the model's decision boundaries [14]. More recently, Setzu et al. [41] proposed GLocalX, which aggregates local explanations to form a coherent global understand-ing of the model, effectively bridging the gap between local interpretability and global insight. These methods, differing in their assumptions and strategies, collectively contribute to the growing toolbox of post-hoc XAI techniques tailored for tabular data.
2.2 Human-centered explanations
Both post-hoc and intrinsic XAI methods have advanced model interpretability, yet a key challenge remains: ensuring explanations are truly comprehensible to end users. Human-centered XAI addresses this by aligning explanations with user needs through participatory design methods such as interviews and user studies [2, 12, 11]. This approach emphasizes contextualized explanations that integrate seamlessly into user workflows and are validated through real-world testing [25, 45].
Recent work explores how LLMs can enhance explanation quality by generating adaptive, narrative-style outputs that combine predictions with counterfactuals [29, 23]. For example, x-[plAIn] [30] uses a customized LLM to generate concise, audience-specific summaries of XAI methods. Narrative explanations are also being explored across data types, including tabular data[6, 48], graphs [17, 35], and images [44].
Initially framed as a data-to-text task, LLM-generated narratives have evolved to incorporate broader knowledge, adding context and reasoning beyond simple summaries [29]. A recent pilot study found users preferred such narratives over SHAP plots across several metrics [48]. This approach aligns with the concept of self-explanations, where models articulate reasoning to aid understanding [22]. However, it also introduces risks like adversarial helpfulness, where convincing but incorrect explanations may mislead users [1]. RAG helps mitigate this by grounding outputs in trusted sources, improving factual accuracy and transparency [15]. Similarly, Park et al. [36] combine LLMs with knowledge graphs to generate structured, domain-specific explanations that are both clinically accurate and contextually rich.
3 Method
In light of the growing need for human-centered explanations and the impressive capabilities of LLMs to generate human-like responses, challenges arise, particularly when LLMs produce convincing yet incorrect answers or exhibit hallucinations. These issues can compromise the reliability of explanations and erode user trust. To address these concerns, we propose leveraging RAG, a system that combines the generative power of LLMs with the reliability of external, grounded, and reliable sources. By integrating RAG, we ensure that the explanations are not only contextually rich and human-readable but also rooted in verifiable information, thereby enhancing both accuracy and transparency in the model's outputs. Figure 1 illustrates the approach proposed in this work, which

Fig. 1. Pipeline of the proposed Clinical Decision Support System (CDSS), integrating a predictive model, an explainer, a RAG-based enhancer that enriches and contextualizes explanations using external medical knowledge, and a selector module that governs information delivery based on confidence and consistency.
combines traditional classifiers, such as black-box models, with standard explainers like LIME or SHAP, alongside an enhancement module based on RAG. The final output of this integrated method is then processed by a selector. In the following sections, we provide a detailed description of each step in the method.
3.1 Black-box model and explainer
A classification task is formally defined as follows. Given a dataset , where represents the input feature vectors, with for each , and being the dimensionality of the input space, and is the corresponding target vector, where each represents a class label for the -th data point. The goal is to learn a mapping , where is the predicted class label set. The model used to perform the classification is a black-box classifier , such that the predicted output is generated for each input . This predicted label is then compared with the true label for evaluation of the model's performance.
A local explainer is defined as a function that takes as input a specific instance and its predicted label , and outputs an explanation . This explanation can take various forms, such as feature importance, decision rules, exemplars, etc. Formally, a local explainer can be defined as function , where is the explanation set. An explanation aims to provide insight into the reasoning of the black-box classifier for the prediction of the specific instance .
3.2 Enhancer
The enhancer module, based on RAG, is designed to support three distinct tasks: context explanation, classifier and XAI, and question & answer. Each component in the pipeline operates independently and could, in principle, be implemented using LLM instead of a RAG-based approach. However, rather than relying solely on the LLM's pre-trained knowledge, RAG retrieves relevant information from a curated medical database to generate more accurate, contextualized, and reliable explanations.
In the following we described in detail the three potential enhancer's tasks:
Context explanation. This task enriches an existing explanation by converting the explanation into a human-like format and integrating context from the RAG's specialized corpus. This task takes as input the feature vector , the prediction made by the classifier, and the initial explanation generated by the local explainer, and provides an enhanced explanation , by exploiting the RAG system. It can be formally defined as a function , where is the enhanced explanation set. In particular the RAG system enriches the explanation by incorporating contextual knowledge from the corpus and transforming it into a more human-comprehensible format. The resulting output, , is an enriched, human-like explanation that offers a clearer, more detailed understanding of the model's decision-making process, grounded in both the prediction and the context of the input data;
Classifier and XAI. In this task, the RAG serves as both a classifier and an explanation generator. Formally, the task can be defined as: , where the RAG is provided with the input feature vector and performs a classification along with an explanation supporting the prediction. The output consists of the predicted label and an explanation .
Question & answer. This task is the most flexible method for interacting with the system, allowing users to request interactive explanations. It is performed at the end of the pipeline, once the user has received the initial results from the entire decision support system. In this task, a question is provided as input along with the entire system's information. The output is the answer to the question, which may take various forms depending on the nature of . This task allows the user to query the system for additional information coming from the specialized corpus of the RAG, clarification, or deeper insights into the model's predictions and explanations, providing an interactive and dynamic way to explore and understand the decision-making process of the AI model.
3.3 Selector
The final component of the proposed method is the selector, serves as a filtering and governance layer for the information presented to the user. It receives as input the black-box model's prediction , the enhanced explanation , the enhancer's prediction , and the enhancer's explanation . The primary function of the selector is to implement the decision making strategy based on the input information, ensuring that the system refrains from presenting information when confidence is insufficient or conflicting. For example, a simple but effective implementation of the selector may involve outputting the enhancer's explanation only if the black-box classifier's prediction matches the enhancer's prediction . This strategy prioritizes trust in the black-box classifier, thereby mitigating the risk of misleading or hallucinated outputs that might arise from the RAG-based enhancer. Although this represents a minimal implementation, the design space for selector strategies is broad and can be extended to incorporate more sophisticated techniques for confidence estimation, consistency checking, and risk-aware decision-making, ultimately improving the reliability and robustness of the entire AI pipeline.
4 Experiments and results
In this section, we show some preliminary results of a specific instantiation of our methodology.
4.1 Dataset and experimental setting
We evaluate our proposed method using the Pima Indians Diabetes Database [43], a publicly available dataset³ originally provided by the National Institute of Diabetes and Digestive and Kidney Diseases. The goal is to diagnostically predict the presence of diabetes in a patient based on a set of clinical attributes. Prior to training, the dataset is standardized using a standard scaler, and we applied random oversampling to balance the class distribution by increasing the number of instances in the minority class, i.e., patients diagnosed with diabetes. As black-box model, we employed a Random Forest classifier trained on an 80/20 train-test split, using a grid search and 3-fold cross-validation to optimize the hyperparameters. For local explanations, we use LIME [39], which provides feature importance scores for each prediction. The enhancer module builds on the MedRAG framework⁴, introduced by [46], leveraging the StatPearls corpus for clinical decision support and the MedCPT retriever tailored for biomedical content. The LLM used for generation is Mixtral⁵. Finally, the selector filters the enhancer's output, returning the RAG-based explanation only when the enhancer's prediction matches the black-box prediction , ensuring that explanations are only provided when there is consistency across models.
³ https://www.kaggle.com/datasets/uciml/pima-indians-diabetes-database (accessed: 19/07/2025) ⁴ https://github.com/Teddy-XiongGZ/MedRAG (accessed: 19/07/2025) ⁵ https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1 (accessed: 19/07/2025)
Table 1. Classification performance comparison on test set between Random Forest and MedRAG.
| model | diabetes precision | recall | f1-score | accuracy | agreement |
|---|---|---|---|---|---|
| Random Forest | no | 0.82 | 0.79 | 0.80 | 0.75 |
| yes | 0.64 | 0.69 | 0.66 | ||
| MedRag | no | 0.77 | 0.80 | 0.78 | 0.71 |
| yes | 0.60 | 0.56 | 0.58 |
The Classifier & XAI task receives as input the patient's DESCRIPTION, represented by the feature vector . The Context explanation task extends this input by including the black-box PREDICTION and the corresponding EXPLANATION provided by the explainer (LIME in this case). Lastly, the Question & answer task builds upon the inputs of the Context explanation task by incorporating a user-defined QUESTION , which MedRAG must answer based on the available information. In Appendix A, we provide an example of input and output of the enhancer. Figure 3 illustrates the prompt templates employed by the enhancer module to query MedRAG, based on the specific tasks defined in Section 3. Instead, Figure 4 shows an example instance from the PIMA dataset, for which the selector's strategy is satisfied. In the table on the top left, we display the patient features along with the classifier's prediction and the enhanced prediction generated by the RAG system. The top right section shows the feature importance values calculated using LIME, while the bottom section illustrates the output of the enhancer module based on the RAG system. It can be observed that the explanation provided by the RAG system is consistent with the one generated by LIME. Additionally, the RAG-based explanation includes references to the relevant documents in the corpus that support the explanation, thereby enabling the validation of the RAG's output.
4.2 Preliminary results
In this work, we present a preliminary evaluation of the proposed methodology to highlight the importance of integrating both a predictive model and the RAG module within the same system. To this end, we compare the predictive performance of the Random Forest (RF) classifier and the MedRAG model on the Pima Indians Diabetes dataset. The results are reported in Table 1. Given the imbalanced nature of the dataset, with 65% of the records indicating no diabetes, the f1-score serves as the primary evaluation metric, alongside the recall for the "yes" class. This focus is driven by the importance of identifying as many diabetic cases as possible, even at the cost of some false positives. In this context, the Random Forest model outperforms MedRAG, particularly in the detection of diabetes cases, where it achieves an f1-score of 0.66 compared to MedRAG's 0.58. Furthermore, 82% of the time, both models agree on the prediction, which is the condition required for the selector to output the enhancer's explanation . Figure 2 further breaks down this agreement, showing that the majority of instances where the models agree, they are correct. The second most frequent

Fig. 2. Bar plot showing the agreement counts in the prediction task comparing Random Forest and MedRAG models.
combination is when both models agree and are wrong. Notably, when the models disagree, the Random Forest model is more often correct than MedRAG, highlighting the greater reliability of the former in making accurate predictions.
5 Discussion and conclusions
Our results show that the traditional Random Forest model outperformed the RAG-based system, supporting its continued use in our CDSS. Nonetheless, the strong agreement between the two models suggests that RAG-generated explanations can complement traditional ones, enhancing interpretability and user trust.
These preliminary findings, though promising, are limited by the small dataset, largely due to the computational cost of RAG. Expanding experiments to other clinical datasets and black-box models will help validate the system's generalizability. Future work should also explore: i) the impact to use a LLM tailored to medical domain instead of a generalist LLM, and ii) how factors like model confidence and explanation alignment affect the CDSS's reliability.
Privacy remains a major concern, particularly when integrating LLMs and RAG in healthcare [33, 32]. Explanations often require access to sensitive clinical data, and using closed-source LLMs risks violating patient confidentiality and regulations like GDPR [47, 8]. Addressing these challenges will require privacy-preserving techniques such as local inference, federated learning [21, 13], and unlearning methods [4].
In summary, we propose a hybrid XAI approach that combines traditional models with generative enhancers to support interpretable, human-aligned AI in clinical contexts. While further validation is needed, this work takes a step toward more transparent and responsible decision support systems.
Acknowledgments. This research was partially supported by: The European Commission under the NextGeneration EU programme – National Recovery and Resilience Plan (PNRR), under agreements: PNRR - M4C2 - Investimento 1.3, Partenariato Eseso PE00000013 - "FAIR - Future Artificial Intelligence Research" - Spoke 1 "Human-centered AI", and SoBigData.it – "Strengthening the Italian RI for Social Mining and Big Data Analytics" – Prot. IR0000013 – Avviso n. 3264 del 28/12/2021. The European Union's Horizon Europe research and innovation programme for the project FINDHR (g.a. No. 101070212), and under the Excellent Science European Research Council (ERC) programme for the XAI project (g.a. No. 834756), and the HORIZON Europe projects TANGO - Grant Agreement n. 101120763 Views and opinions expressed are those of the author(s) only and do not necessarily reflect those of the European Union. Neither the European Union nor the granting authority can be held responsible for them.
References
-
Ajwani, R., Javaji, S.R., Rudzicz, F., Zhu, Z.: LLM-generated black-box explanations can be adversarially helpful. arXiv preprint arXiv:2405.06800 (2024)
-
Amershi, S., Weld, D., Vorvoreanu, M., Fourney, A., Nushi, B., Collisson, P., Suh, J., Iqbal, S., Bennett, P.N., Inkpen, K., et al.: Guidelines for human-AI interaction. In: Conference on Human Factors in Computing Systems CHI. pp. 1–13 (2019)
-
Bilal, A., Ebert, D., Lin, B.: LLMs for explainable AI: A comprehensive survey. arXiv preprint arXiv:2504.00125 (2025)
-
Blanco-Justicia, A., Jebreel, N., Manzanares-Salor, B., Sánchez, D., Domingo-Ferrer, J., Collell, G., Eeik Tan, K.: Digital forgetting in large language models: A survey of unlearning methods. Artificial Intelligence Review 58(3), 90 (2025)
-
Bodria, F., Giannotti, F., Guidotti, R., Naretto, F., Pedreschi, D., Rinzivillo, S.: Benchmarking and survey of explanation methods for black box models. Data Mining and Knowledge Discovery 37(5), 1719–1778 (2023)
-
Burton, J., Al Moubayed, N., Enshaei, A.: Natural language explanations for machine learning classification decisions. In: International Joint Conference on Neural Networks IJCNN. pp. 1–9. IEEE (2023)
-
Cao, L.: AI in finance: challenges, techniques, and opportunities. ACM Computing Surveys 55(3), 1–38 (2022)
-
Chadwick, R., Blundell, S., Prendergast, E.: Assessments of the privacy compliance in commercial large language models (2024)
-
Conati, C., Barral, O., Putnam, V., Rieger, L.: Toward personalized XAI: A case study in intelligent tutoring systems. Artificial intelligence 298, 103503 (2021)
-
Doshi-Velez, F., Kim, B.: Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608 (2017)
-
Ehsan, U., Riedl, M.O.: Human-centered explainable AI: Towards a reflective sociotechnical approach. In: Late Breaking Papers: Multimodality and Intelligence - HCI International Conference. pp. 449–466. Springer (2020)
-
Eiband, M., Schneider, H., Bilandzic, M., Fazekas-Con, J., Haug, M., Hussmann, H.: Bringing transparency design into practice. In: International Conference on intelligent User Interfaces IUI. pp. 211–223 (2018)
-
Fontana, M., Naretto, F., Monreale, A.: A new approach for cross-silo federated learning and its privacy risks. In: IEEE International Conference on Privacy, Security and Trust (PST). pp. 1–10 (2021)
-
Friedman, J., Popescu, B.: Predictive learning via rule ensembles. The Annals of Applied Statistics 2 (2008)
-
Garigliotti, D.: Explaining LLM-based question answering via the self-interpretations of a model. Advances in Interpretable Machine Learning and Artificial Intelligence, co-located with ECML-PKDD (2024)
-
Giannotti, F., Naretto, F., Bodria, F.: Explainable for trustworthy AI. In: Human-Centered Artificial Intelligence: Advanced Lectures. pp. 175–195. Springer (2023)
-
Giorgi, F., Campagnano, C., Silvestri, F., Tolomei, G.: Natural language counterfactual explanations for graphs using large language models. arXiv preprint arXiv:2410.09295 (2024)
-
Guidotti, R.: Counterfactual explanations and how to find them: literature review and benchmarking. Data Min. Knowl. Discov. 38(5), 2770–2824 (2024)
-
Guidotti, R., Monreale, A., Ruggieri, S., Naretto, F., Turini, F., Pedreschi, D., Giannotti, F.: Stable and actionable explanations of black-box models through factual and counterfactual rules. Data Min. Knowl. Discov. 38(5), 2825–2862 (2024)
-
Guidotti, R., Monreale, A., Ruggieri, S., Turini, F., Giannotti, F., Pedreschi, D.: A survey of methods for explaining black box models. ACM Computing Surveys 51(5), 1–42 (2018)
-
Haffar, R., Naretto, F., Sánchez, D., Monreale, A., Domingo-Ferrer, J.: GLOR-FLEX: Local to global rule-based explanations for federated learning. In: International Conference on Fuzzy Systems FUZZ-IEEE. pp. 1–9. IEEE (2024)
-
Huang, S., Mamidanna, S., Jangam, S., Zhou, Y., Gilpin, L.H.: Can large language models explain themselves? a study of LLM-generated self-explanations. arXiv preprint arXiv:2310.11207 (2023)
-
Ichmoukhamedov, T., Hinns, J., Martens, D.: How good is my story? towards quantitative metrics for evaluating -generated XAI narratives. arXiv preprint arXiv:2412.10220 (2024)
-
Ji, Z., Lee, N., Frieske, R., Yu, T., Su, D., Xu, Y., Ishii, E., Bang, Y.J., Madotto, A., Fung, P.: Survey of hallucination in natural language generation. ACM Computing Surveys 55(12), 1–38 (2023)
-
Jiang, T., Sun, Z., Fu, S., Lv, Y.: Human-AI interaction research agenda: A user-centered perspective. Data and Information Management 8(4), 100078 (2024)
-
Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Kulikov, I., Firooz, H., Chaudhary, S., Garrette, D., et al.: Retrieval-augmented generation for knowledge-intensive NLP tasks. In: Advances in Neural Information Processing Systems NeurIPS. vol. 33, pp. 9459–9474 (2020)
-
Li, D., Sun, Z., Hu, X., Liu, Z., Chen, Z., Hu, B., Wu, A., Zhang, M.: A survey of large language models attribution. arXiv preprint arXiv:2311.03731 (2023)
-
Lundberg, S.M., Lee, S.I.: A unified approach to interpreting model predictions. Advances in Neural Information Processing Systems NeurIPS 30 (2017)
-
Martens, D., Hinns, J., Dams, C., Vergouwen, M., Evgeniou, T.: Tell me a story! narrative-driven XAI with large language models. Decision Support Systems p. 114402 (2025)
-
Mavrepis, P., Makridis, G., Fatouros, G., Koukos, V., Separdani, M.M., Kyriazis, D.: XAI for all: Can large language models simplify explainable AI? arXiv preprint arXiv:2401.13110 (2024)
-
Miller, T.: Explanation in artificial intelligence: Insights from the social sciences. Artificial intelligence 267, 1–38 (2019)
-
Naretto, F., Monreale, A., Giannotti, F.: Evaluating the privacy exposure of interpretable global explainers. In: International Conference on Cognitive Machine Intelligence CogMI. pp. 13–19. IEEE (2022)
-
Naretto, F., Pellungrini, R., Monreale, A., Nardini, F.M., Musolesi, M.: Predicting and explaining privacy risk exposure in mobility data. In: International Conference on Discovery Science. pp. 403–418. Springer (2020)
-
Nowotko, P.M.: AI in judicial application of law and the right to a court. Procedia Computer Science 192, 2220–2228 (2021)
-
Pan, B., Xiong, Z., Wu, G., Zhang, Z., Zhang, Y., Zhao, L.: Tagexplainer: Narrating graph explanations for text-attributed graph learning models. arXiv preprint arXiv:2410.15268 (2024)
-
Park, C., Lee, H., Lee, S., Jeong, O.: Synergistic joint model of knowledge graph and LLM for enhancing XAI-based clinical decision support systems. Mathematics 13(6), 949 (2025)
-
Parliament, E., Council: Artificial intelligence act. https://eur-lex.europa.eu/eli/reg/2024/1689/oj/eng (2024), (accessed: 16/04/2025)
-
Raaijmakers, S.: Artificial intelligence for law enforcement: challenges and opportunities. IEEE Security & Privacy 17(5), 74–77 (2019)
-
Ribeiro, M.T., Singh, S., Guestrin, C.: " why should I trust you?" explaining the predictions of any classifier. In: ACM International conference on knowledge discovery and data mining SIGKDD. pp. 1135–1144 (2016)
-
Rudin, C.: Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence 1(5), 206–215 (2019)
-
Setzu, M., Guidotti, R., Monreale, A., Turini, F., Pedreschi, D., Giannotti, F.: Glocalx-from local to global explanations of black box AI models. Artificial Intelligence 294, 103457 (2021)
-
Shaheen, M.Y.: Applications of artificial intelligence (AI) in healthcare: A review. ScienceOpen Preprints (2021)
-
Smith, J.W., Everhart, J.E., Dickson, W.C., Knowler, W.C., Johannes, R.S.: Using the ADAP learning algorithm to forecast the onset of diabetes mellitus. In: Annual Symposium on Computer Application in Medical Care. p. 261 (1988)
-
Wojciechowski, A., Lango, M., Dusek, O.: Faithful and plausible natural language explanations for image classification: A pipeline approach. arXiv preprint arXiv:2407.20899 (2024)
-
Wolf, C.T.: Explainability scenarios: towards scenario-based XAI design. In: International Conference on Intelligent User Interfaces IUI. pp. 252–257 (2019)
-
Xiong, G., Jin, Q., Lu, Z., Zhang, A.: Benchmarking retrieval-augmented generation for medicine. In: Findings of the Association for Computational Linguistics ACL 2024 (2024)
-
Yao, Y., Duan, J., Xu, K., Cai, Y., Sun, Z., Zhang, Y.: A survey on large language model (LLM) security and privacy: The good, the bad, and the ugly. HighConfidence Computing p. 100211 (2024)
-
Zytek, A., Pidò, S., Veeramachaneni, K.: LLMs for XAI: Future directions for explaining explanations. arXiv preprint arXiv:2405.06064 (2024)
A Input and output prompt for RAG

Fig. 3. The prompt templates for the three tasks supported by the enhancer module are defined as follows. The Classifier & XAI task receives as input the patient's DESCRIPTION, represented by the feature vector . The Context explanation task extends this input by including the black-box PREDICTION and the corresponding EXPLANATION provided by the explainer (LIME in this case). Lastly, the Question & answer task builds upon the inputs of the Context explanation task by incorporating a user-defined QUESTION , which MedRag must answer based on the available information.
patient's record
LIME explanation
| feature | value |
|---|---|
| BloodPressure | 70.0 |
| Pregnancies | 3 |
| Insulin | 200 |
| DiabetesPedigreeFunction | 0.408 |
| SkinThickness | 22.0 |
| Age | 36 |
| BMI | 36.4 |
| Glucose | 187.0 |
| ground truth | 1 (diabetes) |
| classifier's prediction | 1 (diabetes) |
| enhancer's prediction | 1 (diabetes) |

Output (classifier & xai)
"step_by_step_thinking*: "To classify whether a patient has diabetes or not, we need to compare the given patient's features with the diagnostic criteria for diabetes. The documents provided do not give specific criteria for diagnosing diabetes, but they do provide information about what to consider when diagnosing diabetes. The relevant documents for this task are Document [2] (Title: Prediabetes – Introduction), Document [5] (Title: Diabetes Mellitus Screening – Definition/Introduction), Document [6] (Title: Diabetes Mellitus Screening – Definition/Introduction – Type 2 Diabetes), and Document [8] (Title: Mean – Definition/Introduction). Based on the given patient's features, we can compare them to the diagnostic criteria for diabetes and prediabetes. The patient's age, pregnancies, blood pressure, skin thickness, insulin, BMI, and diabetes pedigree function are all relevant features to consider. The normal blood glucose level is between 70 mg/dL to 99 mg/dL. In patients with prediabetes, blood glucose levels are elevated between 110 mg/dL to 125 mg/dL. The patient's glucose level is 187.0, which is higher than the diagnostic criteria for prediabetes. Therefore, based on this single feature, we can classify the patient as having diabetes."
"classification*: 1
"feature_importance_ranking*: ["Glucose"]
"rules_applied*: {"Glucose": "Glucose > 125 mg/dL (Diabetes)"}
Fig. 4. An example instance from the PIMA dataset is presented. In the table on the top left, we display the patient features along with the classifier's prediction and the enhanced prediction generated by the RAG model. The top right section shows the feature importance values calculated using LIME, while the bottom section illustrates the output of the Enhancer module based on the RAG model.