Fine adjustment method for multi-field medical question and answer expert hybrid model

By constructing a multi-expert structure with decoupled shared and private parameters and a two-stage training mechanism, the problems of knowledge conflict and negative transfer in multiple heterogeneous medical sub-domains are solved, the semantic understanding and generation capabilities of the model are improved, and it is suitable for multi-department question answering systems.

CN121658862APending Publication Date: 2026-03-13HANGZHOU DIANZI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies suffer from knowledge conflicts and negative transfer issues in heterogeneous medical subfields, making it difficult to achieve high efficiency, cross-domain generalization capabilities, and improved subfield adaptation accuracy.

Method used

A multi-expert hybrid model of medical question answering is constructed by adopting a multi-expert structure with shared and private parameters decoupled and a two-stage training mechanism. General medical knowledge is aggregated through a shared matrix, and sub-domain-specific knowledge is modeled through a dedicated matrix. The shared matrix is ​​frozen during the two-stage training to avoid interference.

Benefits of technology

It significantly enhances the model's semantic understanding and generation capabilities across multiple medical subdomains, alleviates knowledge conflicts and negative transfer, improves parameter efficiency and adaptation accuracy, and is suitable for multi-department question-answering scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658862A_ABST
    Figure CN121658862A_ABST
Patent Text Reader

Abstract

The invention relates to a fine tuning method for a multi-field medical question and answer expert hybrid model, which comprises the following steps: selecting a general large language model as a basic model, and preparing a multi-medical sub-field question and answer data set; constructing a multi-expert low-rank parameter structure comprising a shared low-rank matrix and a sub-domain special matrix; configuring a sub-domain shunting module; executing two-stage training of joint training shared parameters and sub-field exclusive fine tuning; according to the method, through sharing-private parameter decoupling and staged training, the knowledge conflict and negative migration problems of the multi-heterogeneous medical sub-fields are solved, and the field adaptation precision and generalization ability of the model are remarkably improved while the parameter efficiency is guaranteed. Experiments prove that the average ROUGE-1 scores of the method on the two basic models are superior to those of an existing mainstream fine tuning method, and the method is suitable for fine-grained field adaptation scenes such as multi-department medical questions and answers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a fine-tuning method for a hybrid model of medical question-answering experts in multiple fields, which is particularly suitable for the optimization of question-answering systems that need to be adapted to multiple heterogeneous medical subfields, and belongs to the fields of artificial intelligence technology and medical information processing technology. Background Technology

[0002] Large-scale pre-trained language models based on the Transformer architecture have made significant progress in natural language processing by capturing long-range dependencies in language through self-attention mechanisms, and have been widely applied to tasks such as text generation, summarization, and translation. However, despite these remarkable achievements, large language models still face many challenges.

[0003] Currently, mainstream research on the performance limitations of large language models in specific domains revolves around two aspects: first, Retrieval Enhanced Generation (RAG), which enhances the knowledge coverage and factual accuracy of the model by retrieving relevant information from external knowledge bases and using it as context input; second, High-Efficiency Parameter Fine-Tuning (PEFT), which includes methods such as adapters, Low-Rank Adaptation (LoRA), and cue-based tuning, achieving low-cost and high-efficiency domain adaptation of large models by updating a small number of parameters or introducing lightweight modules.

[0004] However, the above methods still have several limitations in practical applications. On the one hand, knowledge has clear professional boundaries, and the effectiveness of retrieval-enhanced generation systems highly depends on the large language model's inherent understanding of the target domain's language style and knowledge structure. On the other hand, specific domains in practical application scenarios often consist of multiple heterogeneous subdomains, each with significant differences in language expression, task format, and knowledge scope. If a single LoRA adapter is used to uniformly fine-tune the entire domain, it is not only difficult to fully model the specific features of each subdomain, but it is also prone to causing insufficient model generalization ability or cross-subdomain knowledge conflicts, thereby restricting overall performance.

[0005] Furthermore, in multi-subdomain joint training, the low-rank parameter space capacity of the traditional LoRA architecture is limited, making it difficult to simultaneously accommodate optimization objectives from multiple heterogeneous distributions. Differences in data distribution between different subdomains can easily lead to interference effects or gradient conflicts; that is, parameter updates in one subdomain may weaken the knowledge already learned by the model in other subdomains, causing negative transfer. For cross-domain or heterogeneous task scenarios, relying solely on standard LoRA modules is insufficient to effectively alleviate the domain transfer problem, necessitating the introduction of enhanced structures.

[0006] Therefore, designing a fine-tuning method that balances parameter efficiency, cross-domain generalization ability, and subdomain adaptation accuracy to address knowledge conflicts and negative transfer issues in multiple heterogeneous medical subdomains has become a key technical challenge in improving the performance of medical question answering models. Summary of the Invention

[0007] To overcome the shortcomings of existing low-rank adaptation methods in terms of knowledge conflict and generalization ability in multi-subdomain scenarios, this invention provides a fine-tuning method for a multi-domain medical question-answering expert hybrid model. Compared with the traditional LoRA method, this method introduces a multi-expert structure with decoupled shared and private parameters, and adopts a phased training mechanism. While improving the model's adaptability to multiple medical subdomains, it effectively alleviates the problems of negative transfer and overfitting.

[0008] A fine-tuning method for a multi-domain medical question-answering expert hybrid model includes the following steps:

[0009] Step 1: Select a general-purpose large language model suitable for medical text modeling as the base model, and prepare a medical question-and-answer dataset classified by subdomain; such as the Qwen and LLaMA series models.

[0010] Step 2: Construct multi-expert low-rank parameter structures next to the Query, Key, and Value projection matrices of the Transformer layer of the basic model. Each multi-expert low-rank parameter structure includes a shared low-rank matrix B∈R. r×d' (used to aggregate general medical knowledge across all subdomains) and M subdomain-specific matrices A i ∈R d×r , i∈{1,2,...,M} (used to model the specific knowledge of the corresponding subdomain), M is the number of medical subdomains, configure the subdomain splitting module to determine the medical subdomain to which the input question belongs and output the corresponding index;

[0011] Step 3: Perform two-stage training: In the first stage, freeze the weights of the base model and train the shared matrix B and the initial private matrix A using data from all subdomains; in the second stage, freeze the shared matrix B and fine-tune the corresponding private matrix A using data specific to each subdomain. i ;

[0012] Step 4: After training is complete, the parameter set A1, A2, ..., A is obtained. m With shared matrix B, during inference, the corresponding matrix A is dynamically invoked based on the subdomain to which the input question belongs. i This enables expert hybrid reasoning. During reasoning, the subdomain index of the input question is obtained through the subdomain diversion module, and the corresponding dedicated matrix A is dynamically invoked. i Using the shared matrix B, generate adaptive weights and substitute them into the basic model to complete question-answering reasoning.

[0013] In step one, the general large language model is either the Qwen series model or the LLaMA series model; the medical question-and-answer dataset contains four fields: department, title, ask, and answer, and the sub-domains include at least two of the following: andrology, internal medicine, obstetrics and gynecology, oncology, pediatrics, and surgery.

[0014] In step two, the sub-domain traffic splitting module is implemented in one of methods one and method two.

[0015] Method 1: Based on a lightweight perceptron classifier, the input is the hidden state vector of the problem, and the output is the sub-domain probability distribution. The dimension with the highest probability is selected as the sub-domain index.

[0016] Method 2: Based on semantic similarity matching, calculate the cosine similarity between the input question semantic vector and the representative vectors of each subdomain, and select the subdomain index with the highest similarity.

[0017] In step two,

[0018] Shared low-rank matrix B∈R r×d' Subdomain-specific matrix A i ∈R d×r Let i ∈ {1,2,...,M}, d and d' be the dimensions of the input and output matrices, respectively, and r be the rank of the low-rank matrix, which is usually much smaller than d and d'. The adaptation weight matrix for sub-domain i is calculated using the formula W'. i =W+A i B and W are the original projection matrices of the basic model.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0020] This invention significantly enhances the model's semantic understanding and generation capabilities across multiple medical subdomains by constructing a shared-private decoupled low-rank expert structure and combining it with a two-stage training mechanism. Compared to traditional single adapter structures, this method offers advantages in parameter efficiency, cross-domain generalization ability, and resistance to overfitting, making it particularly suitable for fine-grained domain adaptation scenarios such as multi-departmental medical question answering.

[0021] Solving the problem of knowledge conflict in multiple subdomains: Through a multi-expert structure decoupled by shared and private parameters, a shared matrix B aggregates general medical knowledge, and a dedicated matrix A... i Modeling subdomain-specific knowledge enables hierarchical representation of knowledge, effectively avoiding cross-subdomain knowledge conflicts;

[0022] To mitigate negative transfer: In the two-stage training strategy, the first stage constructs a unified medical feature space, and the second stage independently fine-tunes the sub-domain-specific parameters, while freezing the shared matrix to avoid mutual interference, which significantly reduces the risk of negative transfer.

[0023] Improving parameter efficiency and adaptation accuracy: Only a shared matrix and a small number of subdomain-specific low-rank matrices are added, and the parameter increment is much lower than that of full fine-tuning. At the same time, the dynamic calling mechanism ensures that the model is accurately adapted to each subdomain. Experimental results show that the average ROUGE-1 score on the LLaMA3-8B-Instruct and Qwen2.5-7B-Instruct models reaches 21.21% and 22.60% respectively, both of which are better than Prompt-Tuning, Prefix-Tuning, traditional LoRA and DoRA methods.

[0024] Enhanced generalization ability and anti-overfitting performance: The general knowledge base of the shared matrix provides basic support for each subdomain, while the targeted fine-tuning of the dedicated matrix takes into account specificity. Combined with training on structured datasets in the medical field, the model can still maintain good performance on similar problems in unseen subdomains, and the anti-overfitting effect is significant.

[0025] Wide range of applications: Applicable to all medical question-and-answer scenarios with multiple heterogeneous sub-domains, such as multi-department online consultation platforms and medical knowledge question-and-answer systems. It can be directly migrated to different medical sub-domains without the need to reconstruct the model architecture. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of a fine-tuning method for a multi-domain medical question-answering expert hybrid model according to the present invention.

[0028] Figure 2 This is a detailed structural diagram of ME-LoRA, a hybrid model for multi-domain medical question-answering experts according to the present invention. Detailed Implementation

[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] Reference Figure 1 A fine-tuning method for a multi-domain medical question-answering expert hybrid model includes the following steps:

[0031] Step 1: Select a general-purpose large language model suitable for medical text modeling as the base model, and prepare a medical question-and-answer dataset classified by subdomain; such as the Qwen and LLaMA series models.

[0032] LLaMa3-8B-Instruct and Qwen2.5-7B-Instruct were selected as the basic large language models (both possess strong general text understanding and generation capabilities and are suitable for Chinese text processing scenarios). Six sub-domain question-answer pairs were obtained from the Chinese Medical Dialogue Data dataset, categorized by department: andrology, internal medicine, obstetrics and gynecology, oncology, pediatrics, and surgery. The data volume for each sub-domain is shown in Table 1.

[0033] Table 1. Question and Answer Files and Question and Answer Data Volume

[0034] file name Andrology Internal Medicine Obstetrics and Gynecology Oncology Pediatrics surgical Question-answer pairs 94596 220606 183751 75553 101602 115991

[0035] The data includes four fields: department, title, question, and answer, and their JSON format content is shown in Table 2.

[0036] Table 2. Examples of Question-Answer Pairs

[0037]

[0038]

[0039] Step 2: Construct multi-expert low-rank parameter structures next to the Query, Key, and Value projection matrices of the Transformer layer of the basic model. Each multi-expert low-rank parameter structure includes a shared low-rank matrix B∈R. r×d' (used to aggregate general medical knowledge across all subdomains) and M subdomain-specific matrices A i ∈R d×r , i∈{1,2,...,M} (used to model the specific knowledge of the corresponding subdomain), M is the number of medical subdomains, configure the subdomain splitting module to determine the medical subdomain to which the input question belongs and output the corresponding index;

[0040] Assume the weight matrix of the base model is W∈R d×d' , where d and d' are the dimensions of the input and output matrices, respectively. Construct as follows: Figure 2 The multi-expert low-rank adaptation structure shown is the core innovation of this invention in achieving multi-domain adaptation.

[0041] like Figure 2As shown, a multi-expert adaptation module is introduced in parallel alongside the three projection matrices W of the Transformer layer: Query, Key, and Value. q W k W v ∈R d×d′ All are equipped with the same multi-expert structure, including: a shared low-rank matrix B∈R r×d' and M subdomain-specific matrices A i ∈R d×r , i∈{1,2,...,M}. Where r is the rank of the low-rank matrix, which is usually much smaller than d and d'.

[0042] The workflow of this structure is as follows: After the input is in the hidden state, the semantic content of the input question is analyzed by the sub-domain triage module to determine its medical sub-domain and output the corresponding domain index. The system then dynamically selects the appropriate private expert matrix A based on this index. i A linear operation is performed with the shared matrix B to generate a low-rank increment ΔW = A. i B. This increment is added to the original projection matrix to obtain the adapted weights:

[0043] W′ i =W+A i B

[0044] By simultaneously implementing this adaptation mechanism on three types of projection matrices, the model can generate domain-specific attention distributions in different subdomains, thereby achieving accurate semantic understanding and content generation.

[0045] The subdomain routing module is used to implement dynamic routing from the input problem to the corresponding subdomain expert matrix. In embodiments of the present invention, this module can be implemented in any of the following feasible ways:

[0046] Method 1 (Based on a Lightweight Classifier): The traffic splitting module is a lightweight neural network classifier (e.g., built based on a multilayer perceptron or convolutional network). This classifier takes the hidden state vector of the input problem as input, and the output layer dimension is the same as the number of sub-domains M. The probability distribution P = [p1, p2, ..., p] belonging to each sub-domain is calculated using the Softmax function. M ], and select the dimension i = argmax(P) with the highest probability as the selected subdomain index.

[0047] Method 2 (Semantic Similarity-Based Matching): A representative set of domain description texts or keywords is predefined for each subdomain or extracted from the training data and encoded as a fixed-dimensional vector. The splitting module calculates the similarity (e.g., cosine similarity) between the semantic representation of the input question and the representative vectors of all subdomains, and selects the subdomain index i with the highest similarity.

[0048] Step 3: Perform two-stage training: In the first stage, freeze the weights of the base model and train the shared matrix B and the initial private matrix A using data from all subdomains; in the second stage, freeze the shared matrix B and fine-tune the corresponding private matrix A using data specific to each subdomain. i ;;

[0049] Phase 1: Joint Training and Parameter Sharing

[0050] The weights W of the base model are frozen, and a shared matrix B and an initial private matrix A are trained using data from all subdomains. Knowledge from all subdomains is aggregated through the shared matrix B to form a unified medical feature representation space.

[0051] After this training phase is completed, the parameters of the resulting shared matrix B and the basic private matrix A are saved as the private matrices A for each subdomain in the second phase. i The initial parameters are determined by this warm-start strategy, which helps to accelerate convergence and improve model performance.

[0052] Phase Two: Subdomain-Specific Fine-Tuning

[0053] Freeze the shared matrix B, and fine-tune its private matrix A individually for each subdomain i. i During this phase, the shared matrix B is frozen, and then a private low-rank increment matrix A is created separately for each specific subdomain i. i Fine-tuning is performed; during this process, only the private matrix A corresponding to each subdomain is adjusted. i As trainable parameters, using the subdomain-specific data D i Supervised fine-tuning was carried out, and the A algorithm was used to achieve the desired result. i Iterative updates of parameters.

[0054] Step 4: After training is complete, the parameter set A1, A2, ..., A is obtained. m With shared matrix B, during inference, the corresponding matrix A is dynamically invoked based on the subdomain to which the input question belongs. i This enables expert hybrid reasoning. During reasoning, the subdomain index of the input question is obtained through the subdomain diversion module, and the corresponding dedicated matrix A is dynamically invoked. i Using the shared matrix B, generate adaptive weights and substitute them into the basic model to complete question-answering reasoning.

[0055] In step one, the general large language model is either the Qwen series model or the LLaMA series model; the medical question-and-answer dataset contains four fields: department, title, ask, and answer, and the sub-domains include at least two of the following: andrology, internal medicine, obstetrics and gynecology, oncology, pediatrics, and surgery.

[0056] To objectively verify the effectiveness of this invention, it was systematically compared with several mainstream parameter fine-tuning methods, including Prompt-Tuning, Prefix-Tuning, LoRA, and DoRA. ROUGE-1 was used as the core evaluation metric, which measures the model's ability to cover key information by calculating the unigram-level overlap between the generated text and the reference text. Specific experimental results are shown in Table 3.

[0057] Table 3. Average evaluation results of the ME-LORA method and other fine-tuning methods under different models.

[0058] Model method Average ROUGE-1 score LLaMA3-8B-Instruct Prompt-Tuning 17.48% Prefix-Tuning 18.86% LoRA (baseline) 21.04% DoRA 20.93% ME-LoRA 21.21% Qwen2.5-7B-Instruct Prompt-Tuning 21.83% Prefix-Tuning 21.43% LoRA (baseline) 22.33% DoRA 21.97% ME-LoRA 22.60%

[0059] Experimental results show that the ME-LoRA method proposed in this invention achieves the best average ROUGE-1 score on both backbone models. This not only verifies its superior performance, but more importantly, it effectively solves the knowledge conflict and negative transfer problem between multiple heterogeneous subdomains through shared-private parameter decoupling and a two-stage training mechanism, achieving a balance between performance and stability in fine-grained domain adaptation.

[0060] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and these variations still fall within the protection scope of the present invention.

Claims

1. A fine-tuning method for a multi-domain medical question-answering expert hybrid model, characterized in that: Includes the following steps: Step 1: Select a general-purpose large language model suitable for medical text modeling as the base model, and prepare a medical question-and-answer dataset classified by sub-domain; Step 2: Construct multi-expert low-rank parameter structures next to the Query, Key, and Value projection matrices of the Transformer layer of the basic model. Each multi-expert low-rank parameter structure includes a shared low-rank matrix B∈R. r×d' and M subdomain-specific matrices A i ∈R d×r , i∈{1,2,...,M}, M is the number of medical subdomains, configure the subdomain splitting module to determine the medical subdomain to which the input question belongs and output the corresponding index; Step 3: Perform two-stage training: In the first stage, freeze the weights of the base model and train the shared matrix B and the initial private matrix A together with data from all sub-domains; In the second phase, the shared matrix B is frozen, and the corresponding dedicated matrix A is fine-tuned using data specific to each subdomain. i ; Step 4: After training is complete, the parameter set A1, A2, ..., A is obtained. m With shared matrix B, during inference, the corresponding matrix A is dynamically invoked based on the subdomain to which the input question belongs. i This enables expert hybrid reasoning.

2. The fine-tuning method for a multi-domain medical question-answering expert hybrid model according to claim 1, characterized in that: In step one, the general large language model is either the Qwen series model or the LLaMA series model; the medical question-and-answer dataset contains four fields: department, title, ask, and answer, and the sub-domains include at least two of the following: andrology, internal medicine, obstetrics and gynecology, oncology, pediatrics, and surgery.

3. The fine-tuning method for a multi-domain medical question-answering expert hybrid model according to claim 1, characterized in that: In step two, the sub-domain traffic splitting module is implemented in one of methods one and method two. Method 1: Based on a lightweight perceptron classifier, the input is the hidden state vector of the problem, and the output is the sub-domain probability distribution. The dimension with the highest probability is selected as the sub-domain index. Method 2: Based on semantic similarity matching, calculate the cosine similarity between the input question semantic vector and the representative vectors of each subdomain, and select the subdomain index with the highest similarity.

4. The fine-tuning method for a multi-domain medical question-answering expert hybrid model according to claim 1, characterized in that: In step two, Shared low-rank matrix B∈R r×d' Subdomain-specific matrix A i ∈R d×r Let i ∈ {1,2,...,M}, d and d' be the dimensions of the input and output matrices, respectively, and r be the rank of the low-rank matrix, which is usually much smaller than d and d'. The adaptation weight matrix for sub-domain i is calculated using the formula W'. i =W+A i B and W are the original projection matrices of the basic model.

Citation Information

Cited By

  • Hierarchical selection automatic low-rank adaptation method for efficient fine tuning of model parameters

    CN121902914A