Data processing method, apparatus, device, and medium

By jointly training the initial network model, the output format and logic of the large language model are optimized, which solves the problem of low generation effect and accuracy of the large language model in the medical and health field, and achieves more efficient generation effect and accuracy.

CN116862017BActive Publication Date: 2026-05-12PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2023-06-30
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Large language models have low generation performance and accuracy in the healthcare field, mainly because existing text prompts cannot fully reflect the knowledge structure and characteristics of the target domain.

Method used

By inputting the original training data into the initial network model, first and second output results are obtained, and the contrastive loss is calculated based on these results. The initial network model is then optimized using a joint training method. The target network model is formed by combining the output formats and logic of the initial first network model and the initial second network model.

Benefits of technology

It improves the generation effect and accuracy of large language models in the field of healthcare, while reducing the amount of data and the demand for computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116862017B_ABST
    Figure CN116862017B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, natural language processing and medical health technology, and discloses a data processing method, device, equipment and medium, wherein the method comprises the following steps: inputting original training data into an initial first network model of an initial network model to perform operation, so as to obtain a first output result; determining a first comparison loss according to the first output result; inputting the first output result into an initial second network model to perform operation, so as to obtain a second output result; determining a second comparison loss according to the second output result; and performing joint training on the initial network model according to the first comparison loss and the second comparison loss, so as to obtain a target network model. The generation effect and accuracy of a large language model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence technology, natural language processing, and medical and health technology, and in particular to a data processing method, apparatus, device, and medium. Background Technology

[0002] With the advent of the mobile internet era, the application of Large Language Models (LLMs) has become increasingly widespread. LLMs are deep neural network models capable of processing massive amounts of text data and generating natural language text, such as GPT-3 and BERT. LLMs possess strong versatility and generalization capabilities, and can be applied to various natural language processing tasks, such as text generation, text summarization, and question answering systems. Currently, text prompts are generally used, providing the LLM with text of a specific format or content as input or output guidance, expecting the LLM to generate or answer in the expected manner. For example, in the healthcare field, user medical data can be provided to the LLM, and the LLM can be adjusted based on this data, ultimately enabling the adjusted LLM to generate medical reports based on the medical data. However, because text prompts often require manual design and adjustment, and because they often only provide superficial or partial information and cannot fully reflect the knowledge structure and characteristics of the target domain, the generation effect and accuracy of large language models are not high. Summary of the Invention

[0003] This invention provides a data processing method, apparatus, device, and medium to solve the technical problem of low generation effect and accuracy of large language models.

[0004] Firstly, a data processing method is provided, which is applied to an initial network model, the initial network model including an initial first network model and an initial second network model, the initial second network model including a large language model, the method comprising:

[0005] The original training data is input into the initial network model; the initial network model includes an initial first network model and an initial second network model.

[0006] Based on the initial first network model, a first output result is output, and a first contrastive loss is obtained based on the first output result;

[0007] Based on the first output result, a second output result is output through the initial second network model, and a second contrast loss is obtained based on the second output result;

[0008] The initial network model is jointly trained using the first contrastive loss and the second contrastive loss to obtain the target network model.

[0009] In a second aspect, a data processing apparatus is provided, which is applied to an initial network model, the initial network model including an initial first network model and an initial second network model, the initial second network model including a large language model, the data processing apparatus comprising:

[0010] A data input unit is used to input raw training data into an initial network model; the initial network model includes an initial first network model and an initial second network model.

[0011] The first loss unit is used to output a first output result based on the initial first network model, and to obtain a first contrast loss based on the first output result.

[0012] The second loss unit is used to output a second output result based on the first output result through the initial second network model, and to obtain a second contrast loss based on the second output result.

[0013] The model training unit is used to jointly train the initial network model based on the first contrastive loss and the second contrastive loss to obtain the target network model.

[0014] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described data processing method.

[0015] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described data processing method.

[0016] In the above-described data processing method, apparatus, device, and medium, the original training data is input into the initial first network model of the initial network model for computation to obtain a first output result. A first contrast loss is determined based on the first output result. The first output result is then input into the initial second network model for computation to obtain a second output result. A second contrast loss is determined based on the second output result. The initial network model is then jointly trained based on the first contrast loss and the second contrast loss to obtain a target network model. Therefore, by jointly training the initial first network model and the initial second network model, the large language model can learn the output format and logic of the initial first network model. At the same time, it can reduce the amount of data and the demand for computing resources, and improve the generation effect and accuracy of the large language model. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention 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.

[0018] Figure 1 This is a schematic diagram illustrating an application scenario of data processing provided in an embodiment of this application;

[0019] Figure 2 This is a network architecture diagram for data processing provided in an embodiment of this application;

[0020] Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0021] Figure 4 This is an example schematic diagram of a data processing method provided in an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0023] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application;

[0024] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0025] 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, not all, of the embodiments of the present invention. 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.

[0026] The data processing method provided in this embodiment of the invention can be applied to, for example, Figure 1In this application environment, the client communicates with the server via a network. For example, in a healthcare scenario, a target user can send medical data to the server through the client. After receiving the medical data, the server processes it using a trained target network model to obtain a corresponding medical report. The server then sends the medical report to the client, which displays the report. Before processing the medical data using the trained target network model to obtain the corresponding medical report, the server needs to train an initial network model to obtain the target network model. The initial network model includes an initial first network model and an initial second network model. The initial first network model can be a small model specific to the healthcare scenario, while the initial second network model can be a large language model. During training, the server inputs the original training data into the initial first network model of the initial network model for computation to obtain a first output result. The server determines a first contrastive loss based on the first output result. The server then inputs the first output result into the initial second network model for computation to obtain a second output result. The server determines a second contrastive loss based on the second output result. The server then jointly trains the initial network model based on the first and second contrastive losses to obtain the target network model. Thus, by jointly training the initial first and second network models, the large language model can learn the output format and logic of the initial first network model, while also reducing the data volume and computational resource requirements, and improving the generation effect and accuracy of the large language model.

[0027] Please see Figure 2 , Figure 2 This application provides another network architecture diagram for data processing. This network architecture diagram may include a service server 100 and a user terminal cluster. The user terminal cluster may include user terminal 10a, user terminal 10b, ..., user terminal 10c. Communication connections may exist between user terminals in the cluster; for example, there is a communication connection between user terminal 10a and user terminal 10b, and a communication connection between user terminal 10b and user terminal 10c. Furthermore, any user terminal in the user terminal cluster may have a communication connection with the service server 100; for example, there is a communication connection between user terminal 10a and service server 100, and a communication connection between user terminal 10b and service server 100.

[0028] The aforementioned user terminal cluster (including user terminal 10a, user terminal 10b, and user terminal 10c) can all have the target application installed. Optionally, the target application may include an application with the function of displaying data information such as text, images, and videos.

[0029] The database 10d stores the original training data. Further, the user terminal inputs the original training data into the initial first network model of the initial network model for computation to obtain a first output result. Based on the first output result, a first contrastive loss is determined. The first output result is then input into the initial second network model for computation to obtain a second output result. Based on the second output result, a second contrastive loss is determined. The initial network model is then jointly trained using the first and second contrastive losses to obtain the target network model. Therefore, by jointly training the initial first and second network models, the large language model can learn the output format and logic of the initial first network model, while also reducing the data volume and computational resource requirements, and improving the generation effect and accuracy of the large language model.

[0030] Optionally, the aforementioned user terminal can be one of the above-mentioned... Figure 1 In the corresponding embodiment, any user terminal selected in the user terminal cluster, for example, the user terminal can be the aforementioned user terminal 10b. Then, the user can obtain the original training data on the display page of user terminal 10b and perform joint training based on the original training data to obtain the target network model.

[0031] It is understood that the methods provided in this application embodiment can be executed by computer devices, including but not limited to terminals or servers. The business server 100 in this application embodiment can be a computer device, and the user terminals in the user terminal cluster can also be computer devices; this is not limited here. The aforementioned business server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The aforementioned terminals can include: smartphones, tablets, laptops, desktop computers, smart TVs, smart speakers, desktop computers, smartwatches, and other smart terminals with image recognition functions, but are not limited to these. The user terminals and the business server can be directly or indirectly connected via wired or wireless communication; this application does not impose any restrictions on this connection.

[0032] Please see Figure 3 As shown, Figure 3 This is a schematic flowchart of a data processing method provided in an embodiment of the present invention. Figure 3 As shown, this method can be performed by a user terminal (e.g., the one described above). Figure 2 The operation can be performed by the user terminal shown, or by the user terminal and the service server (as described above). Figure 2 The business server 100 in the corresponding embodiment executes the method together. For ease of understanding, this embodiment uses the method executed by the aforementioned user terminal as an example. The data processing method is applied to the initial network model, which includes an initial first network model and an initial second network model. The initial second network model includes a large language model. The data processing method includes the following steps:

[0033] S101, Input the original training data into the initial first network model of the initial network model for computation to obtain the first output result;

[0034] Specifically, the user terminal inputs the raw training data into the initial network model. This raw training data is used to train the initial network model, which includes an initial first network model and an initial second network model. The raw training data may include medical data and medical report information, etc., as illustrated here. The first output result may be a probability distribution of disease information corresponding to the medical data, etc.

[0035] The initial first network model can be a neural network model or a machine learning model. Specifically, based on the knowledge structure and characteristics of the target domain, a small domain-specific model can be constructed as the initial first network model. The target domain can include fields such as healthcare. This small model can be a classifier, a generator, an encoder, a decoder, or any other suitable machine learning model. For example, in the healthcare field, a disease diagnosis small model can be constructed. This small model can accept patient symptom information as input and output a probability distribution of symptom information (the first output result). This small model can utilize a medical knowledge base or medical literature as raw training data and be trained using other supervised or unsupervised learning methods.

[0036] The initial second network model can be a large language model, specifically any deep neural network model that has been pre-trained on massive amounts of text data, such as the GPT-3 model, the BERT model, etc.

[0037] S102, determine the first comparison loss based on the first output result;

[0038] Specifically, the user terminal can obtain a first contrastive loss based on the first output result. It can be understood that the user terminal outputs a first output result based on the initial first network model, obtains a first probability distribution corresponding to the first output result through a first distribution function, further obtains a first probability label and a first loss function corresponding to the first probability distribution, and finally obtains the first contrastive loss based on the first probability distribution, the first probability label, and the first loss function.

[0039] The initial first network model is used as a domain-specific small model for illustration: Let M be a domain-specific small model (i.e., the initial first network model). Specifically, the minimized first contrastive loss can be determined using the method shown in the following formula.

[0040]

[0041] Where x is the input data of the small model in the target domain, y is the first output result of the small model in the target domain, p(y|x;M) is the output probability distribution of the small model in the target domain, and its corresponding function is the first distribution function, L(M) is the loss function of the small model in the target domain, D is the training dataset of the small model in the target domain, the training dataset includes the original training data, |.| is the absolute value operation, log is the logarithm operation, and M represents the initial first network model.

[0042] Specifically, small models can take one of the following forms:

[0043] Classifier: If the output of the small model, i.e., the first output, is a discrete label or category, then the small model can take the form of a classifier. For example, it can use a Multi-Layer Perceptron (MLP), a Convolutional Neural Network (CNN), a Recurrent Neural Network (RNN), or any other suitable neural network architecture as the classifier. The output probability distribution of the classifier, i.e., the first probability distribution, can be calculated using the softmax function (normalized exponential function) or any other suitable activation function. The first loss function of the classifier can be calculated using cross-entropy or any other suitable loss function.

[0044] Generator: If the output of the small model, i.e., the initial output, is a continuous vector or tensor, then the small model can take the form of a generator. For example, it can use a Variational Auto-Encoder (VAE), a Generative Adversarial Network (GAN), or any other suitable generative model as the generator. The output probability distribution of the generator, i.e., the initial probability distribution, can be calculated using a Gaussian distribution or any other suitable distribution function. The initial loss function of the generator can be calculated using reconstruction error, adversarial loss, or any other suitable loss function.

[0045] Encoder: If the output of the small model, i.e., the first output result, is an intermediate representation rather than a final result, then the small model can take the form of an encoder. For example, an autoencoder, a transformer, or any other suitable encoding model can be used as the encoder. The output probability distribution of the encoder, i.e., the first probability distribution, can be calculated using a Gaussian distribution or any other suitable distribution function. The first loss function of the encoder can be calculated using the reconstruction error or any other suitable loss function.

[0046] Decoder: If the input to the small model is an intermediate representation instead of raw training data, then the small model can take the form of a decoder, for example, using an autoencoder, a transformer, or any other suitable decoding model. The output probability distribution of the decoder, i.e., the first probability distribution, can be calculated using the softmax function or any other suitable activation function. The first loss function of the decoder can be calculated using cross-entropy or any other suitable loss function.

[0047] S103, input the first output result into the initial second network model for calculation to obtain the second output result;

[0048] Specifically, based on the first output result, the user terminal outputs a second output result through the initial second network model. The second output result could be, for example, medical report information related to medical data; this is merely an example.

[0049] S104, determine the second contrast loss based on the second output result;

[0050] Specifically, the user terminal obtains a second contrastive loss based on the second output result. This can be understood as follows: the user terminal, based on the first output result, outputs a second output result through the initial second network model, and obtains the type information of the initial second network model; determines a second distribution function corresponding to the initial second network model based on the type information; determines a second probability distribution corresponding to the second output result through the second distribution function; obtains a second probability label and a second loss function for the second probability distribution; and determines the second contrastive loss based on the second probability distribution, the second probability label, and the second loss function. 。 Among them, the type information of different network models has its corresponding second distribution function, so the second distribution function corresponding to the initial second network model can be determined according to the mapping relationship.

[0051] Specifically, using the initial second network model as a large language model, the method to minimize the second contrastive loss can be determined using the following formula.

[0052]

[0053] Let L be a pre-trained large language model, z be an intermediate representation, i.e., the first output of the initial first network model, w be the output of the large language model, i.e., the second output of the initial second network model, p(w|z;L) be the output probability distribution of the large language model, and its corresponding function is the second distribution function, i.e., the second probability distribution, L(L) be the second loss function of the large language model, D′ be the training dataset of the large language model, the training dataset includes the original training data, the initial first network model and the initial second network model use the same training dataset, |.| is the absolute value operation, log is the logarithmic operation, and L represents the initial second network model.

[0054] Specifically, large language models can take one of the following forms:

[0055] GPT-3 Model: GPT-3 is an autoregressive language model based on a transformer, meaning it generates subsequent text based on preceding text. For example, given an input sequence z = (z1, z2, ..., z...),... n It can generate an output sequence w = (w1, w2, ..., w m ), where each w i Both depend on z and w <i ,Right now:

[0056]

[0057] Where p(w|z;L) is the output probability distribution of the large language model, and its corresponding function is the second distribution function, i.e. the second probability distribution, and L represents the initial second network model.

[0058] BERT Model: BERT is an autoencoding language model based on a transformer, meaning it generates missing words based on context. For example, given an input sequence z = (z1, z2, ..., z...), BERT can generate missing words based on context. n Some of the words are randomly replaced with a special mask symbol, which can generate an output sequence w = (w1, w2, ..., w...). n ), where each w i All depend on z and except wi Other words besides:

[0059]

[0060] Where p(w|z;L) is the output probability distribution of the large language model, and its corresponding function is the second distribution function, i.e. the second probability distribution, and L represents the initial second network model.

[0061] S105, the initial network model is jointly trained based on the first contrastive loss and the second contrastive loss to obtain the target network model.

[0062] The purpose of joint training is to enable the large language model to learn the output format and logic of the small model, so that it can generate appropriate text based on the output of the small model when in use. There are various methods for joint training. For example, knowledge distillation can be used, in which the large language model fits the output of the small model to learn the knowledge of the small model; adversarial learning can be used, in which the large language model and the small model interact to learn the strategy of the small model; other collaborative learning or multi-task learning methods can also be used, in which the large language model and the small model jointly complete one or more target tasks to learn the capabilities of the small model.

[0063] Specifically, the user terminal obtains the balance coefficients of the joint training. It can be understood that the balance coefficients are pre-set parameters. Further, a first joint loss function is constructed based on the balance coefficients, the first loss function of the initial first network model, and the second loss function of the initial second network model.

[0064] Specifically, the first joint loss function H can be constructed using the method shown in the following formula:

[0065]

[0066] Where α is the balance coefficient, L(M) is the first loss function, and L(L) is the second loss function, then the first joint loss function is H. This is a minimum value operation.

[0067] Further, the joint contrastive loss of the initial network model is determined based on the first contrastive loss, the second contrastive loss, and the first joint loss function; the weight parameters of the initial first network model and the initial second network model in the initial network model are adjusted based on the first training data of the initial network model and the joint contrastive loss; after the joint contrastive loss converges, the target network model is obtained. The target network model includes a first target network model and a second target network model, wherein the first target network model is obtained by adjusting the initial first network model, and the second target network model is obtained by adjusting the initial second network model.

[0068] When the joint contrastive loss value is less than the loss value threshold, the joint contrastive loss converges, thus obtaining the target network model.

[0069] Specifically, joint training can be performed using one of the following methods:

[0070] Knowledge distillation is a method that allows a large model to fit the output of a smaller model, essentially letting the larger model learn from the knowledge of the smaller model. The loss function for knowledge distillation can be calculated using mean squared error or any other suitable loss function. The advantage of knowledge distillation is that it can make large models more compact and efficient.

[0071] Adversarial learning is a method that allows large and small models to interact, either competing or cooperating, thereby learning the smaller model's strategy. The loss function for adversarial learning can be minimax or any other suitable loss function. The advantage of adversarial learning is that it can make large models more flexible and intelligent; the disadvantage is that it may lead to instability or non-convergence.

[0072] Collaborative learning is a method that allows large and small models to work together to complete one or more target tasks. In other words, it enables large and small models to cooperate or complement each other, thereby learning the capabilities of the smaller model. The loss function for collaborative learning can be calculated using a weighted sum or any other suitable loss function.

[0073] Once the target network model is trained, it can be used in a specific field. Specifically, it receives the symptom information of the target user, inputs the symptom information into the target network model for calculation, and obtains medical report information corresponding to the symptom information.

[0074] For example, in practice, input data from the target domain (e.g., healthcare) is processed by a small model (the model trained from the initial first network model) to obtain an intermediate representation. This intermediate representation is then passed as input to a large language model (the model trained from the initial second network model) to obtain the final output. This intermediate representation can be any form that helps the large language model generate text; for example, it can be a tag, a keyword, a sentence, a paragraph, or any other suitable text format; it can also be a vector, a matrix, a tensor, or any other suitable numerical format; or it can be an image, audio, video, or any other suitable multimedia format. This intermediate representation can contain knowledge and information from the target domain, as well as some generation guidelines and constraints.

[0075] Specifically, the intermediate representation of z can take one of the following forms:

[0076] Labels: If the intermediate representation is a discrete label or category, then the output of the smaller model can be used directly as the intermediate representation, i.e.:

[0077]

[0078] in This means that the output y with the highest probability is taken, M represents the initial first network model, y is the first output result, x is the original training data, and p(y|x;M) is the output probability distribution of the initial first network model. This intermediate representation can provide some simple or local information and can be easily concatenated with text.

[0079] Keywords: If the intermediate representation is a continuous vector or tensor, then a keyword extraction method can be used to convert it into one or more keywords as the intermediate representation, i.e.:

[0080] z = K(M(x)) = (k1, k2, ..., k n )

[0081] Where K is a keyword extraction function, (k1,k2,...,k n A sequence of one or more keywords is given, where x is the original training data and M represents the initial first network model. This intermediate representation can provide complex or global information and can be easily concatenated with text.

[0082] Sentence: If the intermediate representation is a continuous vector or tensor, then a sentence generation method can be used to convert it into one or more sentences as the intermediate representation, i.e.:

[0083] z = S(M(x)) = (s1, s2, ..., s m )

[0084] Where S is a sentence generation function, (s1, s2, ..., s...) m A sequence of one or more sentences is given, where x is the original training data and M represents the initial first network model. This form of intermediate representation can provide detailed or in-depth information and can be easily concatenated with text.

[0085] Paragraphs: If the intermediate representation is a continuous vector or tensor, then a paragraph generation method can be used to convert it into one or more paragraphs as the intermediate representation, i.e.:

[0086] z = P(M(x)) = (p1, p2, ..., p l )

[0087] Where P is a paragraph generation function, (p1, p2, ..., p... l A sequence of one or more paragraphs is represented by , where x is the original training data and M represents the initial first network model. This form of intermediate representation can provide some complete or systematic information and can be easily concatenated with text.

[0088] The following will combine Figure 4 The following describes specific implementation scenarios provided in the embodiments of this application, such as... Figure 4 As shown. In the medical field, if the objective task is to generate a medical report based on a patient's symptoms, the patient's symptoms can first be processed through a small disease diagnosis model, i.e., the first objective network model, to obtain a disease name or a disease probability distribution as an intermediate representation, i.e., the first output result. Then, the intermediate representation is passed as input to a large language model, i.e., the second objective network model, to obtain a medical report information as the output result, i.e., the second output result.

[0089] In one possible implementation, after inputting the symptom information into the target network model for computation to obtain a medical report corresponding to the symptom information, risk warnings can also be issued to the target user, as follows:

[0090] A1. Extract keywords from the medical report information to obtain a first keyword set;

[0091] A2. Perform semantic analysis on each first keyword in the first keyword set to obtain the first semantic information corresponding to each first keyword;

[0092] A3. Determine the risk type indication value corresponding to the target user based on the first semantic information corresponding to each first keyword;

[0093] A4. If the risk type indicator value is higher than the preset risk type indicator value, then a risk alarm message is determined;

[0094] A5. Display the aforementioned risk warning information.

[0095] Specifically, a general keyword extraction method can be used to extract keywords from the medical report information to obtain a first keyword set. A general semantic analysis method can then be used to perform semantic analysis to obtain the first semantic information corresponding to each first keyword. This first semantic information includes a risk type indicator value that indicates the target user's risk type. Specifically, within a given risk type, a higher risk type indicator value indicates a higher probability that the target user falls into that risk type, and a lower risk type indicator value indicates a lower probability. The preset risk type indicator value is set based on empirical values ​​or historical data.

[0096] Risk information alarms may include risk type indication values, etc.

[0097] In this example, the original training data is input into the initial first network model of the initial network model for computation to obtain a first output result. A first contrast loss is determined based on the first output result. The first output result is then input into the initial second network model for computation to obtain a second output result. A second contrast loss is determined based on the second output result. The initial network model is jointly trained based on the first contrast loss and the second contrast loss to obtain the target network model. Therefore, by jointly training the initial first network model and the initial second network model, the large language model can learn the output format and logic of the initial first network model. At the same time, it can reduce the amount of data and the demand for computing resources, and improve the generation effect and accuracy of the large language model.

[0098] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0099] In one embodiment, a data processing apparatus is provided, which corresponds one-to-one with the data processing methods described in the above embodiments. For example... Figure 5As shown, the data processing device is applied to an initial network model, which includes an initial first network model and an initial second network model. The initial second network model includes a large language model. The data processing device includes a data input unit 102, a first determination unit 103, a computation unit 104, a second determination unit 105, and a training unit 106. Detailed descriptions of each functional module are as follows:

[0100] The data input unit 101 is used to input the original training data into the initial first network model of the initial network model for calculation to obtain the first output result;

[0101] The first determining unit 102 is used to determine the first comparison loss based on the first output result;

[0102] The computation unit 103 is used to input the first output result into the initial second network model for computation to obtain the second output result;

[0103] The second determining unit 104 is used to determine the second contrast loss based on the second output result;

[0104] Training unit 105 is used to jointly train the initial network model based on the first contrastive loss and the second contrastive loss to obtain the target network model.

[0105] In one possible implementation, the first determining unit 102 is used for:

[0106] The first contrast loss can be determined based on the first output result using the method shown in the following formula:

[0107]

[0108] in, Let L(M) be the first contrastive loss, D be the training dataset of the initial first network model, p(y|x;M) be the output probability distribution of the initial first network model, y be the first output result, and x be the original training data.

[0109] In one possible implementation, the second determining unit 104 is used for:

[0110] Obtain the type information of the initial second network model;

[0111] Determine the second distribution function corresponding to the initial second network model based on the type information;

[0112] The second probability distribution corresponding to the second output result is determined by the second distribution function;

[0113] Obtain the second probability label and the second loss function of the second probability distribution;

[0114] The second contrastive loss is determined based on the second probability distribution, the second probability label, and the second loss function.

[0115] In one possible implementation, training unit 105 is used for:

[0116] Obtain the balance coefficient of joint training;

[0117] A first joint loss function is constructed based on the balance coefficient, the first loss function of the initial first network model, and the second loss function of the initial second network model;

[0118] The joint contrast loss is determined based on the first contrast loss, the second contrast loss, and the joint loss function;

[0119] The weight parameters of the initial first network model and the initial second network model in the initial network model are adjusted based on the first training data of the initial network model, and the target network model is obtained after the joint contrastive loss converges.

[0120] In one possible implementation, in constructing the first joint loss function based on the balance coefficients, the first loss function of the initial first network model, and the second loss function of the initial second network model, the training unit 105 is configured to:

[0121] The first joint loss function is constructed using the method shown in the following formula, based on the balance coefficient, the first loss function of the initial first network model, and the second loss function of the initial second network model:

[0122]

[0123] Where H is the first joint loss function, L(M) is the first loss function, L(L) is the second loss function, and α is the balance coefficient. This is a minimum value operation.

[0124] In one possible implementation, after jointly training the initial network model based on the first contrastive loss and the second contrastive loss to obtain the target network model, the data processing device is further configured to:

[0125] Receive the target user's medical information;

[0126] The disease information is input into the target network model for processing to obtain medical report information corresponding to the disease information.

[0127] In one possible implementation, after inputting the symptom information into the target network model for computation to obtain a medical report corresponding to the symptom information, the data processing device is further configured to:

[0128] Keyword extraction is performed on the medical report information to obtain a first keyword set;

[0129] Semantic analysis is performed on each first keyword in the first keyword set to obtain the first semantic information corresponding to each first keyword.

[0130] The risk type indication value corresponding to the target user is determined based on the first semantic information corresponding to each first keyword;

[0131] If the risk type indicator value is higher than the preset risk type indicator value, then a risk alarm message is determined;

[0132] Display the aforementioned risk warning information.

[0133] In this example, the original training data is input into the initial first network model of the initial network model for computation to obtain a first output result. A first contrast loss is determined based on the first output result. The first output result is then input into the initial second network model for computation to obtain a second output result. A second contrast loss is determined based on the second output result. The initial network model is jointly trained based on the first contrast loss and the second contrast loss to obtain the target network model. Therefore, by jointly training the initial first network model and the initial second network model, the large language model can learn the output format and logic of the initial first network model. At the same time, it can reduce the amount of data and the demand for computing resources, and improve the generation effect and accuracy of the large language model.

[0134] Specific limitations regarding the data processing device can be found in the limitations regarding the data processing method described above, and will not be repeated here. Each module in the aforementioned data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0135] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a data processing method on the server side.

[0136] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a data processing method on the client side.

[0137] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program executes a data processing method applied to an initial network model, the initial network model including an initial first network model and an initial second network model, the initial second network model including a large language model. When the processor executes the computer program, it performs the following steps:

[0138] The original training data is input into the initial first network model of the initial network model for computation to obtain the first output result;

[0139] Determine the first contrast loss based on the first output result;

[0140] The first output result is input into the initial second network model for calculation to obtain the second output result;

[0141] The second contrast loss is determined based on the second output result;

[0142] The initial network model is jointly trained using the first contrastive loss and the second contrastive loss to obtain the target network model.

[0143] In this example, the original training data is input into the initial first network model of the initial network model for computation to obtain a first output result. A first contrast loss is determined based on the first output result. The first output result is then input into the initial second network model for computation to obtain a second output result. A second contrast loss is determined based on the second output result. The initial network model is jointly trained based on the first contrast loss and the second contrast loss to obtain the target network model. Therefore, by jointly training the initial first network model and the initial second network model, the large language model can learn the output format and logic of the initial first network model. At the same time, it can reduce the amount of data and the demand for computing resources, and improve the generation effect and accuracy of the large language model.

[0144] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon. The computer program executes a data processing method applied to an initial network model, the initial network model including an initial first network model and an initial second network model, the initial second network model including a large language model. When the computer program is executed by a processor, it performs the following steps:

[0145] The original training data is input into the initial first network model of the initial network model for computation to obtain the first output result;

[0146] Determine the first contrast loss based on the first output result;

[0147] The first output result is input into the initial second network model for calculation to obtain the second output result;

[0148] The second contrast loss is determined based on the second output result;

[0149] The initial network model is jointly trained using the first contrastive loss and the second contrastive loss to obtain the target network model.

[0150] In this example, the original training data is input into the initial first network model of the initial network model for computation to obtain a first output result. A first contrast loss is determined based on the first output result. The first output result is then input into the initial second network model for computation to obtain a second output result. A second contrast loss is determined based on the second output result. The initial network model is jointly trained based on the first contrast loss and the second contrast loss to obtain the target network model. Therefore, by jointly training the initial first network model and the initial second network model, the large language model can learn the output format and logic of the initial first network model. At the same time, it can reduce the amount of data and the demand for computing resources, and improve the generation effect and accuracy of the large language model.

[0151] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0152] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0153] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0154] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A data processing method, characterized in that, The data processing method is applied to an initial network model, which includes an initial first network model and an initial second network model. The initial second network model includes a large language model. The method includes: The original training data is input into the initial first network model of the initial network model for computation to obtain the first output result; the first network model is a disease diagnosis mini-model, which is used to accept the patient's symptom information as input and output a probability distribution of symptom information; Determine the first contrast loss based on the first output result; The first output result is input into the initial second network model for calculation to obtain the second output result; The second contrast loss is determined based on the second output result; The initial network model is jointly trained using the first contrastive loss and the second contrastive loss to obtain the target network model.

2. The data processing method according to claim 1, characterized in that, Determining the first contrast loss based on the first output result includes: The first contrast loss is determined based on the first output result using the method shown in the following formula: , in, To minimize the first contrast loss, The first loss function of the initial first network model. It is the training dataset for the initial first network model. y is the output probability distribution of the initial first network model, x is the original training data, |.| is the absolute value operation, log is the logarithm operation, and M represents the initial first network model.

3. The data processing method according to claim 2, characterized in that, Determining the second contrast loss based on the second output result includes: Obtain the type information of the initial second network model; Determine the second distribution function corresponding to the initial second network model based on the type information; The second probability distribution corresponding to the second output result is determined by the second distribution function; Obtain the second probability label and the second loss function of the second probability distribution; The second contrastive loss is determined based on the second probability distribution, the second probability label, and the second loss function.

4. The data processing method according to claim 3, characterized in that, The step of jointly training the initial network model based on the first contrastive loss and the second contrastive loss to obtain the target network model includes: Obtain the balance coefficients for joint training; A first joint loss function is constructed based on the balance coefficient, the first loss function of the initial first network model, and the second loss function of the initial second network model; The joint contrast loss of the initial network model is determined based on the first contrast loss, the second contrast loss, and the first joint loss function; The weight parameters of the initial first network model and the initial second network model in the initial network model are adjusted based on the first training data of the initial network model and the joint contrastive loss, and the target network model is obtained after the joint contrastive loss converges.

5. The data processing method according to claim 4, characterized in that, The step of constructing the first joint loss function based on the balance coefficient, the first loss function of the initial first network model, and the second loss function of the initial second network model includes: The first joint loss function is constructed using the method shown in the following formula, based on the balance coefficient, the first loss function of the initial first network model, and the second loss function of the initial second network model: H= , Where H is the first joint loss function, For the first loss function, For the second loss function, For balance coefficient, This is a minimum value operation.

6. The data processing method according to any one of claims 1-5, characterized in that, After jointly training the initial network model based on the first contrastive loss and the second contrastive loss to obtain the target network model, the method further includes: Receive the target user's medical information; The disease information is input into the target network model for processing to obtain medical report information corresponding to the disease information.

7. The data processing method according to claim 6, characterized in that, After inputting the symptom information into the target network model for computation to obtain a medical report corresponding to the symptom information, the method further includes: Keyword extraction is performed on the medical report information to obtain a first keyword set; Semantic analysis is performed on each first keyword in the first keyword set to obtain the first semantic information corresponding to each first keyword; Determine the risk type indication value corresponding to the target user based on the first semantic information corresponding to each first keyword; If the risk type indicator value is higher than the preset risk type indicator value, then a risk alarm message is determined; Display the aforementioned risk warning information.

8. A data processing apparatus, characterized in that, The data processing device is applied to an initial network model, which includes an initial first network model and an initial second network model. The initial second network model includes a large language model. The data processing device includes: The data input unit is used to input the original training data into the initial first network model of the initial network model for computation to obtain the first output result; the first network model is a disease diagnosis mini-model, which is used to accept the patient's symptom information as input and output a probability distribution of symptom information; The first determining unit is configured to determine the first comparison loss based on the first output result; The computation unit is used to input the first output result into the initial second network model for computation to obtain the second output result; The second determining unit is used to determine the second contrast loss based on the second output result; The training unit is used to jointly train the initial network model based on the first contrastive loss and the second contrastive loss to obtain the target network model.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data processing method as described in any one of claims 1 to 7.