DPF - CM : A Data Processing Framework with Privacy-Preserving Vector Databases for C hinese Medical LLM s Training and Deployment (2025)

Abstract: Current open-source training pipelines for Chinese medical language models predominantly emphasize optimizing training methodologies to enhance the performance of large language models (LLMs), yet lack comprehensive exploration into training data processing. To address this gap, we propose DPF-CM, a holistic Data Processing Framework for Chinese Medical LLMs training and deployment. DPF-CM comprises two core modules. The first module is a data processing pipeline tailored for model training. Beyond standard data processing operations, we (1) introduce a chained examples context-learning strategy to generate question-oriented instructions to mitigate the lack of instruction content, and (2) implement an ensemble-based filtering mechanism for preference data curation that averages multiple reward models to suppress noisy samples. The second module focuses on privacy preservation during model deployment. To prevent privacy risks from the inadvertent exposure of training data, we propose a Privacy Preserving Vector Database (PPVD) approach, which involves model memory search, high-risk database construction, secure database construction, and match-and-replace, four key stages to minimize privacy leakage during inference collectively. Experimental results show that DPF-CM significantly improves model accuracy, enabling our trained Chinese medical LLM to achieve state-of-the-art performance among open-source counterparts. Moreover, the framework reduces training data privacy leakage by 27%.

## introduction recent large language models (llms) have achieved remarkable breakthroughs and are capable of answering a wide range of questions @xcite . * these authors contributed equally to this work † corresponding author (wyinggui@gmail.com). however, while some models perform well in chinese tasks, they still struggle in specialized domains such as chinese healthcare due to limited professional knowledge @xcite . moreover, models like gpt-4, although providing detailed responses, often lack the interactive and diagnostic capabilities typical of doctors @xcite . they fail to offer critical diagnostic information or fully understand the nuances of a patient's condition, which are essential for effective medical consultations. to enhance the capabilities of chinese medical llms, @xcite introduced zhongjing, the first chinese medical llama-based llm that implements an entire training pipeline. @xcite open-sourced huatuogpt-ii, a model that employs a one-stage training method to adapt to medical knowledge. @xcite released ming-moe, a chinese medical llm based on the mixture-of-expert architecture. however, the current works primarily focus on improving the performance of llms in chinese medical tasks by optimizing training methodologies, while overlooking an in-depth investigation into the processing of data, thereby neglecting the potential ability to achieve similar objectives through data processing @xcite . to advance the development of chinese medical llms, we propose dpf-cm, a data processing framework for chinese medical llm training and deployment. dpf-cm consists of two main modules. the first module is the complete data processing pipeline during the continued pre-training, supervised fine-tuning, and reinforcement learning. in these stages, in addition to basic data processing operations, we identify a common limitation in open-source medical datasets-the lack of well-structured instructions, which diminishes the model's generalization capabilities and instruction comprehension capabilities. inspired by the chainof-thought (cot) approach, we introduce a context-learning strategy based on chained examples to generate high-quality, question-oriented instructions. specifically, we link different examples together to form a step-by-step thinking and progressive refinement process, ensuring that later examples are of higher quality than earlier ones. furthermore, we introduce an averaging algorithm based on multiple reward models to cleanse the noisy samples within the preference data. specifically, we train different reward models using the preference data. subsequently, the trained reward models are employed to score the preference data, and the average score is calculated as the final score for each data sample. we then exclude data samples with scores below or above predefined thresholds. the second module focuses on training data privacy protection during deployment. current open-source medical model processing pipelines often overlook the issue of data privacy. however, in the medical field, data privacy breaches can severely compromise patients' right to privacy. to this end, we propose ppvd to prevent training data leakage during deployment. specifically, ppvd first divides the training data sample into two parts, using the first half as prompts to query our trained medical llm. the model's outputs are then matched against the second half to identify high-risk samples. subsequently, we store the embeddings of these high-risk samples in a highrisk vector database and construct a corresponding secure vector database. during deployment, if a user's prompt matches content within the high-risk vector database, we respond using the content from the corresponding secure vector database. we conduct extensive evaluation experiments on datasets encompassing single-turn medical dialogues, multi-turn medical dialogues, medical benchmarks, and medical terminology explanations. our experiments demonstrate that dpf-cm effectively enhances model accuracy. the model we trained achieves sota performance among open-source chinese medical llms. moreover, the extent of training data privacy leakage is reduced by 27%. ## related work the rapid development of large chinese medical models owes much to the release of large chinese language models. initially, researchers trained these models by performing instruction fine-tuning on large language models using medi-cal data. for instance, doctorglm @xcite collected diverse chinese and english medical dialogue datasets and fine-tuned the chatglm-6b (team et al., 2024) model using p-tuning @xcite , enabling it to handle chinese medical consultations. similarly, disc-medllm @xcite used the baichuan-base-13b @xcite model, performing instruction finetuning on over 470,000 medical data points. researchers have discovered that relying solely on instruction fine-tuning is insufficient to make a qualified medical consultation assistant. consequently, some models adopted a more comprehensive training process, encompassing continued pretraining, instruction fine-tuning, and reinforcement learning. for example, zhongjing @xcite underwent pre-training on various medical datasets, followed by instruction fine-tuning on single and multi-turn dialogues and medical nlp tasks, and further used reinforcement learning to ensure professionalism and safety. huatuogpt-ii @xcite proposed a unified domain adaptation protocol, merging the previous twostage process of continued pre-training and instruction fine-tuning into a single-step procedure. ## methods this section discusses the data processing pipeline of pf-cmlt in three training stages of chinese medical llm, including continued pre-training, sft, and reinforcement learning. the comprehensive method flowchart is shown in figure 1 . ## experimental results to fully demonstrate the performance of dpf-cm, we design the experiments from two perspectives: 1) we compare dpf-cm with models trained without any data preprocessing to highlight the effectiveness of dpf-cm. 2) we compare the chinese medical llm trained using dpf-cm with existing open-source chinese medical llms of the same size to showcase the superiority of dpf-cm. ## conclusion in this paper, we propose dpf-cm to explore the value of data to the chinese medical model from the perspective of data processing. dpf-cm encompasses the optimization of the entire data lifecycle, including continuing pre-training data, sft data, preference data, and the privacy protection of training data. through numerous experiments, we demonstrate that the chinese medical models trained with the data processed by dpf-cm can achieve performance comparable to sota opensource medical llms of the same size. additionally, we validate the necessity of each step of data processing within dpf-cm.