Large model training method and device, electronic equipment, storage medium and product
By introducing a control network in large model training, combining the encoding vectors of problem text and the control conditions of the control network, the problem of difficult fine-tuning of large models in professional fields is solved, and more accurate information matching and stronger task understanding capabilities are achieved.
Patent Information
- Application Number
- CN202411821263.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
AI Technical Summary
Large models have difficulty in fine-tuning in the professional field, mainly due to the lack of professional corpus and the large model parameters that lead to overfitting, and it is difficult to accurately extract information, resulting in inaccurate matching with database information.
By obtaining the problem text, encoding is obtained with the first vector, determining the second vector of the control network as a control condition based on the first vector, and determining the output result in combination with the first vector and the second vector. This method introduces control networks for joint training based on the original large model, reducing the risk of overfitting and strengthening the model's understanding of specific tasks.
It solves the problem of difficult fine-tuning of large models in the professional field, maintains the core capabilities of the original model, reduces the risk of overfitting, and enhances the model's understanding of specific tasks.
Smart Images

Figure CN119761452A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a large model training method, device, electronic device, storage medium and product. Background Art
[0002] In the relevant big model training scheme, the application of existing intelligent question-answering technology in professional fields mainly includes two schools. One is to fine-tune the big model based on professional corpus to achieve end-to-end intelligent answering. The other is to extract keywords in the question based on the basic capabilities of the big model, and then query the answer in the relevant database based on the keywords.
[0003] However, in actual applications, professional corpora are usually scarce, and large models have many parameters, which are prone to overfitting. The extraction of key elements and database query methods that rely on the basic capabilities of large models rely more on the ability of large models to accurately extract key elements. However, in real applications, it is difficult for large models to accurately extract information, resulting in an inability to accurately match the information in the database. Therefore, the large models in related solutions have the problem of difficulty in fine-tuning in professional fields. Summary of the invention
[0004] The present disclosure provides a large model training method, device, electronic device, storage medium and product to solve the problem of difficulty in fine-tuning large models in professional fields in related technologies.
[0005] The first aspect of the present disclosure provides a large model training method, the method comprising:
[0006] Get the question text;
[0007] Encoding the question text to obtain a first vector corresponding to the question text;
[0008] Based on the first vector, determining a second vector of a control network, wherein the second vector is a control condition of the control network;
[0009] Based on the first vector and the second vector of the control network, an output result corresponding to the question text is determined.
[0010] In one embodiment, determining a second vector of a control network based on the first vector includes:
[0011] Based on the first vector, determining a classification result corresponding to the first vector using a target classification model;
[0012] Based on the classification result corresponding to the first vector, determining a thinking link corresponding to the classification result from a preset mapping relationship between the classification result and the thinking link, wherein the thinking link is used to indicate a solution idea corresponding to the problem text;
[0013] The thought link is encoded to obtain a second vector of the control network.
[0014] In one embodiment, before determining the classification result corresponding to the first vector using the target classification model based on the first vector, the method provided by the present disclosure further includes:
[0015] Obtain at least two first vectors corresponding to the question text;
[0016] Using the at least two first vectors corresponding to the question text as training data, and iteratively training the classification prediction model;
[0017] The prediction error of each iterative training is determined, and the training is terminated when the prediction error meets a preset condition to obtain the target classification model.
[0018] In one embodiment, determining an output result corresponding to the question text based on the first vector and the second vector of the control network includes:
[0019] Based on the first vector and a second vector of the control network, determining a first result corresponding to the first vector and a second result corresponding to the second vector;
[0020] The first result and the second result are added together to obtain an output result corresponding to the question text.
[0021] In one embodiment, determining a first result corresponding to the first vector and a second result corresponding to the second vector based on the first vector and the second vector of the control network includes:
[0022] Performing a first convolution process on the second vector of the control network to obtain a third vector;
[0023] Add the first vector and the third vector to obtain a fourth vector corresponding to the question text;
[0024] Based on the first vector and the fourth vector, a first result corresponding to the first vector and a second result corresponding to the second vector are determined.
[0025] In one embodiment, the control network includes a backbone network and at least two zero-convolutional layers.
[0026] The second aspect of the present disclosure provides a large model training device, which includes:
[0027] An acquisition unit, used to acquire question text;
[0028] An encoding unit, used for encoding the question text to obtain a first vector corresponding to the question text;
[0029] A first determining unit, configured to determine a second vector of a control network based on the first vector, wherein the second vector is a control condition of the control network;
[0030] The second determining unit is used to determine an output result corresponding to the question text based on the first vector and the second vector of the control network.
[0031] A third aspect of the present disclosure provides an electronic device, including:
[0032] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the embodiment of the first aspect of the present disclosure.
[0033] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.
[0034] The fifth aspect embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in the first aspect embodiment of the present disclosure when executed by a processor.
[0035] In summary, the present disclosure proposes a large model training method, which includes: obtaining a question text; encoding the question text to obtain a first vector corresponding to the question text; based on the first vector, determining a second vector of a control network, the second vector being a control condition of the control network; based on the first vector and the second vector of the control network, determining an output result corresponding to the question text.
[0036] According to the solution provided by the present disclosure, a question text is obtained; the question text is encoded to obtain a first vector corresponding to the question text; based on the first vector, a second vector of a control network is determined, and the second vector is a control condition of the control network; based on the first vector and the second vector of the control network, an output result corresponding to the question text is determined. By introducing a control network for joint training on the basis of the original large model, the core capabilities of the original model are maintained and the risk of overfitting when there is less training data, and the model's ability to understand a specific task can be strengthened with specific control conditions, thereby solving the problem of difficulty in fine-tuning large models in professional fields.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0039] Figure 1 A flowchart of a large model training method provided in an embodiment of the present disclosure;
[0040] Figure 2 A schematic flow chart of a method for determining a second vector provided in an embodiment of the present disclosure;
[0041] Figure 3 A flowchart of a method for determining a target classification model provided by an embodiment of the present disclosure;
[0042] Figure 4 A flowchart of a method for determining an output result provided by an embodiment of the present disclosure;
[0043] Figure 5 A flowchart of a method for large model training provided in an embodiment of the present disclosure;
[0044] Figure 6 A flowchart of a method for determining a first result and a second result provided in an embodiment of the present disclosure;
[0045] Figure 7 A flowchart of a large model training method provided for an application example of the present disclosure;
[0046] Figure 8 A schematic diagram of the structure of a large model training device provided in an embodiment of the present disclosure;
[0047] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0048] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0049] Large models: refers to deep learning models with a large number of parameters and complex structures. These models are designed to handle highly complex tasks such as natural language understanding, image recognition, and reinforcement learning.
[0050] Thinking chain: refers to the process of organizing thinking in a certain logical order when solving problems or making inferences. For example, for an elementary school travel application problem, the thinking chain is: "The core of travel problems lies in establishing the relationship between speed, time and distance"; and for equipment query problems, the thinking chain is: "To query the device, you must first extract the device name and manufacturer information, and then pay attention to what important information the user needs to query and output it in the specified format."
[0051] In the relevant big model training scheme, the application of existing intelligent question-answering technology in professional fields mainly includes two schools. One is to fine-tune the big model based on professional corpus to achieve end-to-end intelligent answering. The other is to extract keywords in the question based on the basic capabilities of the big model, and then query the answer in the relevant database based on the keywords.
[0052] However, in actual applications, professional corpora are usually scarce, and large models have many parameters, which are prone to overfitting. The extraction of key elements and database query methods that rely on the basic capabilities of large models rely more on the ability of large models to accurately extract key elements. However, in real applications, it is difficult for large models to accurately extract information, resulting in an inability to accurately match the information in the database. Therefore, the large models in related solutions have the problem of difficulty in fine-tuning in professional fields.
[0053] In order to address the defects in the related technology, the present invention obtains a question text; encodes the question text to obtain a first vector corresponding to the question text; based on the first vector, determines a second vector of a control network, the second vector being a control condition of the control network; based on the first vector and the second vector of the control network, determines an output result corresponding to the question text. By introducing a control network for joint training on the basis of the original large model, the core capabilities of the original model are maintained and the risk of overfitting when there is less training data. The model's ability to understand a specific task can be enhanced with specific control conditions, thereby solving the problem of difficulty in fine-tuning large models in professional fields.
[0054] The method proposed in the present disclosure is applied to large model training tasks, and has a wide range of application scenarios, and can be used in the training of all large models based on control networks.
[0055] The present disclosure is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] like Figure 1 As shown, Figure 1 A flow chart of a large model training method provided in an embodiment of the present disclosure. The large model training method provided in an embodiment of the present disclosure comprises the following steps:
[0057] Step 101, obtaining question text;
[0058] In one embodiment, the question text refers to text containing a question, and specifically may be a question text that is directly input, or may be a question text that is converted from a voice command or the like.
[0059] In one embodiment, the question text may be obtained from the user's input on the page, or may be obtained from a public question text dataset.
[0060] In one embodiment, there is no limit on the number of question texts to be obtained. Considering that the question texts are used for model training, as many question texts as possible are needed to improve the accuracy of model training.
[0061] In one embodiment, there is no limitation on the field to which the obtained question text belongs. For example, the obtained question text may be in the field of communications, the field of medical health, or the field of financial services.
[0062] Step 102, encoding the question text to obtain a first vector corresponding to the question text;
[0063] In one embodiment, the question text may be encoded using a word2vector encoding method to obtain a first vector corresponding to the question text.
[0064] In one embodiment, the question text may also be encoded using a TF-IDF encoding method to obtain a first vector corresponding to the question text.
[0065] Step 103, determining a second vector of a control network based on the first vector, where the second vector is a control condition of the control network;
[0066] In one embodiment, the control condition of the control network is used to determine the internal mechanism of the control network adjustment model.
[0067] In one embodiment, based on the first vector, the second vector of the control network may be determined by manual selection, or the second vector of the control network may be determined by a trained classifier.
[0068] In one embodiment, by determining the second vector of the control network based on the first vector, the internal mechanism of the model can be dynamically adjusted according to the characteristics of the input data, making the learning process more targeted and flexible. This design not only simplifies the processing flow of complex problems, but also enables the model to learn more effectively using limited training samples. Especially in the small sample learning scenario, because limited data resources are not enough to support comprehensive and in-depth training of large models, by introducing targeted control conditions, more efficient learning and more accurate output can be achieved with limited resources.
[0069] Step 104: Determine an output result corresponding to the question text based on the first vector and the second vector of the control network.
[0070] In one embodiment, by determining the output result corresponding to the question text based on the first vector and the second vector of the control network, the core capabilities of the original model can be maintained, the risk of overfitting in the case of less training data can be reduced, and the model's ability to understand the task can be enhanced with specific control conditions for a specific task, thereby solving the problem of difficulty in fine-tuning large models in professional fields.
[0071] In one embodiment, if Figure 2 As shown, based on the first vector, determining a second vector of the control network includes:
[0072] Step 201, based on the first vector, using a target classification model to determine a classification result corresponding to the first vector;
[0073] In one embodiment, the target classification model is a trained classification model.
[0074] In one embodiment, the target classification model can be a decision tree classification model, a support vector machine classification model, or a random forest classification model. The specific classification model is not limited in this application, and the decision tree classification model is taken as an example in the following text.
[0075] In one embodiment, by determining the classification result corresponding to the first vector based on the first vector using a target classification model, the category to which the question text belongs can be obtained. For example, if the question is: "Please recommend a router with a power less than 30W", the target classification model classifies the question as a device selection problem. For example, if the question is: "In the office area, the wireless network signal is unstable, there are coverage blind spots and slow speed problems, what should I do", the target classification model identifies the problem as a wireless network optimization problem, where device selection and wireless network optimization are the categories corresponding to the question text.
[0076] In one embodiment, the question text is tagged with a category label according to the classification result, such as a category label of 1 for information calculation, and a category label of 2 for channel coding calculation. For example, the category label of the question "How much information is obtained by tossing a fair coin?" is 1.
[0077] Step 202, based on the classification result corresponding to the first vector, determining a thinking link corresponding to the classification result from a preset mapping relationship between the classification result and the thinking link, wherein the thinking link is used to indicate a solution idea corresponding to the problem text;
[0078] In one embodiment, based on the classification result corresponding to the first vector, a thinking link corresponding to the classification result is determined from a preset mapping relationship table between the classification result and the thinking link.
[0079] In one embodiment, based on the classification result corresponding to the first vector, a thinking link corresponding to the classification result is determined from a preset mapping relationship curve between the classification result and the thinking link.
[0080] In one embodiment, based on the classification result corresponding to the first vector, a thinking link corresponding to the classification result is determined from a preset mapping relationship array between the classification result and the thinking link.
[0081] In one embodiment, if the question in the aforementioned step 201 is: "Please recommend a router with a power less than 30W", the target classification model classifies the problem as a device selection problem, and determines the thinking link corresponding to the device selection problem from the classification result and the preset mapping relationship of the thinking link: "First, determine whether the user specifies a specific manufacturer and model. If yes, provide relevant materials. Otherwise, further extract the device type, attributes and related constraints, and query the corresponding device database according to the attributes and constraints." For example, if the problem is: "In the office area, the wireless network signal is unstable, there are coverage blind spots and slow speed problems, what should I do", the target classification model identifies the problem as a wireless network optimization problem, and determines the thinking link corresponding to the wireless network optimization problem from the classification result and the preset mapping relationship of the thinking link: "First, understand the user's problem and analyze the needs, extract key data, perform intelligent analysis and diagnosis, and query the database to see if there are solutions to similar problems. According to the results, integrate the optimization solutions and output them."
[0082] Step 203, encoding the thought link to obtain a second vector of the control network.
[0083] In one embodiment, the same encoding method as in the aforementioned step 102 may be used to encode the thought link to obtain a second vector of the control network.
[0084] In one embodiment, a different encoding method from that in the aforementioned step 102 may be used to encode the thought link to obtain a second vector of the control network.
[0085] In one embodiment, if Figure 3 As shown, based on the first vector, before using the target classification model to determine the classification result corresponding to the first vector, the large model training method also includes:
[0086] Step 301, obtaining at least two first vectors corresponding to the question text;
[0087] In one embodiment, at least two first vectors corresponding to the question texts are obtained by encoding each of the at least two question texts. Preferably, in order to ensure the consistency of the training samples, the same encoding method is used to encode each of the at least two question texts.
[0088] Step 302, using the at least two first vectors corresponding to the question text as training data, and performing iterative training on the classification prediction model;
[0089] In one embodiment, the more first vectors corresponding to the question text, that is, the more training data for the classification model, the better the classification model training effect. However, it should be noted that too much training data will lead to a longer training time for the model.
[0090] Step 303, determining the prediction error of each iterative training, and terminating the training when the prediction error meets a preset condition to obtain the target classification model.
[0091] In one embodiment, the prediction error of each iterative training may be determined using a cross entropy loss function, and the mathematical expression for determining the prediction error is expressed as follows:
[0092]
[0093] Among them, y is the prediction result, is the true result, and L is the prediction error.
[0094] In one embodiment, terminating the training when the prediction error satisfies a preset condition may include terminating the training when the prediction error satisfies an error threshold, or may include terminating the training when the prediction error satisfies no improvement after multiple consecutive iterations.
[0095] In one embodiment, if Figure 4 As shown, based on the first vector and the second vector of the control network, determining an output result corresponding to the question text includes:
[0096] Step 401, based on the first vector and the second vector of the control network, determining a first result corresponding to the first vector and a second result corresponding to the second vector;
[0097] In one embodiment, if Figure 5 As shown, Figure 5 A flow chart of a method for training a large model provided in an embodiment of the present disclosure, wherein the first vector is x in the figure, the second vector is C in the figure, x is used as the input of the large model (frozen), and a first result corresponding to the first vector is obtained, and C is used as the input of the control network, and a second result corresponding to the second vector is obtained, wherein the large model (frozen) refers to freezing the parameters of the original large model to retain the original basic capabilities, and the control network includes the large model (copy) part and the zero convolution layer, which jointly participate in fine-tuning to learn the capabilities granted by the control conditions.
[0098] Step 402, summing the first result and the second result to obtain an output result corresponding to the question text.
[0099] In one embodiment, if Figure 5 As shown, the output result corresponding to the question text is Figure 5 y in a large model based on control networks.
[0100] In one embodiment, by summing the first result and the second result, an output result corresponding to the question text is obtained. The output result not only retains the basic capabilities of the original large model, but also helps the model better understand problems in professional fields through the control network. The control network and the original model have good generalization capabilities through internal fusion interaction and are not prone to overfitting.
[0101] In one embodiment, if Figure 6 As shown, based on the first vector and the second vector of the control network, determining a first result corresponding to the first vector and a second result corresponding to the second vector includes:
[0102] Step 601, performing a first convolution process on the second vector of the control network to obtain a third vector;
[0103] In one embodiment, the dimension of the third vector is the same as the dimension of the second vector.
[0104] In one embodiment, by performing a first convolution process on the second vector of the control network, the control network can be freed from being restricted by the original large model, and new exploration can be introduced.
[0105] Step 602, summing the first vector and the third vector to obtain a fourth vector corresponding to the question text;
[0106] In one embodiment, before the first vector and the third vector are summed to obtain a fourth vector corresponding to the question text, the first vector and the third vector need to be processed into vectors of the same dimension using a dimensionality reduction method.
[0107] Step 603: Determine a first result corresponding to the first vector and a second result corresponding to the second vector based on the first vector and the fourth vector.
[0108] In one embodiment, the second result is obtained by passing the copy of the fourth vector through the control network and then undergoing a second convolution process.
[0109] In one embodiment, based on the first vector and the fourth vector, a mean square error function may be used to determine a training error of the control network, and when the training error satisfies a preset condition, the training is terminated to obtain a first result corresponding to the first vector and a second result corresponding to the second vector, wherein a mathematical expression for determining the training error is expressed as follows:
[0110]
[0111] Where N is the total number of samples, i represents the i-th sample, and y i is the prediction result of the i-th sample, is the true result, and MSE is the training error.
[0112] In one embodiment, the control network includes a backbone network and at least two zero-convolutional layers.
[0113] In one embodiment, the backbone network of the control network is the same as the backbone network of the original large model.
[0114] In one embodiment, the zero convolution layer is a 1*1 convolution, a convolution layer whose weights and biases are initialized to zero, and a learning method thereof is to gradually increase from zero.
[0115] In one embodiment, since the backbone network of the control network is the same as the backbone network of the original large model, training on the trained parameters is likely to cause overfitting. Therefore, the degree of freedom of the control network can be increased by adding zero convolution layers, and new explorations can be introduced. Preferably, two zero convolution layers can be determined to be respectively before and after the backbone network, which conforms to symmetrical aesthetics.
[0116] In one embodiment, the control network includes a backbone network and at least two zero convolution layers, which can solve the problem of insufficient training data. Specifically, the control network copies the existing large model to inherit capabilities, but this also limits the freedom of the control network. The zero convolution layer is a newly added layer and is not limited to the original model, thereby maintaining a balance between remembering old knowledge and lassoing new knowledge.
[0117] In summary, the solution provided by the present disclosure is:
[0118] First, obtain the question text; encode the question text to obtain a first vector corresponding to the question text; based on the first vector, determine the second vector of the control network, the second vector is the control condition of the control network; based on the first vector and the second vector of the control network, determine the output result corresponding to the question text. By introducing the control network for joint training on the basis of the original large model, the core capabilities of the original model are maintained and the risk of overfitting when there is less training data. The model's ability to understand the task can be strengthened with specific control conditions for a specific task, solving the problem of difficulty in fine-tuning the large model in professional fields.
[0119] Secondly, the degree of freedom of the control network can be increased by adding zero convolution layers, introducing new explorations. Preferably, two zero convolution layers are determined to be before and after the backbone network, respectively, in line with symmetrical aesthetics.
[0120] The following is an application example to further illustrate the large model training method provided by the present disclosure:
[0121] like Figure 7 As shown, Figure 7 A flowchart of a large model training method provided for the application example of the present disclosure. The large model training method provided for the application example of the present disclosure includes the following steps:
[0122] Step 701, obtaining question text;
[0123] Step 702, encoding the question text to obtain a first vector corresponding to the question text;
[0124] Step 703, based on the first vector, using a target classification model to determine a classification result corresponding to the first vector;
[0125] In one embodiment, the large model training method further includes:
[0126] Obtain at least two first vectors corresponding to the question text;
[0127] Using the at least two first vectors corresponding to the question text as training data, and iteratively training the classification prediction model;
[0128] Determine the prediction error of each iterative training, and terminate the training when the prediction error meets a preset condition to obtain the target classification model;
[0129] Step 704, based on the classification result corresponding to the first vector, determining a thinking link corresponding to the classification result from a preset mapping relationship between the classification result and the thinking link, wherein the thinking link is used to indicate a solution idea corresponding to the problem text;
[0130] Step 705, encoding the thought link to obtain a second vector of the control network, where the second vector is a control condition of the control network;
[0131] Step 706, performing a first convolution process on the second vector of the control network to obtain a third vector;
[0132] Step 707, summing the first vector and the third vector to obtain a fourth vector corresponding to the question text;
[0133] Step 708, based on the first vector and the fourth vector, determine a first result corresponding to the first vector and a second result corresponding to the second vector;
[0134] Step 709: Add the first result and the second result to obtain an output result corresponding to the question text.
[0135] In one embodiment, the control network includes a backbone network and at least two zero-convolutional layers.
[0136] In order to implement the large model training method provided by the embodiment of the present disclosure, the embodiment of the present disclosure also provides a large model training device, such as Figure 8 shown. Figure 8 A schematic diagram of the structure of a large model training device provided in an embodiment of the present disclosure, the large model training device 800 includes:
[0137] An acquisition unit 801 is used to acquire a question text;
[0138] An encoding unit 802, configured to encode the question text to obtain a first vector corresponding to the question text;
[0139] A first determining unit 803 is used to determine a second vector of a control network based on the first vector, where the second vector is a control condition of the control network;
[0140] The second determining unit 804 is used to determine an output result corresponding to the question text based on the first vector and the second vector of the control network.
[0141] In one embodiment, the first determining unit 803 is specifically configured to:
[0142] Based on the first vector, determining a classification result corresponding to the first vector using a target classification model;
[0143] Based on the classification result corresponding to the first vector, determining a thinking link corresponding to the classification result from a preset mapping relationship between the classification result and the thinking link, wherein the thinking link is used to indicate a solution idea corresponding to the problem text;
[0144] The thought link is encoded to obtain a second vector of the control network.
[0145] In one embodiment, the large model training device 800 further includes a target classification model determination unit, which is used to:
[0146] Obtain at least two first vectors corresponding to the question text;
[0147] Using the at least two first vectors corresponding to the question text as training data, and iteratively training the classification prediction model;
[0148] The prediction error of each iterative training is determined, and the training is terminated when the prediction error meets a preset condition to obtain the target classification model.
[0149] In one embodiment, the second determining unit 804 is specifically configured to:
[0150] Based on the first vector and a second vector of the control network, determining a first result corresponding to the first vector and a second result corresponding to the second vector;
[0151] The first result and the second result are added together to obtain an output result corresponding to the question text.
[0152] In one embodiment, the second determining unit 804 is specifically configured to:
[0153] Performing a first convolution process on the second vector of the control network to obtain a third vector;
[0154] Add the first vector and the third vector to obtain a fourth vector corresponding to the question text;
[0155] Based on the first vector and the fourth vector, a first result corresponding to the first vector and a second result corresponding to the second vector are determined.
[0156] In one embodiment, the control network includes a backbone network and at least two zero-convolutional layers.
[0157] It should be noted that: the large model training device provided in the above embodiment only uses the division of the above program modules as an example when performing large model training. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the large model training device is divided into different program modules to complete all or part of the processing described above. In addition, the large model training device provided in the above embodiment and the large model training method embodiment provided in the embodiment of the present disclosure belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0158] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure is shown in FIG. Fig. 9 As shown, the electronic device 900 includes at least one processor 902; and a memory 901 that is communicatively connected to the at least one processor 902; wherein the memory 901 stores instructions that can be executed by the at least one processor 902, and the instructions are executed by the at least one processor 902 to implement the steps of the large model training method of the embodiment of the present disclosure.
[0159] Optionally, the electronic device may specifically be a large model training device in an embodiment of the present application, and the electronic device may implement the corresponding processes implemented by the large model training device in each method in the embodiment of the present application, which will not be described in detail here for the sake of brevity.
[0160] It is understood that the electronic device also includes a communication interface 903. The various components in the electronic device are coupled together through a bus system 904. It is understood that the bus system 904 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 904 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig. 9 Various buses are labeled as bus system 904.
[0161] It can be understood that the memory 901 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 901 described in the embodiment of the present invention is intended to include but is not limited to these and any other suitable types of memories.
[0162] The method disclosed in the above embodiment of the present disclosure can be applied to the processor 902, or implemented by the processor 902. The processor 902 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 902 or an instruction in the form of software. The above processor 902 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 902 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 901, and the processor 902 reads the information in the memory 901 and completes the steps of the above method in combination with its hardware.
[0163] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general purpose processors, controllers, MCUs, microprocessors, or other electronic components to execute the aforementioned method.
[0164] This public security embodiment also provides a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to implement the steps of the large model training method of the embodiment of the present invention when the computer is executed.
[0165] Optionally, the computer-readable storage medium can be applied to the large model training device in the embodiments of the present application, and the computer instructions enable the computer to execute the corresponding processes implemented by the large model training device in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0166] The embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, implements the steps of the large model training method provided in the embodiments of the present invention.
[0167] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0168] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0169] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0170] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
[0171] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0172] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A large model training method, characterized in that: include: Get the question text; Encoding the question text to obtain a first vector corresponding to the question text; Based on the first vector, determining a second vector of a control network, wherein the second vector is a control condition of the control network; Based on the first vector and the second vector of the control network, an output result corresponding to the question text is determined.
2. The method according to claim 1, characterized in that The determining, based on the first vector, a second vector of the control network includes: Based on the first vector, determining a classification result corresponding to the first vector using a target classification model; Based on the classification result corresponding to the first vector, determining a thinking link corresponding to the classification result from a preset mapping relationship between the classification result and the thinking link, wherein the thinking link is used to indicate a solution idea corresponding to the problem text; The thought link is encoded to obtain a second vector of the control network.
3. The method according to claim 2, characterized in that Before determining the classification result corresponding to the first vector by using the target classification model based on the first vector, the method further includes: Obtain at least two first vectors corresponding to the question text; Using the at least two first vectors corresponding to the question text as training data, and iteratively training the classification prediction model; The prediction error of each iterative training is determined, and the training is terminated when the prediction error meets a preset condition to obtain the target classification model.
4. The method according to claim 1, characterized in that The step of determining an output result corresponding to the question text based on the first vector and the second vector of the control network includes: Based on the first vector and a second vector of the control network, determining a first result corresponding to the first vector and a second result corresponding to the second vector; The first result and the second result are added together to obtain an output result corresponding to the question text.
5. The method according to claim 4, characterized in that The determining, based on the first vector and the second vector of the control network, a first result corresponding to the first vector and a second result corresponding to the second vector comprises: Performing a first convolution process on the second vector of the control network to obtain a third vector; Add the first vector and the third vector to obtain a fourth vector corresponding to the question text; Based on the first vector and the fourth vector, a first result corresponding to the first vector and a second result corresponding to the second vector are determined.
6. The method according to claim 1, characterized in that The control network includes a backbone network and at least two zero-convolutional layers.
7. A large model training device, characterized in that: include: An acquisition unit, used to acquire question text; An encoding unit, used for encoding the question text to obtain a first vector corresponding to the question text; A first determining unit, configured to determine a second vector of a control network based on the first vector, wherein the second vector is a control condition of the control network; The second determining unit is used to determine an output result corresponding to the question text based on the first vector and the second vector of the control network.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, wherein the computer program implements the method according to any one of claims 1 to 6 when executed by a processor.