Abstract
Large Language Models (LLMs) have exhibited remarkable proficiency in comprehending and generating natural language. On the other hand, personalized LLM response generation holds the potential to offer substantial benefits for individuals in critical areas such as medical. Existing research has explored memory-augmented methods to prompt the LLM with pre-stored user-specific knowledge for personalized response generation in terms of new queries. We contend that such paradigm is unable to perceive fine-granularity information. In this study, we propose a novel Memory-injected approach using parameter-efficient fine-tuning (PEFT) and along with a Bayesian Optimisation searching strategy to achieve LLM Personalization (MiLP).
Introduction
Standard Large Language Models (LLMs) typically operate as general-purpose systems, yet many high-stakes domains—such as personalized medical assistance or specialized e-commerce—require deep alignment with individual user histories and preferences. Current personalization strategies generally fall into three categories:
- Text-Prompting (TpLP): Directly including user history in the prompt, which is limited by context window constraints and increased inference costs.
- Retrieval-Augmented Generation (RAG): Fetching relevant snippets from a database, which often introduces noise or lacks the granularity needed for subtle preferences.
- User Embeddings: Representing users as static vectors, which models may ignore during complex decoding.
To overcome these limitations, we propose MiLP (Memory-injected LLM Personalization). Instead of treating user history as external text, MiLP treats the LLM’s internal architecture as a "bionic memory bank," where user-specific information is stored directly within learnable parameters.
Methodology: The MiLP Framework
The MiLP framework draws inspiration from neuroscience, mimicking how the brain stores different types of memories in distinct regions.
Parameterized Injection
Research suggests that the Feed-Forward Layers (FFL) of Transformers act as the model's internal knowledge base. MiLP utilizes Low-Rank Adaptation (LoRA) to inject user history specifically into these layers. This allows the model to "memorize" user traits without modifying the core pre-trained weights.
Bayesian Optimization (BO) Search
Not all layers contribute equally to personalization. We employ a modified Bayesian Optimization strategy to identify the optimal configuration $\theta$ for each user. The search space $\Theta$ includes:
- Layer Selection ($\alpha$): Determining which specific layers to inject.
- Module Count ($n$): The number of LoRA modules to deploy.
- Rank ($r$): The dimensionality/capacity of the LoRA adapters.
Two-Stage Optimization
The process involves two primary stages:
- Memory Injection: The model learns user-specific content through BO-optimized PEFT.
- Instruction Tuning: The memory-injected LLM is fine-tuned to ensure generated responses are coherent, human-like, and effectively utilize the newly stored parameters.
Experimental Evaluation
We evaluated MiLP across three diverse datasets: AmazonQA (e-commerce), Reddit (social dialogue), and MedDia (medical consultations). The latter is particularly challenging, requiring the model to link disparate patient history (e.g., chronic conditions) to new, specific queries.
Key Results
MiLP demonstrated superior performance compared to standard Text-prompting and Memory-Augmented (MaLP) baselines across models like DialoGPT and LLaMA2-13B:
- Quantitative Performance: MiLP achieved relative improvements of 4.38% to 5.05% in ROUGE-L scores.
- Personalization Accuracy: The Persona-F1 score, measuring alignment with user-specific content, improved by up to 0.117 over the strongest baselines.
- Human Evaluation: In the medical domain, humans preferred MiLP-generated responses over 75% of the time when using the LLaMA2-13B model.
Insights and Discussion
Ablation studies revealed that the location of memory injection (which layers are selected) is often more critical than the total number of parameters (rank $r$). Shallow layers tend to capture surface-level syntax, while deeper layers are more effective for semantic user traits. By surgically placing adapters, MiLP avoids "catastrophic forgetting" and "context dilution."
Conclusion and Future Work
MiLP offers a robust framework for fine-grained LLM personalization. While highly effective, the current per-user optimization approach poses scalability challenges for millions of users. Future research will explore more efficient search strategies, such as LoNAS, and hybrid systems that combine the "cold start" capabilities of RAG with the deep personalization of MiLP.
Summary updated