LLM -based Medical Assistant Personalization with Short- and Long-Term Memory Coordination (2024)

Abstract: Large Language Models (LLMs), such as GPT3.5, have exhibited remarkable proficiency in comprehending and generating natural language. On the other hand, medical assistants hold the potential to offer substantial benefits for individuals. However, the exploration of LLM-based personalized medical assistant remains relatively scarce. Typically, patients converse differently based on their background and preferences which necessitates the task of enhancing user-oriented medical assistant. While one can fully train an LLM for this objective, the resource consumption is unaffordable. Prior research has explored memory-based methods to enhance the response with aware of previous mistakes for new queries during a dialogue session. We contend that a mere memory module is inadequate and fully training an LLM can be excessively costly. In this study, we propose a novel computational bionic memory mechanism, equipped with a parameter-efficient fine-tuning (PEFT) schema, to personalize medical assistants. To encourage further research into this area, we are releasing a new conversation dataset generated based on an open-source medical corpus and our implementation.

## introduction the potential of large language models to understand and generate natural language is undeniable @xcite @xcite , while there is an untapped opportunity to explore how llms could be customised to provide personalized medical advice with patients, allowing them to receive tailored responses that best suit their individual needs @xcite . for example, as depicted in figure 1 , medical practitioners can discern vital patient information through ongoing diagnostic conversations. consequently, responses to identical queries may differ based on individual patient nuances, highlighting the imperative need for personalized medical assistants leveraging llm. efforts have been made to obtain proper prompts for steering llms to enhance outputs. for example, by memorizing previous mistakes and user feedback, given a new query, a similarity-based retriever can be leveraged to preemptively recognize and rectify llm errors @xcite @xcite . however, this paradigm poses us two challenges: firstly, most existing memory designs are dictionary-based @xcite (i.e. key-value form where key is the previous mistake, value is the corresponding user-feedback) which can be inflexible and rely heavily on the power of retriever. secondly, such paradigm, without retraining, can barely provide users with personalized and engaging experience. for instance, a diabetes patient who prefers concise and straightforward medical advice won't expect detailed glucose test explanations from a doctor while others who prefer fully elaborated responses may want to know as much as possible about the disease (e.g., causes etc.). to this end, how to process patient-relevant information properly and being aware of their preference can be crucial for enhancing patients' experience and remains understudied. in this paper, we propose a novel memory mechanism along with a peft schema to enhance llm-based medical assistant personalization. dictionary-based memory is not pliable due to its intricate structure and thus efforts can only be made in strengthening retrievers. despite the improvements made by retrievers like semantic-similarity based and distance-closest based @xcite , we argue that the memory structure should be ameliorated to accommodate diverse information. unfortunately, rare efforts have been made to address this challenge. neuroscientists have revealed that real-world memory mechanism works in two processes, one can be characterized as automatic and unconscious while the other one is effortful and analytical @xcite . for example, acquiring a new skill initially can be active and analytical, but as one's proficiency increases, it becomes more intuitive. this is referred as dual-process theory and correspondingly, memory can be defined as three types: working memory, short-term memory (stm) and longterm memory (ltm). working memory is responsible for filtering and buffering information, stm holds knowledge for a short period, while ltm stores knowledge for a longer duration @xcite . drawing inspirations from this, we propose a novel dual-process enhanced memory (dpem) mechanism of which three types of memory cooperate smoothly under the guidance of dual-process schema and thus can provide llm more useful knowledge from both user-specific and common-sense aspects. furthermore, existing works in personalized llms primarily focus on designing comprehensive prompts that enable llms to generate contextually relevant responses aligned with user-specific dialogue preferences (e.g., preferring concise responses) @xcite @xcite . however, these methods often yield inferior performance compared to finetuning approaches and are susceptible to the exact formatting of the prompts (e.g., wording and ordering) @xcite . another approach proposed by @xcite involves incorporating user profiles during the pretraining stage, enabling llms to possess user-specific knowledge for downstream tasks. nevertheless, training fully personalized llms for individuals can be economically unviable. to this end, we embrace the utilization of peft which focuses on updating a small subset of parameters, ensuring that the trained llm achieves promising performance on new tasks while minimizing computational costs, to develop user-oriented llms with reduced time and resource consumption. in tandem, we propose a novel memory mechanism inspired by neuroscience, and along with a peft training strategy to achieve llm-based medical assistant personalization. the key contributions of our work are as follows: ## related work memory-augmented llm refers to apply a memory that contains user feedback from previous mistakes and by prepending or postpending the new input query with the stored feedback, the output of llm can be improved @xcite . efforts have been made in terms of the usage of memory. @xcite first proposed to leverages a corrector that can correct the model's output in terms of the similar mistake stored in the memory previously. however, this method aims to repair the wrong output while @xcite argued that the stored experience can be used to avoid incorrect output by prepending/postpending the feedback to the new query. another usage of memory is to include the memory into a learning frame such as self-learning or teacher-student paradigm so that the llm can learn by iterative refinement @xcite . in tandem, the key for better usage of memory is to equip powerful retrievers @xcite @xcite . the main difference between our work and the previous work is that our work refine the memory structure, instead we design a close-to-real memory mechanism that can better identify and retrieve information for enhancement. personalized llm has seen increasing attentions since it can provide tailored experience that aligns with their user's expectations in terms of their needs @xcite . previous works focused on identifying user preferences by ceteris paribus(cp)-nets @xcite . unfortunately , this kind of methods suffer from its limited ability of natural language understanding. as llms emerged, prompt-based methods attempt to design in-depth prompts such as chain-of-thoughts prompts that can guide llm to produce desired output with aware of user status and context content @xcite @xcite . ## conclusion & future work in summary, we proposed malp which integrates a novel dual-process enhanced memory mechanism and a peft approach to enhance medical assistants with awareness of user-specific needs. this simple yet effective endeavor enables personalized llms while maintaining low resource consumption. additionally, our innovative data construction method provided the community a fresh perspective to explore personalized medical assistant. the extensive experiments and human judgment tests conducted validate the effectiveness of our work.