Data processing method and device, electronic equipment and storage medium

By introducing a network prediction model into the large model, the required number of neural network layers is dynamically determined, which solves the problem of resource waste when large models dealing with task inference, and achieves more efficient calculations and faster generation speed.

CN119692387APending Publication Date: 2025-03-25联想诺谛(北京)智能科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411515961.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When dealing with task inference, large models fail to generate hierarchically for user problems, resulting in waste of resources and inefficiency.

Method used

By entering the data of the pending problem into the network prediction model, the required number of neural network layers is dynamically determined, and the corresponding number of layers is called in the big model to generate answers, thereby reducing the computational effort and improving efficiency.

Benefits of technology

It realizes dynamic adjustment of neural network levels according to the difficulty of user problems, reduces the waste of computing resources, improves the generation speed and efficiency, and ensures the accuracy of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692387A_ABST
    Figure CN119692387A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: inputting data corresponding to a to-be-processed problem into a network prediction model, and determining that a first target value outputted by the network prediction model is a neural network layer number needed by a large model for processing the to-be-processed problem; inputting data corresponding to the to-be-processed question into the large model, and determining output of a neural network layer corresponding to a first target numerical value in the large model as a target answer corresponding to the to-be-processed question; wherein the large model comprises a plurality of neural network layers, each neural network layer can output an answer corresponding to the to-be-processed question, and the answers output by different neural network layers are different in accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art

[0002] In today's technological development, large models are widely used in various industries. However, due to the large number of parameters, the generation speed of large models is relatively slow. This requires a large amount of graphics processing unit (GPU) resources when large models are put into use. Summary of the invention

[0003] The present disclosure provides a data processing method, device, electronic device and storage medium.

[0004] According to a first aspect of the present disclosure, there is provided a data processing method, comprising:

[0005] Inputting data corresponding to the problem to be processed into the network prediction model, and determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed;

[0006] Inputting the data corresponding to the problem to be processed into the large model, determining the output of the neural network layer corresponding to the first target value in the large model as the target answer corresponding to the problem to be processed;

[0007] The large model includes multiple layers of neural network layers, each of which can output an answer corresponding to the problem to be processed, and the answers output by different neural network layers have different accuracy.

[0008] In the above scheme, the data corresponding to the problem to be processed is input into the network prediction model, and the first target value output by the network prediction model is determined to be the number of neural network layers required for the large model to process the problem to be processed, including:

[0009] Inputting the problem to be processed into at least one neural network layer included in the large model, and determining that the output of the last neural network layer in the at least one neural network layer is the hidden state vector corresponding to the problem to be processed;

[0010] Inputting the hidden state vector into the network prediction model, determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed;

[0011] Among them, the total number of layers of the at least one neural network layer is less than or equal to the number of layers of all neural network layers included in the large model.

[0012] In the above solution, the step of inputting the data corresponding to the problem to be processed into the large model includes:

[0013] The data corresponding to the problem to be processed is input into the neural network layer after the at least one neural network layer.

[0014] In the above solution, the method further includes training the large model, specifically including:

[0015] Input the sample questions into the large model, and obtain the prediction answers corresponding to each neural network layer in the large model;

[0016] Determine a loss function corresponding to each neural network layer in the large model based on the labeled answer corresponding to the sample question and the predicted answer corresponding to each neural network layer;

[0017] Weighting the loss function corresponding to each neural network layer to obtain the loss function of the large model;

[0018] Adjusting the parameters of each neural network layer based on the loss function of the large model;

[0019] Among them, the larger the identifier of the neural network layer, the larger the corresponding weight during weighting.

[0020] In the above solution, the method further includes training the network prediction model, specifically including:

[0021] Input the sample question into the trained large model, and obtain the prediction answer corresponding to each neural network layer in the trained large model;

[0022] Constructing a training data set based on the predicted answers corresponding to each neural network layer, the sample questions, and the identifier of each neural network layer;

[0023] The network prediction model is trained based on the training data set.

[0024] In the above solution, the step of constructing a training data set based on the predicted answer corresponding to each neural network layer, the sample question and the identifier of each neural network layer includes:

[0025] Determine at least one target predicted answer that can process the sample question among the predicted answers corresponding to each neural network layer;

[0026] Determine the minimum number of identifiers corresponding to the neural network layer in the at least one target prediction answer as the target number of layers corresponding to the sample question;

[0027] The training dataset is constructed with sample questions and the corresponding target layer number as data pairs.

[0028] In the above solution, the training of the network prediction model based on the training data set includes:

[0029] Inputting sample questions in the training data set into the network prediction model to obtain the number of prediction layers of the network prediction model;

[0030] Determining a loss function of the network prediction model based on the target number of layers and the predicted number of layers corresponding to the sample problem in the training data set;

[0031] Parameters of the network prediction model are adjusted based on the loss function of the network prediction model.

[0032] According to a second aspect of the present disclosure, there is provided a data processing device, comprising:

[0033] A layer number determination module, used for inputting data corresponding to the problem to be processed into the network prediction model, and determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed;

[0034] A processing module, used for inputting the data corresponding to the problem to be processed into the large model, and determining the output of the neural network layer corresponding to the first target value in the large model as the target answer corresponding to the problem to be processed;

[0035] The large model includes multiple layers of neural network layers, each of which can output an answer corresponding to the problem to be processed, and the answers output by different neural network layers have different accuracy.

[0036] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0037] at least one processor; and

[0038] a memory communicatively connected to the at least one processor; wherein,

[0039] 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 described in the present disclosure.

[0040] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the present disclosure.

[0041] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0043] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0044] Figure 1 A first optional flow chart of the data processing method provided by the embodiment of the present disclosure is shown;

[0045] Figure 2 A second optional flow chart of the data processing method provided by the embodiment of the present disclosure is shown;

[0046] Figure 3 A third optional flow chart of the data processing method provided by the embodiment of the present disclosure is shown;

[0047] Figure 4 The schematic diagram of the structure of a large model in the related art is shown;

[0048] Figure 5 A schematic diagram of the structure of a large model provided by an embodiment of the present disclosure is shown;

[0049] Figure 6 A fourth optional flow chart of the data processing method provided by the embodiment of the present disclosure is shown;

[0050] Figure 7 A schematic diagram of a training network prediction model provided by an embodiment of the present disclosure is shown;

[0051] Figure 8 An optional structural schematic diagram of a data processing device provided by an embodiment of the present disclosure is shown;

[0052] Fig. 9 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0053] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0054] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0055] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.

[0056] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as those commonly understood by those skilled in the art to which this disclosure belongs. The terms used in this disclosure are only for the purpose of describing the embodiments of this disclosure and are not intended to limit this disclosure.

[0057] It should be understood that in the various embodiments of the present disclosure, the size of the serial number of each implementation process does not mean 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 disclosure.

[0058] At present, when large models perform task reasoning, they do not generate hierarchical results for user questions. Regardless of the difficulty of the questions raised by the user, the large model needs to go through a complete reasoning process when generating answers, that is, it needs to go through the encoding of all neural network layers of the large model. This approach undoubtedly wastes a lot of resources. For example, for some simple questions, a simpler reasoning path can be used without using all the computing resources of the entire large model. However, the existing large model task reasoning methods cannot do this, resulting in low resource utilization and high costs in practical applications.

[0059] In response to the problems existing in the related technology, the embodiments of the present disclosure provide a data processing method. When calling a large model to perform a generation task, the method can dynamically determine the number of neural network layers that need to be called according to the questions provided by the user, thereby reducing the amount of calculation when generating the large model, while ensuring the generation quality and improving the generation speed.

[0060] Figure 1 A first optional flow chart of the data processing method provided by the embodiment of the present disclosure is shown, and will be explained according to each step.

[0061] Step S101, inputting data corresponding to the problem to be processed into the network prediction model, and determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed.

[0062] In some embodiments, the data corresponding to the problem to be processed includes the problem to be processed itself, that is, at least one of the text, video and image corresponding to the problem to be processed; the data corresponding to the problem to be processed may also include a feature vector obtained after mapping the problem to be processed to a feature space, such as converting the problem to be processed into an embedding vector through an encoder.

[0063] In some embodiments, the network prediction model is used to determine the number of neural network layers in the large model that participate in generating the answer to the problem to be processed based on the data corresponding to the problem to be processed, that is, to determine how many neural network layers the large model needs to use to generate the answer to the problem to be processed. The network prediction model can be set outside the large model or inside the large model.

[0064] In some embodiments, the large model includes multiple neural network layers, each of which can output an answer corresponding to the problem to be processed, and the accuracy of the answers output by different neural network layers is different, and the accuracy of the answers output by the later neural network layers is higher. In the embodiments of the present disclosure, multiple refers to greater than or equal to 2, for example, multiple refers to greater than or equal to 2 layers.

[0065] Step S102, inputting the data corresponding to the problem to be processed into the large model, determining the output of the neural network layer corresponding to the first target value in the large model, which is the target answer corresponding to the problem to be processed.

[0066] In some embodiments, in response to the data corresponding to the problem to be processed being the problem to be processed itself, the carrier implementing the data processing method (hereinafter referred to as the carrier) inputs the data corresponding to the problem to be processed into the large model, and determines that the output of the neural network layer corresponding to the first target value is the answer corresponding to the problem to be processed. Accordingly, the neural network layer starting from the first target value plus 1 does not need to process the data related to the problem to be processed, for example, the neural network layer marked as the first target value plus 1 does not need to process the data output by the neural network layer corresponding to the first target value.

[0067] Specifically, the network prediction model determines that the large model needs m neural network layers to process the problem to be processed based on the data corresponding to the problem to be processed, and then determines the output of the mth neural network layer in the large model as the target answer corresponding to the problem to be processed. Correspondingly, the neural network layers starting from the m+1th layer do not need to further process the data corresponding to the problem to be processed. The carrier can be a computer program, electronic circuit, database, mobile application, electronic device, cloud computing platform, distributed system, artificial intelligence framework, mathematical model, automation tool and microcontroller, etc., which can realize the software or hardware of the algorithm and method flow.

[0068] In other embodiments, if the data corresponding to the problem to be processed is a feature vector corresponding to the problem to be processed in response to the carrier, the encoder process in the large model can be omitted, and the feature vector can be directly input into the subsequent neural network layer to determine that the output of the neural network layer corresponding to the first target value is the target answer corresponding to the problem to be processed.

[0069] In this way, through the data processing method provided by the embodiment of the present disclosure, each neural network layer of the large model can output the answer corresponding to the problem to be processed, and the accuracy of the answers corresponding to different neural network layers and the required computing resources are different; in the process of generating the large model, firstly, the number of neural network layers required to process the problem to be processed is determined according to the data corresponding to the problem to be processed, and then the problem to be processed is input into the large model, and the output of the corresponding neural network layer is obtained, which is the answer corresponding to the problem to be processed. There is no need for all neural network layers in the large model to participate in the generation process of the answer to the problem to be processed, which can save computing power while ensuring the accuracy of the answer.

[0070] Figure 2 A second optional flow chart of the data processing method provided in the embodiment of the present disclosure is shown and will be explained according to each step.

[0071] Step S201, input the problem to be processed into the large model to obtain the hidden state vector.

[0072] In some embodiments, the carrier inputs the problem to be processed into at least one neural network layer included in the large model, and determines that the output of the last neural network layer in the at least one neural network layer is a hidden state vector. It should be noted that the number of the at least one neural network layer is less than the number of all neural network layers included in the large model; in order to avoid wasting computing resources, the at least one neural network layer can be one neural network layer, two neural network layers, etc. The specific number of layers is not limited in this disclosure and can be set according to actual needs.

[0073] Step S202, inputting the hidden state vector into the network prediction model, and determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed.

[0074] In some embodiments, the carrier inputs the hidden state vector into the network prediction model, and the first target value m output by the network prediction model is the number of neural network layers required by the large model to process the problem to be processed. For example, the network prediction model determines that the large model needs m neural network layers to process the problem to be processed based on the data corresponding to the problem to be processed, and then determines the output of the mth neural network layer in the large model as the target answer corresponding to the problem to be processed, starting from the m+1th neural network layer, without processing the data related to the problem to be processed.

[0075] Step S203, inputting the hidden state vector into the neural network layer after the at least one neural network layer, and determining the output of the neural network layer corresponding to the first target value in the large model as the target answer corresponding to the problem to be processed.

[0076] In some embodiments, if the last layer of the at least one neural network layer is the a-th neural network layer, the carrier inputs the hidden state vector into the a+1-th neural network layer, determines the output of the m-th neural network layer, and is the target answer corresponding to the problem to be processed.

[0077] In the disclosed embodiment, the input of the network prediction model is generated by the neural network layer in the large model. After determining the first target value, the hidden state vector can continue to be input into the subsequent neural network layer, so that during the generation process of the large model, the output of each neural network layer in the first m layers of the neural network layer can be utilized, thereby improving processing efficiency and avoiding waste of computing resources.

[0078] Figure 3 A third optional flow chart of the data processing method provided in the embodiment of the present disclosure is shown. Figure 4 The schematic diagram of the structure of a large model in the related art is shown; Figure 5 A schematic diagram of the structure of a large model provided by an embodiment of the present disclosure is shown.

[0079] Step S301, input the sample question into the large model, and obtain the prediction answer corresponding to each neural network layer in the large model.

[0080] Steps S301 to S304 involve the training method of the large model mentioned in steps S101 to S102, and steps S201 to S203.

[0081] Figure 4The schematic diagram of the structure of a large model in the related art is shown, for example, the LLM model, the embedding vector (embedding) of the input data (such as the problem to be processed or the sample problem involved in the embodiment of the present disclosure) is firstly subjected to RMS normalization (RMS Norm), and then input into the three self-attention heads (Q, K, Q) of the self-attention layer, the output of the self-attention layer is XORed with the embedding vector, and the result is subjected to RMS normalization and feed-forward network (Feed Forward), activation function (SwiGLU) and the data that has not been subjected to RMS normalization is XORed, and the result is subjected to RMS normalization, linear module and activation function, and the output corresponding to the input data is obtained (if the input data is a question, the output is the answer). Among them,

[0082] Depend on Figure 4 From the structure shown, we can see that the traditional large model has only one output. The output of the previous neural network layer will be used as the input of the next neural network layer, and the output of the last neural network layer will be used as the final output result of the large model.

[0083] Figure 5 As shown, the output of each neural network layer is obtained as the possible output data of the input data, and the output of the first neural network layer is input to the network prediction layer, and the network prediction layer outputs the first target value (such as X, Y, Z) to represent the number of neural network layers required to solve the input data. X, Y, and Z represent the identifier of the neural network layer, such as X represents the Xth neural network layer. The large model outputs the output data of each layer as the possible output data of the input data, such as Figure 5 The output of the Xth neural network layer and the output of the Yth neural network layer. It should be noted that due to space limitations, Figure 5 In the example, the output of the first neural network layer is used as the input of the network prediction layer. In practical applications, the output of the ath neural network layer can be selected as the input of the network prediction layer according to requirements; where a is an integer greater than or equal to 1.

[0084] Step S302, based on the labeled answer corresponding to the sample question and the predicted answer corresponding to each neural network layer, determine the loss function corresponding to each neural network layer in the large model.

[0085] In some embodiments, the carrier may determine the loss function of each neural network layer based on a scoring model, other trained large models, or semantic matching, in combination with the labeled answers corresponding to the question data and the predicted answers corresponding to each neural network layer. For example, the loss function of the b-th neural network layer is determined based on the labeled answers and the predicted answers corresponding to the b-th neural network layer.

[0086] Step S303, weighting the loss function corresponding to each neural network layer to obtain the loss function of the large model.

[0087] In some embodiments, the carrier may set the weight corresponding to each neural network layer. In order to make the answer output by the neural network layer with the later identifier more accurate, the larger the identifier of the neural network layer, the larger the corresponding weight when weighted. Optionally, the loss function of the large model may be calculated based on the following formula:

[0088] loss = sum(w n ×loss n ,……,w l ×loss l , ..., w1×loss1)

[0089] Where n is the total number of neural network layers in the large model, and l is the identifier of any neural network layer in the large model (1 <l<n);w l Represents the weight corresponding to the lth layer of the neural network, loss l Characterize the loss function of the lth neural network layer.

[0090] Step S304: adjust the parameters of each neural network layer based on the loss function of the large model.

[0091] In some embodiments, the carrier adjusts the parameters of each neural network layer based on the loss function of the large model so that the final loss function is less than a preset threshold, wherein the preset threshold can be set according to actual needs.

[0092] In this way, through the training method of the big model in the embodiment of the present invention, the structure of the big model is optimized, the output of each neural network layer is obtained, and the parameters in the big model are adjusted based on the weights of different neural network layers, so that when the generation task based on the big model is subsequently executed, answers with different accuracies can be obtained from different neural network layers.

[0093] Figure 6 A fourth optional flow chart of the data processing method provided by the embodiment of the present disclosure is shown. Figure 7 A schematic diagram of a training network prediction model provided by an embodiment of the present disclosure is shown. Figure 6 and Figure 7 Provide explanation.

[0094] Steps S601 to S603 involve the training method of the network prediction model mentioned in steps S101 to S102 and steps S201 to S203.

[0095] Step S601, input the sample question into the trained large model, and obtain the predicted answer corresponding to each neural network layer in the trained large model.

[0096] In some embodiments, the carrier trains the network prediction model based on the trained large model; specifically, the carrier inputs the sample question into the trained large model, and obtains the prediction answer corresponding to each neural network layer in the large model.

[0097] like Figure 7 As shown, the sample question is input into the trained large model, and the predicted answer of each neural network layer in the large model and the identification of the corresponding neural network layer are obtained respectively; such as the Xth neural network layer, the Yth neural network layer, and the Zth neural network layer.

[0098] Step S602: construct a training data set based on the predicted answers corresponding to each neural network layer, sample questions and the identifier of each neural network layer.

[0099] In some embodiments, the carrier determines, based on a scoring model or other model, at least one target prediction answer that can handle the sample question among the prediction answers corresponding to each neural network layer; determines the minimum number of identifiers of the corresponding neural network layer in the at least one target prediction answer as the target number of layers corresponding to the sample question; and constructs a training data set using sample questions and corresponding target numbers of layers as data pairs.

[0100] For example, the carrier determines that the prediction answers of the kth neural network layer to the nth neural network layer are all target prediction answers, then confirms that the smallest number from k to n is the target number of layers corresponding to the sample problem, that is, the neural network layer corresponding to the target number of layers can solve the sample problem, and constructs a training data set with the sample problem and the corresponding target number of layers as data pairs. The training data set includes <sample problem, neural network layer identifier>.

[0101] It should be noted that in order to better fit the generation process of the large model, when constructing the training data set, the sample problem can be input into the large model to obtain the hidden state vector output by at least one layer of the neural network layer, and the training data set can be constructed based on the hidden state vector and the neural network layer identifier.

[0102] Step S603: training the network prediction model based on the training data set.

[0103] In some embodiments, the carrier inputs sample problems in a training data set into the network prediction model to obtain the number of prediction layers of the network prediction model; determines the loss function of the network prediction model based on the target number of layers and the prediction number of layers corresponding to the sample problems in the training data set; and adjusts the parameters of the network prediction model based on the loss function of the network prediction model.

[0104] In this way, through the data processing method described in the embodiment of the present disclosure, a training data set is constructed based on the trained big model, and then the network prediction model is trained, providing a basis for the subsequent generation of a big model for dynamic hierarchical scheduling.

[0105] Figure 8 An optional structural schematic diagram of a data processing device provided in an embodiment of the present disclosure is shown, and will be described according to each part.

[0106] In some embodiments, the data processing device 700 includes a layer number determination module 701 and a processing module 702 .

[0107] The layer number determination module 701 is used to input the data corresponding to the problem to be processed into the network prediction model, and determine that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed;

[0108] The processing module 702 is used to input the data corresponding to the problem to be processed into the large model, and determine the output of the neural network layer corresponding to the first target value in the large model as the target answer corresponding to the problem to be processed;

[0109] The large model includes multiple layers of neural network layers, each of which can output an answer corresponding to the problem to be processed, and the answers output by different neural network layers have different accuracy.

[0110] The layer number determination module 701 is specifically used to input the problem to be processed into at least one neural network layer included in the large model, and determine that the output of the last neural network layer in the at least one neural network layer is the hidden state vector corresponding to the problem to be processed;

[0111] Inputting the hidden state vector into the network prediction model, determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed;

[0112] Among them, the total number of layers of the at least one neural network layer is less than or equal to the number of layers of all neural network layers included in the large model.

[0113] The layer number determination module 701 is specifically used to input the data corresponding to the problem to be processed into the neural network layer after the at least one neural network layer.

[0114] In some embodiments, the data processing device 700 further includes a training module 703. The training module 703 is used to train a large model and a network prediction model.

[0115] The training module 703 is specifically used to input sample questions into the large model, and obtain the prediction answers corresponding to each neural network layer in the large model;

[0116] Determine a loss function corresponding to each neural network layer in the large model based on the labeled answer corresponding to the sample question and the predicted answer corresponding to each neural network layer;

[0117] Weighting the loss function corresponding to each neural network layer to obtain the loss function of the large model;

[0118] Adjusting the parameters of each neural network layer based on the loss function of the large model;

[0119] Among them, the larger the identifier of the neural network layer, the larger the corresponding weight during weighting.

[0120] The training module 703 is specifically used to input the sample question into the trained large model, and obtain the prediction answer corresponding to each neural network layer in the trained large model;

[0121] Constructing a training data set based on the predicted answers corresponding to each neural network layer, the sample questions, and the identifier of each neural network layer;

[0122] The network prediction model is trained based on the training data set.

[0123] The training module 703 is specifically used to determine at least one target prediction answer that can process the sample question among the prediction answers corresponding to each neural network layer;

[0124] Determine the minimum number of identifiers corresponding to the neural network layer in the at least one target prediction answer as the target number of layers corresponding to the sample question;

[0125] The training dataset is constructed with sample questions and the corresponding target layer number as data pairs.

[0126] The training module 703 is specifically used to input sample problems in the training data set into the network prediction model to obtain the number of prediction layers of the network prediction model;

[0127] Determining a loss function of the network prediction model based on the target number of layers and the predicted number of layers corresponding to the sample problem in the training data set;

[0128] Parameters of the network prediction model are adjusted based on the loss function of the network prediction model.

[0129] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0130] Fig. 9 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0131] like Fig. 9 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0132] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0133] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).

[0134] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0135] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0136] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0137] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0138] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0139] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0140] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0141] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0142] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A data processing method, comprising: Inputting data corresponding to the problem to be processed into the network prediction model, and determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed; Inputting the data corresponding to the problem to be processed into the large model, determining the output of the neural network layer corresponding to the first target value in the large model as the target answer corresponding to the problem to be processed; The large model includes multiple layers of neural network layers, each of which can output an answer corresponding to the problem to be processed, and the answers output by different neural network layers have different accuracy.

2. The method according to claim 1, wherein the data corresponding to the problem to be processed is input into the network prediction model, and the first target value output by the network prediction model is determined as the number of neural network layers required for the large model to process the problem to be processed, comprising: Inputting the problem to be processed into at least one neural network layer included in the large model, and determining that the output of the last neural network layer in the at least one neural network layer is the hidden state vector corresponding to the problem to be processed; Inputting the hidden state vector into the network prediction model, determining that the first target value output by the network prediction model is the number of neural network layers required by the large model to process the problem to be processed; Among them, the total number of layers of the at least one neural network layer is less than or equal to the number of layers of all neural network layers included in the large model.

3. The method according to claim 2, wherein the inputting of the data corresponding to the problem to be processed into the large model comprises: The data corresponding to the problem to be processed is input into the neural network layer after the at least one neural network layer.

4. The method according to claim 1, further comprising training the large model, specifically comprising: Input the sample questions into the large model, and obtain the prediction answers corresponding to each neural network layer in the large model; Determine a loss function corresponding to each neural network layer in the large model based on the labeled answer corresponding to the sample question and the predicted answer corresponding to each neural network layer; Weighting the loss function corresponding to each neural network layer to obtain the loss function of the large model; Adjusting the parameters of each neural network layer based on the loss function of the large model; Among them, the larger the identifier of the neural network layer, the larger the corresponding weight during weighting.

5. The method according to claim 1, further comprising training the network prediction model, specifically comprising: Input the sample question into the trained large model, and obtain the predicted answer corresponding to each neural network layer in the trained large model; Constructing a training data set based on the predicted answers corresponding to each neural network layer, the sample questions, and the identifier of each neural network layer; The network prediction model is trained based on the training data set.

6. The method according to claim 5, wherein the step of constructing a training data set based on the predicted answer corresponding to each neural network layer, the sample question and the identifier of each neural network layer comprises: Determine at least one target prediction answer that can process the sample question among the prediction answers corresponding to each neural network layer; Determine the minimum number of identifiers corresponding to the neural network layer in the at least one target prediction answer as the target number of layers corresponding to the sample question; The training dataset is constructed with sample questions and the corresponding target layer number as data pairs.

7. The method according to claim 5, wherein training the network prediction model based on the training data set comprises: Inputting sample questions in the training data set into the network prediction model to obtain the number of prediction layers of the network prediction model; Determining a loss function of the network prediction model based on the target number of layers and the predicted number of layers corresponding to the sample problem in the training data set; Parameters of the network prediction model are adjusted based on the loss function of the network prediction model.

8. A data processing device, comprising: A layer number determination module, used for inputting data corresponding to the problem to be processed into the network prediction model, and determining that the first target value output by the network prediction model is the number of neural network layers required for the large model to process the problem to be processed; A processing module, used for inputting the data corresponding to the problem to be processed into the large model, and determining the output of the neural network layer corresponding to the first target value in the large model as the target answer corresponding to the problem to be processed; The large model includes multiple layers of neural network layers, each of which can output an answer corresponding to the problem to be processed, and the answers output by different neural network layers have different accuracy.

9. An electronic device, comprising: 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 7.

10. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.