Leveraging Large Language Models through Natural Language Processing to provide interpretable Machine Learning predictions of mental deterioration in real time
Francisco de Arriba-Pérez Silvia García-Méndez


]Leveraging Large Language Models through Natural Language Processing to provide interpretable Machine Learning predictions of mental deterioration in real time

1]Francisco de Arriba-Pérezfarriba@gti.uvigo.es
These authors contributed equally to this work.

[1]Silvia García-Méndezsgarcia@gti.uvigo.es
These authors contributed equally to this work.

[1]Information Technologies Group, atlanTTic, University of Vigo, Vigo, Spain

Based on official estimates, 50 million people worldwide are affected by dementia, and this number increases by 10 million new patients every year. Without a cure, clinical prognostication and early intervention represent the most effective ways to delay its progression. To this end, Artificial Intelligence and computational linguistics can be exploited for natural language analysis, personalized assessment, monitoring, and treatment. However, traditional approaches need more semantic knowledge management and explicability capabilities. Moreover, using Large Language Models (llms) for cognitive decline diagnosis is still scarce, even though these models represent the most advanced way for clinical-patient communication using intelligent systems. Consequently, we leverage an llm using the latest Natural Language Processing (nlp) techniques in a chatbot solution to provide interpretable Machine Learning prediction of cognitive decline in real-time. Linguistic-conceptual features are exploited for appropriate natural language analysis. Through explainability, we aim to fight potential biases of the models and improve their potential to help clinical workers in their diagnosis decisions. More in detail, the proposed pipeline is composed of (i) data extraction employing nlp-based prompt engineering; (ii) stream-based data processing including feature engineering, analysis, and selection; (iii) real-time classification; and (iv) the explainability dashboard to provide visual and natural language descriptions of the prediction outcome. Classification results exceed 80 in all evaluation metrics, with a recall value for the mental deterioration class about 85. To sum up, we contribute with an affordable, flexible, non-invasive, personalized diagnostic system to this work.



[
    *
    
=====



This version of the article has been accepted for publication, after peer review but is not the Version of Record and does not reflect post-acceptance improvements, or any corrections. The Version of Record is available online at: https://doi.org/10.1007/s13369-024-09508-2.



§ INTRODUCTION



Neurodegenerative Alzheimer’s disorder (ad) is the leading cause of chronic or progressive dementia, which negatively impacts cognitive functioning, including comprehension, speech, and thinking problems, memory loss, etc. <cit.>. More in detail, the typical stages of cognitive decline can be categorized as pre-clinical ad, Mild Cognitive Impairment (mci) caused by ad, and finally ad dementia <cit.>. Generally, cognitively impaired users find difficult to perform daily tasks with the consequent detrimental impact on their life quality <cit.>. In this line, cognitive decline is a leading cause of dependency and disability for our elders <cit.>.

According to the Alzheimer's Association report on the impact of this disease in the United States <cit.>, it is the sixth‐leading death cause that increased more than 145 in the last years. Moreover, it affects 6.7 million people 65 or older. Dreadfully, this number is predicted to grow to 13.8 million by 2060. Regarding medical expenses related to people affected with dementia 65 or older, these are three times greater than those of people without this condition, reaching 345 billion dollars so far in 2023. Overall, the World Health Organization estimates that 50 million people worldwide are affected by dementia, with 10 million new patients yearly[Available at <https://www.who.int/news-room/fact-sheets/detail/dementia>, May 2024.]. 

Clinical prognostication and early intervention, the most promising ways to address mental deterioration, rely on effective progression detection <cit.>. Among the benefits of early identification, care planning assistance, medical expense reduction, and the opportunity to receive the latest treatments, including non-invasive therapy, given the rapid biologic therapeutics advancements, stand out <cit.>. The social stigma and socioeconomic status must also be considered when accessing mental health services <cit.>. However, the latter early diagnosis is challenging since the symptoms can be confused with normal aging decline <cit.>. To address it, computational linguistics can be exploited <cit.>. Natural language analysis is particularly relevant, constituting a significant proportion of healthcare data <cit.>. 
Particularly, impairment in language production mainly affects lexical (e.g., little use of nouns and verbs), semantic (e.g., the use of empty words like thing/stuff), and pragmatic (e.g., discourse disorganization) aspects <cit.>.

Digital and technological advances such as Artificial Intelligence (ai)-based systems represent promising approaches towards individuals' needs for personalized assessment, monitoring, and treatment <cit.>. Accordingly, these systems have the capabilities to complement traditional methodologies such as the Alzheimer’s Disease Assessment Scale-Cognition (adascog), the Mini-Mental State Examination (mmse), and the Montreal Cognitive Assessment (moca), which generally involve expensive, invasive equipment, and lengthy evaluations <cit.>. In fact, paper-and-pencil cognitive tests continue to be the most common approaches even though the latest advances in the Natural Language Processing (nlp) field enable easy screening from speech data while at the same time avoiding patient/physician burdening <cit.>. Summing up, language analysis can translate into an effective, inexpensive, non-invasive, and simpler way of monitoring cognitive decline <cit.> provided that spontaneous speech of cognitive impaired people is characterized by the aforementioned semantic comprehension problems and memory loss episodes <cit.>.

Consequently, Clinical Decision Support Systems (cdsss), Diagnostic Decision Support Systems (ddsss), and Intelligent diagnosis systems (idss) which apply ai techniques (e.g., Machine Learning - ml, nlp, etc.) to analyze patient medical data (i.e., clinical records, imaging data, lab results, etc.) and discover relevant patterns effectively and efficiently, have significantly attracted the attention of the medical and research community <cit.>. However, one of the main disadvantages of traditional approaches is their lack of semantic knowledge management and explicability capabilities <cit.>. The latter can be especially problematic in the medical domain regarding accountability of the decision process for the physicians to recommend personalized treatments <cit.>. 

Integrating ai-based systems in conversational assistants to provide economical, flexible, immediate, and personalized health support is particularly relevant <cit.>. Their use has been greatly enhanced by the nowadays popular Large Language Models (llms), enabling dynamic dialogues compared to previous developments <cit.>. Subsequently, llms have been powered by the latest advancements in deep learning techniques and the availability of vast amounts of cross-disciplinary data <cit.>. These models represent the most innovative approach of ai into healthcare by expediting medical interventions and providing new markers and therapeutic approaches to neurological diagnosis from patient narrative processing <cit.>. Note that patient experience can also be improved with the help of llms in terms of information and support seeking <cit.>. Summing up, conversation assistants that leverage llms have the potential to monitor high-risk populations and provide personalized advice, apart from offering companion <cit.> constituting the future of therapy in the literature <cit.>.

Given the still poor accuracy of cdsss <cit.>, we plan to leverage an llm using the latest nlp techniques in a chatbot solution to provide interpretable ml prediction of cognitive decline in real-time. Linguistic-conceptual features are exploited for appropriate natural language analysis. The main limitation of llms is that their outcomes may be misleading. Thus, we apply prompt engineering to avoid the “hallucination" effect. Through explainability, we aim to fight potential biases of the models and improve their potential to help clinical workers in their diagnosis decisions. Summing up, we contribute with an affordable, non-invasive diagnostic system in this work. 

The rest of this paper is organized as follows. Section <ref> reviews the relevant competing works on cognitive decline detection involving llms and interpretable ml predictions of mental deterioration. The contribution of this work is summarized in Section <ref>. Section <ref> explains the proposed solution, while Section <ref> describes the experimental data set, our implementations, and the results obtained. Finally, Section <ref> concludes the paper and proposes future research.


    
  * Problem. The World Health Organization predicts a yearly increase of 10 million people affected with dementia.
    
  * What is already known. Paper-and-pencil cognitive tests continue to be the most common approach. The latter is impractical, given the disease growth rate. Moreover, one of the main disadvantages of intelligent approaches is their lack of semantic knowledge management and explicability capabilities.
    
  * What this paper adds. We leverage an llm using the latest nlp techniques in a chatbot solution to provide interpretable ml prediction of cognitive decline in real-time. To sum up, we contribute with an affordable, flexible, non-invasive, personalized diagnostic system to this work.




§ RELATED WORK



As previously mentioned, the main focus of dementia treatment is to delay the cognitive deterioration of patients <cit.>. Consequently, early diagnosis, which simultaneously contributes to reducing medical expenses in our aging society and avoiding invasive treatments with subsequent side effects on the users, is desirable <cit.>. To this end, ai has been successfully applied to idss in order to recommend treatments based on their diagnosis prediction <cit.>. 

While ml models perform well and fast in diagnosis tasks, they require extensive training data previously analyzed by experts, which is labor-intensive and time-consuming <cit.>. In contrast, advanced nlp-based solutions exploit transformer-based models already trained with large corpora, including domain-related data, which results in very sensitive text analysis capabilities <cit.>. Consequently, transformer-based pre-trained language models (plms) (e.g., bert <cit.>, gpt-3 <cit.>) which preceded the popular llms (e.g., gpt-4[Available at <https://platform.openai.com/docs/models/gpt-4>, May 2024.]) have disruptively transformed the nlp research. These models exhibit great contextual latent feature extraction abilities from textual input <cit.>. The latter models are implemented to predict the next token based on massive training data, resulting in a word-by-word outcome <cit.>. Nowadays, they are used for various tasks, including problem-solving, question-answering, sentiment analysis, text classification, and generation, etc. <cit.>. 

There exist plm versions over biomedical and clinical data such as Biobert <cit.>, Biogpt <cit.>, Bluebert <cit.>, Clinicalbert[Available at <https://github.com/EmilyAlsentzer/clinicalBERT>, May 2024.] and tcm-bert <cit.>. Open-domain conversational assistants, whose dialogue capabilities are not restricted to the conversation topic, exploit llms <cit.>. However, using llms for cognitive decline diagnosis is still scarce even though these models represent the most advanced way for clinical-patient communication using intelligent systems <cit.>. More in detail, they overcome the limitation of traditional approaches that lack semantic reasoning, especially relevant in clinical language <cit.>. Unfortunately, despite the significant advancement they represent, llms still exhibit certain limitations in open-domain task-oriented dialogues (e.g., medical use cases) <cit.>. For the latter, the Reinforcement Learning from Human Feedback (rlhf, i.e., prompt engineering) technique is applied to enhance their performance based on end users' instructions and preferences <cit.>. 

Regarding the application of plm to the medical field, <cit.> performed two tasks: (i) dementia prediction and (ii) mmse score estimation from speech recordings combining acoustic features and text embeddings obtained with the bert model from their transcription. The input data correspond to cognitive tests (cts). <cit.> analyzed disfluencies (i.e., uh/um word frequency and speech pauses) with bert and ernie modes based on data from the Cookie Theft picture from the Boston Diagnostic Aphasia Exam. Close to the work by <cit.>, <cit.> analyzed the performance of bert model to extract embeddings in cognitive impairment detection from speech gathered during cts. <cit.> combined the Siamese bert networks (sberts) with ml classifiers to firstly extract the sentence embeddings and then predict Alzheimer’s disease from ct data. In contrast, <cit.> performed dementia detection combining ml, the bert model, and acoustic features to achieve improved performance. Moreover, <cit.> compared gpt-2 with its artificially degraded version (gpt-d) created with a dementia-related linguistic anomalies layer induction based on data from a picture description task, while <cit.> predicted dementia and cognitive score from ct data using gpt-3 exploiting both word embeddings and acoustic knowledge. Finally, <cit.> pre-trained the bert model with unstructured clinical notes from Electronic Health Records (ehrs) to detect mci to ad progression.

More closely related to our research is the work by <cit.>. The authors designed Pepper, a social robot with real-time conversational capabilities exploiting the Chatgpt gpt-3.5 model. However, the use case of the system is Autism Spectrum Disorder detection. Furthermore, <cit.> compared the diagnoses performance of different models of Chatgpt (i.e., ada, babbage, curie, davinci and gpt-3.5) with Google Bard and traditional ml approaches based on symptomatic data. The authors exploited prompt engineering to ensure appropriate performance when submitting clinical-related questions to the llm model. Moreover, <cit.> analyzed the diagnosis ability of Chatgpt gpt-3.5 model using clinical vignettes. Then, the llm was evaluated compared to physicians’ diagnosis. However, the authors again focus not on cognitive decline prediction but on ten common chief complaints. Consideration should be given to the work by <cit.>, who used Chatgpt (i.e., gpt-3.5 and gpt-4 models) and Google Bard to predict several neurodegenerative disorders based on clinical summaries in clinicopathological conferences without being a specific solution tailored for ad prediction. Finally, regarding conversational assistants that integrate llms, <cit.> developed a chatbot based on Chatgpt gpt-3.5 model to provide emotional support to caregivers (i.e., practical tips and shared experiences).



 §.§ Contributions



As previously described, a vast amount of work in the state of the art exploits plms even in the clinical field <cit.>. However, scant research has been performed in the case of llm models. Table <ref> summarizes the reviewed diagnostic solutions that exploit llms in the literature. Note that explainability represents a differential characteristic of the solution proposed given the relevance of promoting transparency in ai-based systems <cit.>.

Given the comparison with competing works:

 
  * Our system is the first that jointly considers the application of an llm over spontaneous speech and provides interpretable ml results for the use case of mental decline prediction. 
 
  * Our solution implements ml models in streaming to provide real-time functioning, hence avoiding the re-training cost of batch systems. 
 
  * In this work, we leverage the potential of llms by applying the rlhf technique through prompt engineering in a chatbot solution. Note that the natural language analysis is performed with linguistic-conceptual features. Consequently, we contribute with an affordable, non-invasive diagnostic system. 
 
  * Our system democratizes access to researchers and end users within the public health field to the latest advances in nlp. 






§ METHODOLOGY



Figure <ref> depicts the system scheme proposed for real-time prediction of mental decline combining llms and ml algorithms with explainability capabilities. More in detail, it is composed of (i) data extraction employing nlp-based prompt engineering (Section <ref>); (ii) stream-based data processing including feature engineering, analysis and selection (Section <ref>); (iii) real-time classification (Section <ref>); and (iv) the explainability dashboard to provide visual and natural language descriptions of the prediction outcome (Section <ref>). Algorithm <ref> describes the complete process.



[!htbp]
 Methodology
 
 



 §.§ Data extraction



The Chatgpt gpt-3.5 model used serves two purposes: (i) it enables a natural, free dialogue with the end users, and (ii) data is extracted due to its semantic knowledge management capabilities. The latter information is gathered once the conversation is concluded (either more than 3 minutes of inactivity or farewell detected) and used to compute the features used for classification (see Section <ref>). For this extraction, prompt engineering is exploited. The complete data extraction process is described in Algorithm <ref>.

[!htbp]
 Data extraction
 




 §.§ Stream-based data processing



Stream-based data processing encompasses feature engineering, analysis, and selection tasks to ensure the optimal performance of the ml classifiers.



  §.§.§ Feature engineering



Table <ref> details the features used to predict mental decline. Note that conversational, emotional, and linguistic-conceptual features are computed. The conversational features[Features 9-10 are not computed using the llm.] (1-10) represent relevant semantic and pragmatic information related to the free dialogue (e.g., fluency, repetitiveness, etc.), while emotional features focus on the mental and physical state of the users. Finally, linguistic features represent lexical and semantic knowledge (e.g., disfluencies, placeholder words, etc.).

Furthermore, the system maintains a history of each user data (i.e., past and current feature values) that enables the computation of four new characteristics per each in Table <ref>: average, q1, q2, and q3 as indicated in Equation (<ref>), where n is the user conversation counter and X[n] represents a particular feature with historical data.




    ∀ n ∈{1 ... ∞}
    
    
    X[n] = { x[0],…,x[n]}. 
    
    Y[n] = {y_0[n], y_1[n],…,y_n-1[n]}|
     y_0[n]≤ y_1[n]≤…≤ y_n-1[n], 
     ; ∀ x ∈ X[n],   x ∈ Y[n]. 
    
    
    avg^n[n]=1/n∑_i=0^n y_i [n]
    
    Q^n_1[n]=y_1/4n[n] 
    
    Q^n_2[n]=y_2/4n [n]
    
    Q^n_3[n]=y_3/4n [n]




  §.§.§ Feature analysis & selection



Feature analysis and selection tasks are necessary to optimize the performance of the ml classifiers. These tasks are even more important in the streaming scenario where samples arrive at a real-time pace. The latter means that the classification problem layout (e.g., the most relevant features) may vary over time.

The proposed system follows two thresholding strategies for feature analysis and selection based on cut-off points regarding correlation and variance values to remove irrelevant features. The former, correlation analysis, limits the number of features to extract the most relevant characteristics. For the latter variance analysis, the number of features selected is dynamically established in each interaction of the stream-based model, selecting those that meet the threshold criteria.

Algorithm <ref> details the data processing stage, including feature engineering, analysis, and selection.

[!htbp]
 Data processing
 




 §.§ Stream-based classification



Two classification scenarios are considered:


 
  * Scenario 1 analyzes the behavior of the classifiers in a streaming setting. Under this consideration, sequential and continual testing and training over time is assumed.
 
 
  * Scenario 2 analyzes the models' performance under more realistic conditions. Thus, the testing is continuous (i.e., in streaming) while training is performed desynchronized in blocks of 100 samples.


The following ml models are selected based on their good performance in similar classification problems <cit.>:


 
  * Gaussian Naive Bayes (gnb) <cit.> exploits the Gaussian probability distribution in a stream-based ml model. It is used as a reference for performance analysis.
 
 
  * Approximate Large Margin Algorithm (alma) <cit.> is a fast incremental learning algorithm comparable to Support Vector Machine to approximate the maximal margin between a hyperplane concerning a norm (with a value of p ≥ 2) for a set of linearly separable data.
 
 
  * Hoeffding Adaptive Tree Classifier (hatc) <cit.> computes single-tree branch performance and is designed for stream-based prediction.
 
 
  * Adaptive Random Forest Classifier (arfc) <cit.> constitutes an advanced model of hatc in which branch performance is computed by majority voting in an ensemble tree scenario.


Algorithm <ref> describes the stream-based prediction process.

[!htbp]
 Classification
 




 §.§ Explainability dashboard



Prediction transparency is promoted through explainability data provided to the end users regarding relevant features in the prediction outcome. Thus, those relevant features are included in the natural language description of the decision path. The five features whose mathematical module is highest or with the highest variance and whose values are the most distant from the average are selected. In the case of the counters (features 9-10), this average is obtained from the average of all users in the system.



§ EVALUATION AND DISCUSSION



This section discusses the experimental data set used, the implementation decisions, and the results obtained. The evaluations were conducted on a computer with the following specifications:


 
  * Operating System: Ubuntu 18.04.2 LTS 64 bits
 
  * Processor: IntelCore i9-10900K 2.80
 
  * RAM: 96 DDR4 
 
  * Disk: 480 NVME + 500 SSD




 §.§ Experimental data set



The experimental data set[Data are available on request from the authors.] consists of an average of 6.92±3.08 utterances with 62.73±57.20 words involving 44 users with 13.66±7.86 conversations by user. The distribution of mental deterioration in the experimental data set is 238 samples in which mental deterioration is present and 363 in which it is absent. Figure <ref> depicts the histogram distribution of words and interactions by absent and present mental deterioration, respectively. While the distributions of the number of interactions in the absence or presence of cognitive impairment follow a normal function, the number of words can be approximated by a positive normal centered on 0. The most relevant issue is that, as expected, users with mental deterioration present a lower number of interactions and a significant decrease in the number of words used in their responses.









 §.§ Data extraction



Data to engineer conversational (1-8), emotional, and linguistic features in Table <ref> were obtained with [Available at <https://platform.openai.com/docs/models/gpt-3-5>, May 2024.] model. The prompt used is shown in Listing <ref>.





 §.§ Stream-based data processing



This section reports the algorithms used for feature engineering, analysis, and selection and their evaluation results.



  §.§.§ Feature engineering



A total of 88 features were generated[New four characteristics (average, q1, q2, and q3) per each of the 22 features in Table <ref>.] in addition to the 22 features generated in each conversation (see Table <ref>) resulting in 110 features. In Figure <ref>, we show the distribution of conversations by the user, which approaches a uniform density function, being relevant that the large majority concentrates between 15 and 20 conversations.





  §.§.§ Feature analysis & selection



Correlation and variance thresholding decisions were based on experimental tests. For the correlation thresholding, [Available at <https://riverml.xyz/0.11.1/api/feature-selection/SelectKBest>, May 2024.] was applied using the Pearson correlation coefficient <cit.>. The K value corresponds to the most relevant features of the 80 experimental data. Table <ref> shows the features with a correlation value greater than 0.2 with the mental deterioration target when the last sample entered the stream-based classification model.



Regarding the variance thresholding, the implementation used was [Available at <https://riverml.xyz/0.11.1/api/feature-selection/VarianceThreshold>, May 2024.] from the  library[Available at <https://riverml.xyz/0.11.1>, May 2024.]. Moreover, the cut-off point, 0.001, is computed with the 10th percentile variance value of the features contained in the 20 of the experimental data set, which acts as the cold start of this method. Consequently, only those features that exceed the abovementioned cut-off are selected as relevant for classification purposes. Table <ref> also details the features with a variance greater than 0.5[Note that we have discarded features 9 and 10 from Table <ref> from this example since they represent counters and their variance is always greater than 1.].

Table <ref> shows that among the conversational features, user initiative (feature 6 in Table <ref>) plays an important role. The same applies to the number of interactions within a dialogue (feature 9). Regarding emotional features, consideration should be given to fatigue (feature 12) and polarity (feature 14). Finally, using a colloquial/formal registry (features 16/19), disfluency (feature 18), and short responses (feature 22) stand out among linguistic characteristics. Considering correlation and variance analysis jointly, initiative and polarity are the most relevant data for prediction purposes.



 §.§ Stream-based classification



The River implementations of the ml models selected are: gnb[Available at <https://riverml.xyz/dev/api/naive-bayes/GaussianNB>, May 2024.], alma[Available at <https://riverml.xyz/0.11.1/api/linear-model/ALMAClassifier>, May 2024.], hatc[Available at <https://riverml.xyz/0.11.1/api/tree/HoeffdingAdaptiveTreeClassifier>, May 2024.] and arfc[Available at <https://riverml.xyz/0.11.1/api/ensemble/AdaptiveRandomForestClassifier>, May 2024.]. Listings <ref>, <ref> and <ref> detail the hyper-parameter optimization ranges used, excluding the baseline model, from which the following values were selected as optimal:


 
  * Correlation thresholding
 
 
  * ALMA: alpha=0.5, B=1.0, C=1.0.

 
  * HATC: depth=None, tiethreshold=0.5, maxsize=50.

 
  * ARFC: models=10,features=5, lambda=50.
 

 
  * Variance thresholding
 
 
  * ALMA: alpha=0.5, B=1.0, C=1.0.

 
  * HATC: depth=None, tiethreshold=0.5, maxsize=50.

 
  * ARFC: models=100,features=sqrt, lambda=50.
 


[frame=single,caption=alma hyper-parameter configuration.,label=alma_conf,emphstyle=,escapechar=ä]
alpha = [0.5,0.7,0.9]
B = [1.0, 1.41, 1.2]
C = [1.0,1.11, 1.2]


[frame=single,caption=hatc hyper-parameter configuration.,label=hatc_conf,emphstyle=,escapechar=ä]
depth = [None, 50, 200]
tiethreshold = [0.5, 0.05, 0.005]
maxsize = [50, 100, 200]

 
[frame=single,caption=arfc hyper-parameter configuration.,label=arfc_conf,emphstyle=,escapechar=ä]
models = [10, 25, 100]
features = [sqrt, 5, 50]
lambda = [25, 50, 100]


Table <ref> presents the results for evaluation scenarios 1 and 2. In both scenarios, the feature selection methodology based on correlation thresholding returns lower classification metric values than those obtained with the variance method. Thus, once the variance feature selection method is applied, the arfc is the most promising performance algorithm regardless of the evaluation scenario.





Consideration should be given to the fact that even in scenario 2, in which training is performed desynchronized and in batch, the robustness of arfc stands out with classification results exceeding 80 and with a recall for the mental deterioration class about 85.

Provided that our system operates in streaming and to enable direct comparison with batch ml solutions, additional evaluation measures from 10-fold cross-validation are provided, particularly, for Random Forest (rf[Available at <https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html>, May 2024.]) equivalent to the best model, arfc, in stream-based classification. The results are displayed in Table <ref>, most surpassing the 90 threshold. Note that the increase in performance compared to streaming operation (e.g., +8.37 points in accuracy) is derived from the fact that in batch classification, the model has access to the 90 of the experimental data for training. In contrast, stream-based classification relies on the ordered incoming new samples, which is more demanding. Consequently, having achieved a comparable performance in batch and stream-based classification is noteworthy.



To verify the system's operation in a more challenging scenario, we have experimented with a data set from a previous study <cit.> with fewer interactions per session. Even when the system is fed with less information, the evaluation metrics are promising, as shown in Table <ref> with all values above 70, and the precision and recall of the mental deterioration category above 80. Comparing the rf batch model in our past research <cit.> with the proposed arfc algorithm, which operates in streaming, the improvement reaches 10 points and 4 points in the recall metric of mental deterioration and absence of mental deterioration categories, respectively.




 

 §.§ Explainability dashboard



Figure <ref> shows the explainability dashboard. In this example, the variation in predicting cognitive impairment is visualized, considering two weeks of past data. This variation is represented with the  function of arfc algorithm. At the bottom, the most relevant features are displayed. Each figure card contains the identifier and statistic represented in colors following this scheme: 1 to 0.5 in green, 0.5 to 0.25 in yellow, and 0.25 to 0 in red. The latter assignation is inverted for negative values. At the bottom, a brief description in natural language is provided. The average accumulated  value, and the confidence prediction of the current sample are displayed on the right.



§ CONCLUSIONS



Cognitively impaired users find it difficult to perform daily tasks with the consequent detrimental impact on their life quality. Thus, progression detection and early intervention are essential to effectively and timely address mental deterioration to delay its progress. In this work, we focused on impairment in language production (i.e., lexical, semantic, and pragmatic aspects) to engineer linguistic-conceptual features towards spontaneous speech analysis (e.g., semantic comprehension problems, memory loss episodes, etc.). Compared to traditional diagnostic approaches, the proposed solution has semantic knowledge management and explicability capabilities thanks to integrating an llm in a conversational assistant.

Consideration should be given to the limitations of using llms, which are transversal into the healthcare field beyond mental deterioration detection. The potential biases and lack of inherent transparency stand out among the risks of applying these models for medical purposes. The latter black-box problem, also present in traditional opaque ml models, is particularly critical in the healthcare field by negatively impacting the decision process of physicians due to their limited corrective capabilities and even the end users, limiting their trust in medical applications. Moreover, these systems' current limited memory management capability is worth mentioning, which prevents the realization of longitudinal clinical analysis. The same applies to the associated complexity of context information management. Ultimately, the difficulty in collecting data due to the sensitivity and confidentiality of the information in the medical field should also be mentioned.

More in detail, the solution provides interpretable ml prediction of cognitive decline in real-time. rlhf (i.e., prompt engineering) and explainability are exploited to avoid the “hallucination" effect of llms and avoid potential biases by providing natural language and visual descriptions of the diagnosis decisions. Note that our system implements ml models in streaming to provide real-time functioning, hence avoiding the re-training cost of batch systems. 

Summing up, we contribute with an affordable, flexible, non-invasive, personalized diagnostic system that enables the monitoring of high-risk populations and offers companionship. Ultimately, our solution democratizes access to researchers and end users within the public health field to the latest advances in nlp.

Among the challenges and potential ethical concerns raised by the application of ai into the healthcare field, the double effect principle must be considered. In this sense, few can deny its promising potential to provide innovative treatments while at the same time presenting safety-critical concerns, notably regarding their interpretability. Apart from the algorithmic transparency mentioned, the main considerations are privacy and safety of the medical data, fairness, and autonomous decision-making without human intervention. In future work, we plan to test the performance of new approaches, such as reinforcement learning, to enhance the system's personalizing capabilities further. Moreover, we will explore co-design practices with end users, and we seek to move our solution to clinical practice within an ongoing project with daycare facilities. Note that reinforcement learning with human feedback will also allow us to mitigate some of the limitations discussed, such as physicians' lack of interpretability and corrective capabilities. The latter will also have a positive ethical impact on the deployment of llm-based medical applications by ensuring fairness. The societal impact derived from reduced costs compared to traditional approaches may result in broader accessibility to clinical diagnosis and treatment on a demand basis. The equity will be impulsed by the capability of these systems to provide unlimited personalized support. In future research, we will work on mitigating health inequities by performing longitudinal studies to measure bias in our ai solution, particularly related to the algorithm design, bias in the training data, and the ground truth. Underperformance in certain social groups may also be considered. For that purpose, we will gather social context data, which will allow us to measure equity (e.g., gender, race, socioeconomic status, etc.). To ensure patient data protection while at the same time increasing data available for research, federated learning approaches will be explored.



§ DECLARATIONS




 §.§ Competing interests


The authors have no competing interests to declare relevant to this article's content.



 §.§ Funding


This work was partially supported by (i) Xunta de Galicia grants ED481B-2022-093 and ED481D 2024/014, Spain; and (ii) University of Vigo/CISUG for open access charge.



 §.§ Authors contribution


Francisco de Arriba-Pérez: Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Resources, Data Curation, Writing - Original Draft, Writing - Review & Editing, Visualization, Supervision, Project administration, Funding acquisition. Silvia García-Méndez: Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Resources, Data Curation, Writing - Original Draft, Writing - Review & Editing, Visualization, Supervision, Project administration, Funding acquisition.



