Task execution method and device, training method and device, electronic equipment and storage medium

By recycling the network layer hyperparameters of the large model, the high cost and high storage occupation of the large model are solved, and the high-precision model output is achieved while reducing the storage and computing resource requirements, improving the deployment efficiency and adaptability of the model.

CN120471142APending Publication Date: 2025-08-12BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510725374.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The inference cost of large models during the application of scenarios is high, the training conditions are harsh, the deployment is difficult, and the storage space occupies a large amount, which affects the efficiency and cost of computing equipment.

Method used

By reading the hyperparameters of the target network layer from the storage unit, using the operator unit to perform the first computing subtask in the calculation task, multiplexing the hyperparameters to perform the second computing subtask, and cyclically multiplexing the hyperparameters of the target network layer to simulate the data depth processing process of multiple network layers, reducing the storage space occupancy of the storage unit, and improving the convenience of model deployment and the efficiency of computing equipment.

Benefits of technology

While reducing storage space usage and computing costs, maintaining the accuracy of model output results, improving the generalization capability and deployment convenience of the model, and reducing inference costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471142A_ABST
    Figure CN120471142A_ABST
Patent Text Reader

Abstract

The invention provides a task execution method and device, a training method and device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence, in particular to the technical field of deep learning and the technical field of large models. The task execution method comprises the following steps: reading hyper-parameters of a target network layer in a target model from a storage unit; executing a first calculation sub-task in the calculation task by using an operator unit according to the hyper-parameter of the target network layer to obtain a first feature output by the target network layer; under the condition that the hyper-parameters of the target network layer are reused, the operator unit is used for executing a second calculation sub-task in the calculation task based on the first feature read from the storage unit, a second feature output by the target network layer is obtained, and the first calculation sub-task and the second calculation sub-task are sub-tasks sequentially executed in the calculation task; and determining a model output result of the target model by using the operator unit based on the second feature read from the storage unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of deep learning technology and large model technology. More specifically, the present disclosure provides a task execution method, training method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of artificial intelligence technology, various types of data such as text, images, and audio can be processed based on large models, so that the output results of large models can meet the actual needs of various scenarios. Summary of the Invention

[0003] The present disclosure provides a task execution method, a training method, an apparatus, an electronic device, and a storage medium.

[0004] According to one aspect of the present disclosure, a task execution method is provided, including: reading hyperparameters of a target network layer in a target model from a storage unit; using an operator unit to execute a first computing subtask in a computing task according to the hyperparameters of the target network layer to obtain a first feature output by the target network layer; while reusing the hyperparameters of the target network layer, using the operator unit to execute a second computing subtask in the computing task based on the first feature read from the storage unit to obtain a second feature output by the target network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; and based on the second feature read from the storage unit, using the operator unit to determine a model output result of the target model.

[0005] According to another aspect of the present disclosure, a model training method is provided, including: reading hyperparameters of an initial network layer in an initial model from a storage unit; using an operator unit to perform a first computing subtask in a computing task according to the hyperparameters of the initial network layer to obtain a first initial feature output by the initial network layer; while reusing the hyperparameters of the initial network layer, using an operator unit to perform a second computing subtask in the computing task based on the first initial feature read from the storage unit to obtain a second initial feature output by the initial network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; based on the second initial feature read from the storage unit, using the operator unit to determine a model output result of the initial model; based on the model output result of the initial model, using the operator unit to determine target loss information; and based on the target loss information, using the operator unit to train the initial model to obtain a trained target model.

[0006] According to another aspect of the present disclosure, a task execution device is provided, including: a storage unit; an operator unit, configured to: read hyperparameters of a target network layer in a target model from the storage unit; execute a first computing subtask in a computing task according to the hyperparameters of the target network layer to obtain a first feature output by the target network layer; execute a second computing subtask in the computing task based on the first feature read from the storage unit while reusing the hyperparameters of the target network layer to obtain a second feature output by the target network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; and determine a model output result of the target model based on the second feature read from the storage unit.

[0007] According to another aspect of the present disclosure, a model training device is provided, comprising: a storage unit; an operator unit, configured to: read hyperparameters of an initial network layer in an initial model from the storage unit; execute a first computing subtask in a computing task according to the hyperparameters of the initial network layer to obtain a first initial feature output by the initial network layer; execute a second computing subtask in the computing task based on the first initial feature read from the storage unit while reusing the hyperparameters of the initial network layer to obtain a second initial feature output by the initial network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; determine a model output result of the initial model based on the second initial feature read from the storage unit; determine target loss information according to the model output result of the initial model; and train the initial model according to the target loss information to obtain a trained target model.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: 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 to enable the at least one processor to execute a task execution method or a model training method.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute a task execution method or a model training method.

[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements a task execution method or a model training method when executed by a processor.

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

[0012] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0013] Figure 1 Schematically illustrates an exemplary system architecture to which the task execution method and apparatus according to an embodiment of the present disclosure may be applied;

[0014] Figure 2 The following schematically shows a flowchart of a task execution method according to an embodiment of the present disclosure;

[0015] Figure 3 Schematically shows a principle diagram of a target model according to an embodiment of the present disclosure;

[0016] Figure 4 The following schematically shows a principle diagram of determining a target model according to an embodiment of the present disclosure;

[0017] Figure 5 The flowchart of the training method of the model according to the embodiment of the present disclosure is schematically shown;

[0018] Figure 6 A schematic diagram illustrating a method for training a model according to an embodiment of the present disclosure is shown;

[0019] Figure 7 A block diagram of a task execution device according to an embodiment of the present disclosure is schematically shown;

[0020] Figure 8 A block diagram schematically illustrates a training device for a model according to an embodiment of the present disclosure; and

[0021] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement the task execution method and model training method of the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0022] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0023] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.

[0024] In the field of deep learning, large models are widely used in various application scenarios, including intelligent search, smart customer service, intelligent file editing, and intelligent device control. However, these applications often incur high inference costs, demanding training conditions, and difficult deployment. Large models can include large language models (LLMs), large image models, and large audio models.

[0025] Embodiments of the present disclosure provide a task execution method, training method, device, electronic device, and storage medium. The task execution method includes: reading hyperparameters of a target network layer in a target model from a storage unit; using an operator unit to execute a first computing subtask in a computing task based on the hyperparameters of the target network layer to obtain a first feature output by the target network layer; while reusing the hyperparameters of the target network layer, using an operator unit to execute a second computing subtask in a computing task based on the first feature read from the storage unit to obtain a second feature output by the target network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; and based on the second feature read from the storage unit, using the operator unit to determine a model output result of the target model.

[0026] According to an embodiment of the present disclosure, an operator unit is used to execute a first computing subtask in a computing task according to the hyperparameters of a target network layer read from a storage unit to obtain a first feature of the target network layer output, and the operator unit is used to execute a second computing subtask in the computing task according to the first feature while reusing the hyperparameters of the target network layer. In this way, the operator unit can execute the computing task by reusing the hyperparameters of the target network layer stored in the storage unit, so that the operator unit can execute multiple subtasks in the computing task by cyclically reusing the hyperparameters of the target network layer read from the storage unit, thereby simulating the data depth processing process of multiple network layers by reusing the hyperparameters of the target network layer to execute multiple subtasks in sequence, and further, the data depth processing process of a large model with a large parameter scale can be realized under the condition that the storage unit stores a small amount of hyperparameters, so that the accuracy of the model output result of the target model is similar to the accuracy of the output result of the large model with a large model parameter scale, thereby reducing the storage space occupied by the storage unit, improving the convenience of target model deployment, reducing the inference cost and deployment cost of the target model, and improving the generalization ability of the target model for data processing.

[0027] Figure 1 An exemplary system architecture to which the task execution method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.

[0028] It should be noted that Figure 1The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure. This does not mean that the embodiments of the present disclosure cannot be applied to other devices, systems, environments, or scenarios. For example, in another embodiment, an exemplary system architecture to which the task execution method and apparatus may be applied may include a terminal device, but the terminal device may implement the task execution method and apparatus provided by the embodiments of the present disclosure without interacting with a server.

[0029] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0030] Users can use terminal devices 101 , 102 , and 103 to interact with server 105 via network 104 to receive or send messages, etc. For example, terminal device 101 can send a request for text processing to server 105 via network 102 .

[0031] Various communication client applications may be installed on the terminal devices 101 , 102 , and 103 , such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only).

[0032] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0033] Server 105 may be a server that provides various services, such as a background management server (for example only) that supports content browsed by users using terminal devices 101, 102, and 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal device.

[0034] Server 105 may be a cloud server, also known as a cloud computing server or cloud host. This server is a host product within a cloud computing service system that addresses the management difficulties and limited scalability of traditional physical hosts and VPS (Virtual Private Server) services. The server may also be a distributed system server or a server integrated with blockchain technology.

[0035] It should be noted that the task execution method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the task execution device provided in the embodiment of the present disclosure can generally be set in the server 105. The task execution method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the task execution device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. For example, the method provided in the present disclosure can be executed by the computing unit of the hardware device in the server 105 or the server node. Based on the task execution method provided in the present disclosure, the multi-head self-attention mechanism can be converted into a group query attention mechanism with lower computing resources and storage resources.

[0036] Alternatively, the task execution method provided in the embodiment of the present disclosure may also be executed by the terminal device 101, 102 or 103. Accordingly, the task execution apparatus provided in the embodiment of the present disclosure may also be provided in the terminal device 101, 102 or 103.

[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0038] Figure 2 The flowchart of the task execution method according to the embodiment of the present disclosure is schematically shown.

[0039] like Figure 2 As shown, the task execution method includes operations S210 to S240.

[0040] In operation S210 , hyperparameters of a target network layer in a target model are read from a storage unit.

[0041] In operation S220, an operator unit is used to perform a first computing subtask in the computing task according to the hyperparameters of the target network layer to obtain a first feature output by the target network layer.

[0042] In operation S230, while reusing the hyperparameters of the target network layer, the operator unit is used to perform the second computing subtask in the computing task based on the first feature read from the storage unit to obtain the second feature output by the target network layer.

[0043] In operation S240 , a model output result of the target model is determined using an operator unit based on the second feature read from the storage unit.

[0044] According to an embodiment of the present disclosure, an operator unit may be a component in a computing module for performing computing operations. The computing module may include at least one of a central processing unit (CPU), a graphics processing unit (GPU), and an artificial intelligence computing unit. The artificial intelligence computing unit may include at least one of a neural processing unit (NPU), a tensor processing unit (TPU), and a Kunlun core. The operator unit may, for example, be a CUDA core, a stream processor unit, or the like in a graphics processing unit (GPU). It should be noted that the embodiments of the present disclosure do not limit the specific type of operator unit, as long as it can perform data computing tasks.

[0045] According to an embodiment of the present disclosure, the storage unit may be a device or component for storing data. For example, the storage unit may be any type of component for caching data, such as an on-chip cache, an off-chip cache, etc. The embodiment of the present disclosure does not limit the specific type of the storage unit.

[0046] According to embodiments of the present disclosure, a target model can be an algorithmic model constructed based on a deep learning algorithm. For example, the target model can be constructed based on any type of deep learning algorithm, such as an attention network algorithm or a convolutional neural network algorithm. The target model can include one or more target network layers, and the hyperparameters of the target network layers can be understood as the model parameters of the target network layers. For example, the hyperparameters of the target network layers can be weight parameters w, bias parameters b, etc. The hyperparameters of each network layer in the target model are stored in a storage unit. Any type of data to be processed, such as text, images, audio, or graph data, is input into the target model. The operator unit can perform computational tasks on the data to be processed based on the hyperparameters of one or more target network layers in the target model received from the storage unit, thereby processing the data to be processed using the target model and obtaining a model output result of the target model. The model output result can include data processing results for any type of data to be processed, such as text, images, audio, or graph data. For example, the model output result can be output text, rendered images, edited audio data, etc.

[0047] According to an embodiment of the present disclosure, a computing task may include multiple subtasks executed in a preset order, and a first computing subtask and a second computing subtask may be two subtasks executed sequentially in the computing task. It should be noted that, among the multiple subtasks executed sequentially, the preceding subtask may be the first computing subtask, and the subsequent subtask executed in an adjacent round to the preceding subtask may be the second computing subtask.

[0048] According to an embodiment of the present disclosure, the first feature and the second feature may be hidden features output by the target network layer. By using an operator unit to obtain the first feature by executing the first computing subtask according to the hyperparameters of the target network layer, and by using the operator unit to sequentially execute the second computing subtask under the condition of reusing the hyperparameters of the target network layer read from the storage unit, it is possible to execute multiple subtasks in the computing task by cyclically reusing the hyperparameters of the target network layer of the storage unit, thereby enabling the storage unit to only store the hyperparameters of the target network layer, and to use the computing unit to reuse the same hyperparameters to perform deep data processing on the data to be processed of the input target model, thereby avoiding the large storage space occupied by the storage unit due to the execution of multiple different subtasks by the respective hyperparameters of multiple different network layers, and reducing the storage space occupied by the storage unit. This enables the storage unit to simulate the data deep processing process of a large model with massive model parameters under the condition of a small scale of storing hyperparameters. The accuracy of the output result of the target model determined based on the second feature can be close to the accuracy of the output result obtained by a large model with multiple network layer structures processing the data to be processed. This can avoid the loss of algorithm performance of the target model and reduce the computational overhead and storage space occupancy of the target model's data processing process while reducing the hyperparameter scale of the target model, thereby reducing the computing performance and storage space requirements of the computing device on which the model is deployed, thereby improving the convenience and generalization ability of the target model in being deployed on the computing device, and reducing the inference cost and deployment cost of the target model.

[0049] According to an embodiment of the present disclosure, the first feature and the second feature may include text features, the text features are determined based on the initial text, and the model output result includes output text corresponding to the initial text.

[0050] According to embodiments of the present disclosure, the initial text may be the data to be processed that is input into the target model. The initial text may include any type of text, such as a question text or a requirement text. The output text may be feedback text output by the target model to satisfy the requirement intent represented by the initial text. For example, the output text may be the answer text corresponding to the question text.

[0051] It should be noted that the data to be processed for computing tasks can be stored in a storage unit related to the operator unit, and the storage space of the data to be processed and the hyperparameters of the target model can be the same or different, and the embodiments of the present disclosure do not limit this.

[0052] According to the method provided by the embodiments of the present disclosure, the hyperparameters of the target network layer in the storage unit are reused by the operator unit to execute multiple subtasks in sequence to process the initial text. This can enable the target model to achieve deep semantic understanding of the initial text while reducing the parameter scale of the hyperparameters, and thus realize the text semantic understanding ability and task execution control ability of the large language model with massive model parameters for the initial text, so that the accuracy of the output text of the target model can be close to the accuracy of the text output by the large language model, reducing the storage space occupied by the computing device, and also reducing the deployment cost of the computing device to deploy the large language model, thereby improving the generalization ability and adaptability of the target model for different application scenarios.

[0053] According to an embodiment of the present disclosure, the first feature or the second feature may also include hidden features representing other modal data. For example, the first feature or the second feature may be an image feature representing image modal data, an audio feature representing audio modal data, etc. The computing task may be an image processing task, an audio processing task, or other processing task for any modal data.

[0054] Alternatively, the first feature or the second feature may also include a multimodal fusion feature that represents fused multimodal data. For example, the first feature or the second feature may also be a graphic-text fusion feature that fuses image semantics and text semantics. The embodiments of the present disclosure do not limit the modality type of the data represented by the first feature or the second feature.

[0055] According to an embodiment of the present disclosure, the storage unit includes an on-chip storage unit, and the hyperparameters, the first feature, and the second feature of the target network layer are stored in the on-chip storage unit.

[0056] According to an embodiment of the present disclosure, the on-chip storage unit can be in the same processor as the operator unit. The hyperparameters, first features, and second features of the target network layer are stored in the on-chip storage unit, and the hyperparameters, first features, or second features of the target network layer can be quickly read to improve the execution efficiency of the operator unit in performing subtasks and improve the computational efficiency of the target model. At the same time, by storing only the hyperparameters of the target network model in the on-chip storage unit, the storage space occupied by off-chip storage units such as video memory components and memory components can be reduced, thereby improving the overall computational efficiency of the computing device deploying the target model.

[0057] In one example, the operator unit of a graphics processing unit (GPU) may be a CUDA core, and the on-chip storage unit may be an L1 cache component or an L2 cache component of the graphics processing unit (GPU). The CUDA core may sequentially execute multiple subtasks of a computing task by frequently and cyclically calling hyperparameters of the same target network layer from the L1 cache component or the L2 cache component, thereby improving the computing efficiency of the graphics processing unit (GPU) and reducing computing resource usage.

[0058] In one example, the storage unit may also be an off-chip storage unit, for example, the storage unit may be an off-chip memory unit of a graphics processor. When the target model includes multiple target network layers, the hyperparameters of the target network layers may be stored in the off-chip memory unit, so that the operator unit of the graphics processor can read the hyperparameters of the target network layers from the off-chip memory unit multiple times during the execution of a subtask, so as to perform the subtask. The first feature or the second feature may be stored in the off-chip memory unit so that the operator unit can sequentially execute multiple subtasks of the computing task.

[0059] In one example, the storage unit can also be an on-chip storage unit and an off-chip storage unit. Since the hyperparameters of the target network layer need to be called cyclically by the operator unit to execute subtasks, the hyperparameters of the target network layer can be stored in the on-chip storage unit so that the operator unit can quickly and frequently reuse the hyperparameters of the target network layer to execute multiple subtasks of the computing task. The network layer features of the target network layer output obtained by executing the subtasks can be stored in the off-chip storage unit so as to utilize the larger storage space of the off-chip storage unit to accommodate network layer features of larger dimensions. It should be understood that the network layer features may include a first feature and a second feature.

[0060] According to an embodiment of the present disclosure, the target network layer includes at least one of an attention layer and a feedforward layer, and the first feature or the second feature includes at least one of an attention feature and a feedforward feature.

[0061] According to embodiments of the present disclosure, the target model can be constructed based on an attention network algorithm, and the attention layer can include an attention layer constructed based on an attention mechanism. For example, the attention layer can include a multi-head attention layer constructed based on a multi-head self-attention mechanism (MHA). The feedforward layer can be a network layer constructed based on a feedforward neural network (FFNN). It should be understood that the attention features can be features output by the attention layer.

[0062] In one example, the target network layer can be an attention layer, so that the operator unit can be used to perform multi-level deep attention fusion on the data to be processed by reusing the hyperparameters of the attention layer, so that the final attention features obtained by the computing task by executing multiple subtasks in sequence can more fully learn the semantic attribute features such as image semantic features and text semantic features of the data to be processed, so as to improve the output accuracy of the model output results and improve the degree of match between the model output results and the demand intentions of the target object.

[0063] Figure 3 The figure schematically shows a principle diagram of a target model according to an embodiment of the present disclosure.

[0064] like Figure 3 As shown, the target model 310 may include a first target network layer 311 and a second target network layer 312. The first target network layer 311 and the second target network layer 312 may be a multi-head attention layer and a feedforward layer, respectively. The initial text features of the requirement text are stored in a storage unit, and the operator unit is used to process the initial text features of the requirement text according to the hyperparameters of the first target network layer 311 to execute the first computing subtask in the first computing task and obtain the first text features output by the first target network layer 311. When the preset number of subtasks to be executed sequentially included in the first computing task is i=2, the hyperparameters of the first target network layer 311 in the storage unit are reused, and the operator unit is used to read the first text features and the hyperparameters of the first target network layer 311 from the storage unit to execute the second computing subtask and obtain the second text features output by the first target network layer 311.

[0065] In contrast, the trained basic large model 320 may include a first basic network layer 321, a second basic network layer 322, a third basic network layer 323, and a fourth basic network layer 324. When the operator unit reuses the hyperparameters of the first target network layer 311 to sequentially execute the two subtasks in the first computing task, it can be used to simulate the first basic network layer 321 and the second basic network layer 322 in the basic large model 320, and deeply process the feature data of the initial text features of the demand text, thereby avoiding the defect of directly deleting the basic network layer of the basic large model 320 to determine the target model, resulting in a decrease in computing power performance, reducing the storage space occupied by the hyperparameters stored in the storage unit, and reducing the computing resource occupation of the computing device.

[0066] like Figure 3 As shown, the second text features output by the first target network layer 311 are stored in a storage unit, and the operator unit is used to process the second text features based on the hyperparameters of the second target network layer 312 to execute the first computation subtask in the second computation task, thereby obtaining the first text features output by the second target network layer 312. When the preset number of sequentially executed subtasks included in the second computation task is i=2, the hyperparameters of the second target network layer 312 in the storage unit are reused, and the operator unit is used to read the first text features output by the second target network layer 312 and the hyperparameters of the second target network layer 312 from the storage unit to execute the second computation subtask in the second computation task, thereby obtaining the second text features output by the second target network layer 312. The operator unit is used to process the second text features output by the second target network layer 312 based on an activation function to obtain a target feedback image. The target feedback image can be an image that satisfies the desired intent represented by the desired text.

[0067] When the operator unit reuses the hyperparameters of the second target network layer 312 in the storage unit to execute the two subtasks in the second computing task in sequence, it can be used to simulate the third basic network layer 323 and the fourth basic network layer 324 in the basic large model 320, avoiding the defect of directly deleting the basic network layer of the basic large model 320 to determine the target model and causing the degradation of computing power performance, thereby generating a target feedback image with an image quality similar to that of the basic feedback image, thereby reducing the storage space occupied by the hyperparameters of the target model in the storage unit, and improving the deployment efficiency and inference efficiency of the target model in the computing device.

[0068] According to an embodiment of the present disclosure, a computing task includes a preset number of subtasks that are executed sequentially. An operator unit can use the hyperparameters of a preset number of target network layers to execute the preset number of subtasks, thereby reusing the hyperparameters of the preset number of target network layers to implement a large model's deep data processing process, thereby improving the accuracy of the model's output results.

[0069] In one example, the preset number is determined based on the configuration operation of the target object. The target object can set the preset number of hyperparameters of at least one target network layer in the target model to be reused through the configuration operation, thereby realizing the dynamic configuration of the deep processing requirements of the processed data by the operator unit according to the needs of the target object, so as to obtain the model output results that meet the actual needs of the target object, so that the target model can adapt to the various output accuracy requirements and output delay requirements of the target object, and at the same time flexibly set the number of times the storage unit can reuse the hyperparameters of the same target network layer, thereby improving the storage space utilization efficiency of the storage unit, avoiding the communication resource occupation caused by multiple transmissions of hyperparameters of different network layers to the computing unit, reducing the storage space occupation caused by multiple writings of hyperparameters of different network layers in the storage unit, and improving the flexibility and generalization ability of the target model deployment and reasoning process.

[0070] According to an embodiment of the present disclosure, the preset number is determined based on requirement information, and the requirement information includes at least one of delay requirement information and accuracy requirement information.

[0071] According to an embodiment of the present disclosure, the delay requirement information characterizes the output delay requirement of the target model for outputting the model output result. The output delay requirement can represent the delay length of the target object for the target model to process the data to be processed and output the model output result, and the delay length can be directly proportional to the preset number. In the case where the delay length corresponding to the output delay requirement is long, the preset number can be set to be larger, so as to facilitate deep data processing of the processed data based on the larger preset number to improve the accuracy of the model output result of the target model. In the case where the delay length corresponding to the output delay requirement is short, the preset number can be set to be smaller to control the number of executions of the subtasks of the computing task to be less, so that the target model can perform a faster data processing process on the processed data, so as to improve the rate at which the target model obtains the model output result, reduce the delay of the target model in the reasoning process, and meet the actual needs of low-latency scenarios.

[0072] According to embodiments of the present disclosure, accuracy requirement information represents the output accuracy requirement of the model output. The output accuracy requirement may indicate the quality of the model output of the target model. The output accuracy requirement may indicate the degree of match between the model output of the target model and the actual requirements of the target object.

[0073] For example, if the target model processes text data, the output accuracy requirement can represent text accuracy attributes such as accuracy, relevance, fluency, and coherence of the target model's output text. Accuracy indicates whether the output text contains correct information and conforms to factual, logical, and semantic requirements. Relevance assesses whether the output text is closely related to the input prompt or context. Fluency and coherence indicate whether the output text is fluent, natural, and logically coherent.

[0074] For example, if the target model processes images as the data to be processed, the output accuracy requirement can represent image accuracy attributes such as class accuracy, detection accuracy, or generation quality of the target model's output images. Class accuracy indicates the proportion of images whose categories the target model correctly identifies. Detection accuracy indicates the accuracy of the target model's ability to accurately identify the location, category, and size of objects in an image. Generation quality indicates the visual quality of the target model's output images and how closely they match the target object's intended purpose.

[0075] It should be noted that the model output results output by the target model and the data to be processed by the target model can be data of any modality, and the embodiments of the present disclosure are not limited to this.

[0076] According to an embodiment of the present disclosure, the latency requirement information and the accuracy requirement information can be determined based on the configuration operation of the target object. For example, the configuration operation can be performed on the interactive interface based on the target object to set the latency requirement information and the accuracy requirement information, so as to flexibly control the reasoning process of the target model, flexibly control the reasoning accuracy and reasoning delay of the target model, and realize the actual needs of diversified artificial intelligence application scenarios.

[0077] According to an embodiment of the present disclosure, a target model is determined based on the following operations: using an operator unit to determine a similarity index of at least one specified basic network layer in a trained basic large model; and based on the similarity index, determining N basic network layers that meet the similarity conditions from the trained basic large model; and determining the target model based on the M basic network layers that meet the similarity conditions.

[0078] According to an embodiment of the present disclosure, the trained basic large model may be a generative large model having a specific function. The trained basic large model may include multiple basic network layers. The other basic network layers may be other basic network layers in the trained basic large model except for the specified basic network layer. The similarity index characterizes the hyperparameter similarity between the specified basic network layer and the other basic network layers in the trained basic large model. The similarity index between the specified basic network layer and the other basic network layers can be determined by calculating the similarity between the hyperparameters of the specified basic network layer and the hyperparameters of the other basic network layers.

[0079] According to an embodiment of the present disclosure, N>M≥1, and N and M are integers. For example, one basic network layer may be determined as a target network layer from 10 basic network layers that meet similarity conditions to construct a target model.

[0080] In one example, determining a target model based on M basic network layers that meet similarity conditions can include deleting NM of the N basic network layers that meet the similarity conditions in the basic large model, thereby retaining M basic network layers that meet the similarity conditions to obtain the target model.

[0081] According to an embodiment of the present disclosure, the similarity condition can indicate that the similarity of the hyperparameters between the N basic network layers is greater than or equal to a preset similarity threshold. The N basic network layers that meet the similarity condition can indicate that they have similar or similar task execution capabilities, for example, they can have similar learning capabilities for feature information such as text features and image features. Therefore, by determining M basic network layers that meet the similarity condition from the N basic network layers that meet the similarity condition as the target network layer to construct the target model, the target model can achieve specific functions such as text response and image generation of the trained basic large model under the condition of reducing the parameter scale of the hyperparameters. At the same time, by setting a preset number of subtasks in the computing task, the hyperparameters of the target network layer can be reused to execute a preset number of subtasks, so as to achieve the accuracy between the model output result of the target model and the basic output result of the trained basic large model by reusing the hyperparameters of the same target network layer to execute multiple subtasks, thereby reducing the deployment cost and inference cost of the target model, improving the inference efficiency and accuracy of the target model deployed on the computing device, and meeting the actual intelligent model output requirements of diverse scenarios.

[0082] Figure 4 The schematic diagram shows a principle diagram of determining a target model according to an embodiment of the present disclosure.

[0083] like Figure 4As shown, the trained basic large model 410 includes a first basic network layer 411, a second basic network layer 412, a third basic network layer 413, and a fourth basic network layer 414. By calculating the similarity between the hyperparameters of the second basic network layer 412 and the hyperparameters of the other basic network layers of the trained basic large model 410, a similarity index for the second basic network layer 412 is obtained. The similarity index for the second basic network layer 412 can indicate that the similarity condition between the first basic network layer 411 and the second basic network layer 412 is satisfied. By calculating the similarity between the hyperparameters of the third basic network layer 413 and the hyperparameters of the other basic network layers of the trained basic large model 410, a similarity index for the third basic network layer 413 can indicate that the similarity condition between the third basic network layer 413 and the fourth basic network layer 414 is satisfied. By deleting the second basic network layer 412 and the third basic network layer 413 from the trained basic large model 410, a target model 420 can be obtained. Operator units are used to reuse the hyperparameters of the first basic network layer 411 to execute the two subtasks executed in sequence in the first computing task, thereby simulating the deep data processing process of the first basic network layer 411 and the second basic network layer 412 of the trained basic large model 410. Operator units are also used to reuse the hyperparameters of the fourth basic network layer 414 to execute the two subtasks executed in sequence in the second computing task, thereby simulating the deep data processing process of the third basic network layer 413 and the fourth basic network layer 414 of the trained basic large model 410. In this way, the generation accuracy between the model output results and the basic output results obtained by the target model 420 and the trained basic large model 410 when processing the data to be processed can be similar, ensuring that the target model 420 can have a generation effect similar to that of the trained basic large model 410 with a larger number of parameters, reducing the usage of computing resources, and reducing the inference cost and deployment difficulty of the target model 420. At the same time, by setting a preset number of subtasks to be executed sequentially in each computing task, the target model 420 can perform a deeper data processing process on the processed data compared to the trained basic large model 410, so as to flexibly adapt to the target object's requirements for the accuracy and latency of the model output results, and improve the deployment flexibility and generalization ability of the target model 420.

[0084] Figure 5 The flowchart of the model training method according to the embodiment of the present disclosure is schematically shown.

[0085] like Figure 5 As shown, the training method of the model includes operations S510 to S560.

[0086] In operation S510 , hyperparameters of an initial network layer in an initial model are read from a storage unit.

[0087] In operation S520, an operator unit is used to perform a first computing subtask in the computing task according to the hyperparameters of the initial network layer to obtain a first initial feature output by the initial network layer.

[0088] In operation S530, while reusing the hyperparameters of the initial network layer, the operator unit is used to perform the second computing subtask in the computing task based on the first initial features read from the storage unit to obtain the second initial features output by the initial network layer.

[0089] In operation S540 , a model output result of the initial model is determined using an operator unit based on the second initial feature read from the storage unit.

[0090] In operation S550 , target loss information is determined using an operator unit according to a model output result of the initial model.

[0091] In operation S560 , the initial model is trained using the operator unit according to the target loss information to obtain a trained target model.

[0092] According to an embodiment of the present disclosure, the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task. The operator unit can execute multiple subtasks in sequence under the condition of reusing the hyperparameters of the initial network layer to reduce the storage space occupied by the hyperparameters in the storage unit.

[0093] According to an embodiment of the present disclosure, the storage unit may be a device or component for storing data. For example, the storage unit may be any type of component for caching data, such as an on-chip cache, an off-chip cache, etc. The embodiment of the present disclosure does not limit the specific type of the storage unit.

[0094] According to an embodiment of the present disclosure, the initial model can be an algorithm model constructed based on a deep learning algorithm. For example, the initial model can be constructed based on any type of deep learning algorithm, such as an attention network algorithm, a convolutional neural network algorithm, etc. The initial model can include one or more initial network layers, and the hyperparameters of the initial network layer can be understood as the model parameters of the initial network layer. For example, the hyperparameters of the initial network layer can be weight parameters w, bias parameters b, etc. Any type of data to be processed, such as text, image, audio, and graph data, can be input into the initial model. The operator unit can perform computing tasks on the data to be processed based on the hyperparameters of one or more initial network layers in the initial model to enable the initial model to process the data to be processed and obtain the model output result of the initial model. The model output result may include data processing results for any type of data to be processed, such as text, image, audio, and graph data. For example, the model output result may be output text, rendered image, edited audio data, etc.

[0095] It should be noted that the technical terms involved in the training method of the model provided in the embodiment of the present disclosure, including but not limited to the first initial feature, the second initial feature, the operator unit, the storage unit, etc., have the same attributes as the technical terms involved in the task execution method provided in the embodiment of the present disclosure, including but not limited to the first feature, the second feature, the operator unit, the storage unit, etc., and the embodiments of the present disclosure will not be repeated here.

[0096] According to an embodiment of the present disclosure, the first initial feature and the second initial feature can be hidden features output by the initial network layer. The first initial feature is obtained by using an operator unit to perform the first computing subtask according to the hyperparameters of the initial network layer, and under the condition of reusing the hyperparameters of the initial network layer read from the storage unit, the operator unit is used to sequentially execute the second computing subtask that is executed in sequence in the computing task. This can be achieved by cyclically reusing the hyperparameters of the initial network layer to execute multiple subtasks in the computing task. Therefore, under the condition that the storage unit only stores the hyperparameters of the initial network layer, the hyperparameters can be cyclically read to achieve data deep processing of the sample data to be processed input into the initial model, thereby reducing the storage space occupied by the storage unit. The storage unit is enabled to simulate the data deep processing process of a large model with massive model parameters under the condition of a small storage scale of hyperparameters, so that the accuracy of the output result of the initial model determined based on the second initial feature can be close to the accuracy of the large model processing the sample data to be processed, avoiding the loss of algorithm performance of the initial model, and reducing the computational overhead and storage space occupied by the initial model when executing the data processing process under the condition of reducing the hyperparameter scale of the initial model. Using the operator unit to train the initial model based on the target loss information determined by the model output results of the initial model can reduce the storage space of the storage unit occupied during the model training process, and facilitate the operator unit to quickly call the hyperparameters of the initial model to perform subtasks, thereby reducing the training cost of the computing device for training the initial model and reducing the computing resource usage during the model training process.

[0097] The target model determined by the model training method provided by the embodiment of the present disclosure can be applied to the task execution method provided by the embodiment of the present disclosure. For example, the hyperparameters of the target model determined by the model training method provided by the embodiment of the present disclosure can be stored in a storage unit, and the task execution method provided by the embodiment of the present disclosure can be used to perform a computing task based on the hyperparameters of the target network layer of the target model using an operator unit to process data of any modality and obtain a model output result.

[0098] According to an embodiment of the present disclosure, the initial model is determined based on the following operations: using an operator unit to determine the similarity index of at least one specified basic network layer in the basic large model; determining K basic network layers that meet the similarity conditions from the basic large model based on the similarity index; and determining the initial model based on P basic network layers that meet the similarity conditions.

[0099] According to an embodiment of the present disclosure, the basic large model may include any type of deep learning model with large-scale hyperparameters, for example, the basic large model may include a trained large language model. Alternatively, the basic large model may also be a large model for processing any modal data such as audio data, image data, graph data, etc. The basic large model may include multiple basic network layers, and the similarity index characterizes the hyperparameter similarity between the specified basic network layer and other basic network layers in the basic large model. It should be understood that other network layers may include other basic network layers in the basic large model except the specified basic network layer. The similarity index between the specified basic network layer and the other basic network layers can be determined by calculating the similarity between the hyperparameters of the specified basic network layer and the hyperparameters of the other basic network layers.

[0100] According to an embodiment of the present disclosure, K>P≥1, and K and P are integers. For example, one basic network layer may be determined as an initial network layer from 10 basic network layers that meet similarity conditions to construct an initial model.

[0101] In one example, determining the initial model based on P basic network layers that meet the similarity conditions can include deleting KP of the K basic network layers that meet the similarity conditions in the basic large model, thereby retaining P basic network layers that meet the similarity conditions to obtain the initial model.

[0102] According to an embodiment of the present disclosure, the similarity condition can indicate that the similarity of the hyperparameters between the K basic network layers is greater than or equal to a preset similarity threshold. The K basic network layers that meet the similarity condition can indicate that they have similar or similar task execution capabilities, for example, they can have similar learning capabilities for feature information such as text features and image features. Therefore, P basic network layers that meet the similarity condition are determined from the K basic network layers that meet the similarity condition as the initial network layers to construct the initial model. This can enable the initial model to reduce the parameter scale of the hyperparameters and achieve specific functions such as text response and image generation of the basic large model. At the same time, by setting a preset number of subtasks in the calculation task, the hyperparameters of the initial network layer can be reused to execute a preset number of subtasks, so as to achieve the use of operator units to reuse the hyperparameters of the same initial network layer to execute multiple subtasks to achieve a model output result of the initial model that is closer in accuracy to the basic output result of the trained basic large model. Thus, a smaller number of P basic network layers are determined from the K basic network layers that meet the similarity condition to construct the initial model. It can reduce the storage space occupied by the storage unit for storing the hyperparameters of the initial model, and based on the operator unit, reuse the hyperparameters of the initial network layer to execute multiple subtasks in sequence to achieve the deep data processing performance of the basic large model. In addition, it can achieve the target model trained based on the target loss information. With a small number of hyperparameters, it can achieve data processing performance and model output result generation accuracy similar to that of the large model, thereby improving training efficiency and meeting the actual intelligent model output needs of diverse scenarios.

[0103] According to an embodiment of the present disclosure, using an operator unit to determine the similarity index of at least one specified basic network layer in the basic big model includes: using the operator unit to remove at least one specified basic network layer in the basic big model to obtain a processed basic big model; based on preset training data, using the operator unit to perform basic computing tasks based on the hyperparameters of the updated basic big model to obtain the basic output result of the processed basic big model; using the operator unit to process the basic output result of the processed basic big model, and the label corresponding to the training data to obtain the basic output accuracy of the processed basic big model; and based on the basic output accuracy of the processed basic big model, using the operator unit to determine the similarity index of the specified basic network layer.

[0104] According to embodiments of the present disclosure, the preset training data can be sample data to be processed in any modality, such as sample text, sample images, or sample audio. Operator units are used to process the training data based on the processed hyperparameters of the basic large model to obtain a basic output result output by the basic large model. This basic output result can be a feedback result corresponding to the demand intent represented by the training data.

[0105] In one example, when the training data is a sample text to be processed, the basic output result of the processed basic large model can be an answer text corresponding to the sample text to be processed.

[0106] In one example, when the training data is a sample text to be processed, the basic output result of the processed basic large model can be a generated image corresponding to the requirement intent of the sample text to be processed.

[0107] In one example, processing the processed basic output results of the basic large model and the labels corresponding to the training data using the operator unit may include processing the processed basic output results and the labels of the basic large model based on a loss function to obtain basic loss information, and determining the basic output accuracy based on difference information represented by the basic loss information.

[0108] According to an embodiment of the present disclosure, determining the similarity index of a specified basic network layer using an operator unit based on the basic output accuracy of the processed basic large model may include querying associated similarity index information based on the basic output accuracy.

[0109] In one example, the label can be the basic output result obtained by processing the training data with the unprocessed basic large model. The similarity index can be understood as the accuracy similarity of the generated result between the basic output result of the processed basic large model output after deleting the specified basic network layer and the basic output result of the original basic large model. In the case of a higher accuracy similarity, the hyperparameter similarity represented by the similarity index is larger, which can be understood as the absence of the deleted specified basic network layer, which has a smaller impact on the accuracy of the basic output result of the basic large model. Correspondingly, in the case of a lower accuracy similarity, the hyperparameter similarity represented by the similarity index is smaller, which can be understood as the absence of the deleted specified basic network layer, which has a greater impact on the accuracy of the basic output result of the basic large model. The basic output accuracy can be directly proportional to the hyperparameter similarity represented by the similarity index. In this way, K basic network layers that meet the similarity conditions can be determined by determining the similarity index of the specified basic network layer, and the initial model can be constructed by determining a smaller number of P basic network layers that meet the similarity conditions from the K basic network layers. This allows the initial model to achieve output results with similar accuracy to the basic output results of the basic large model under the condition that the operator unit reuses the hyperparameters of the initial network layer. This can reduce the construction complexity of the initial model, reduce the difficulty of constructing knowledge transfer from the basic large model to the initial model, and improve the training efficiency of the initial model.

[0110] According to an embodiment of the present disclosure, determining the target loss information using an operator unit based on the model output result of the initial model may include: based on the knowledge distillation mechanism, using the operator unit to process the model output result of the initial model and the basic output result of the basic large model to obtain output loss information; using the operator unit to process at least one initial feature and the basic task calculation result to obtain intermediate loss information; and using the operator unit to fuse the output loss information and the intermediate loss information to obtain the target loss information.

[0111] According to an embodiment of the present disclosure, the basic task calculation result is determined by executing the basic calculation task using an operator unit based on the hyperparameters of the basic network layer in the basic large model, and the basic output result is determined based on the basic task calculation result. The basic task calculation result can be the hidden features output by the basic network layer, and the basic output result can be the generated result output by the basic large model.

[0112] In one example, the basic output result and the model output result of the initial model can be obtained by the basic large model and the initial model respectively processing the same batch of training data.

[0113] According to an embodiment of the present disclosure, based on the knowledge distillation mechanism, the operator unit is used to process the model output results of the initial model and the basic output results of the basic large model, which can include taking the basic output results as pseudo-labels, and using the operator unit to process the basic output results and the model output results of the initial model based on the loss function. The obtained output loss information can represent the difference in generation accuracy between the basic output results and the model output results of the initial model.

[0114] According to an embodiment of the present disclosure, the initial feature includes at least one of a first initial feature and a second initial feature. The initial feature can represent the hidden feature of the initial model obtained by the operator unit based on the hyperparameters of the initial network layer when executing the completed subtask. Using the operator unit to process at least one initial feature and the basic task calculation result can include using the basic calculation result output by the basic network layer as a pseudo-label, and using the operator unit to process the basic calculation result and the corresponding initial feature based on the loss function. The intermediate loss information obtained can represent the hidden feature of the initial network layer obtained by the initial network layer when executing each subtask, and the feature difference between the hidden feature output by the basic network layer corresponding to the subtask in the basic large model. Therefore, the difference between the initial feature of the subtask executed by the operator unit based on the hyperparameters of the initial network layer and the basic calculation result of the basic calculation task executed by the operator unit based on the hyperparameters of the basic network layer can be represented based on the intermediate loss information. In this way, by fusing the target loss information with the output loss information to adjust the hyperparameters of the initial model during the training process, the operator unit can utilize the hyperparameters of the trained target network layer to simulate the data processing capabilities and semantic understanding capabilities of each basic network layer by executing each subtask in turn. The target model can generate data processing capabilities and model output result accuracy close to the algorithm performance of a large model with a larger parameter scale based on the smaller hyperparameter scale stored in the storage unit, thereby improving the inference efficiency of the target model in the inference stage and reducing the deployment cost of the target model.

[0115] Figure 6 The figure schematically shows a principle diagram of a model training method according to an embodiment of the present disclosure.

[0116] like Figure 6 As shown. The initial model 610 may include a first initial network layer 611 and a second initial network layer 612, and the basic large model 620 includes a first basic network layer 621, a second basic network layer 6222, a third basic network layer 6233, and a fourth basic network layer 624. The basic large model 620 is used as a teacher model, and the initial model 610 is used as a student model. The operator unit processes the training data based on the hyperparameters of the first basic network layer 621 to obtain the first basic task calculation result output by the first basic network layer 621. The operator unit processes the first basic task calculation result based on the hyperparameters of the second basic network layer 622 to obtain the second basic task calculation result output by the second basic network layer 622. The operator unit processes the second basic task calculation result based on the hyperparameters of the third basic network layer 623 to obtain the third basic task calculation result output by the third basic network layer 623. The operator unit processes the third basic task calculation result based on the hyperparameters of the fourth basic network layer 624 to obtain the basic output result output by the fourth basic network layer 624.

[0117] The operator unit is used to perform the first computation subtask of the first computation task based on the hyperparameters of the first initial network layer 611 and the training data, thereby obtaining the first initial features output by the first initial network layer 611. The hyperparameters of the first initial network layer 611 are reused, and the operator unit is used to perform the second computation subtask of the first computation task based on the hyperparameters of the first initial network layer 611 and the first initial features output by the first initial network layer 611, thereby obtaining the second initial features output by the first initial network layer 611. The operator unit is used to perform the first computation subtask of the second computation task based on the hyperparameters of the second initial network layer 612 and the second initial features output by the first initial network layer 611, thereby obtaining the first initial features output by the second initial network layer 612. The hyperparameters of the second initial network layer 612 are reused, and the operator unit is used to perform the second computation subtask of the second computation task based on the hyperparameters of the second initial network layer 612 and the first initial features output by the second initial network layer 612, thereby obtaining the model output result output by the first initial network layer 611.

[0118] The operator unit is used to process the first initial features output by the first initial network layer 611 and the first basic task calculation results output by the first basic network layer 621 based on the loss function to obtain first intermediate loss information. The operator unit is used to process the second initial features output by the first initial network layer 611 and the second basic task calculation results output by the second basic network layer 622 based on the loss function to obtain second intermediate loss information. The operator unit is used to process the first initial features output by the second initial network layer 612 and the third basic task calculation results output by the third basic network layer 623 based on the loss function to obtain third intermediate loss information. The operator unit is used to process the model output results output by the second initial network layer 612 and the basic output results output by the fourth basic network layer 624 based on the loss function to obtain output loss information.

[0119] The operator unit performs a weighted average of the first intermediate loss information, the second intermediate loss information, the third intermediate loss information, and the output loss information to obtain the target loss information. Based on the target loss information, the hyperparameters of the initial model 610 are adjusted until the target loss information converges or reaches a preset adjustment round condition, thereby obtaining a trained target model.

[0120] According to the embodiments of the present disclosure, by fusing the output loss information and the intermediate loss information based on the knowledge distillation mechanism, the target loss can characterize the difference in algorithmic performance between each network layer of the initial model and the basic network layer, so that the parameters of the initial model can be adjusted based on the target loss information to achieve the transfer of knowledge of the basic large model to the target model with a smaller number of parameters, thereby assisting the target model to learn quickly and avoiding the algorithmic performance loss caused by deleting the hyperparameters of some network layers in the basic large model, so as to improve the training effect.

[0121] In one example, the loss function may be a mean squared error (MSE) function.

[0122] In one example, the preset number of subtasks executed sequentially for each computing task in the model training method can be determined based on the configuration operation, so that the trained target model can adapt to the model performance corresponding to the application scenario of the target object.

[0123] In one example, the preset number of subtasks executed sequentially in each computing task in the model training method can be determined based on a random strategy. For example, in each training operation round, the preset number of subtasks executed sequentially in each computing task is a random number determined based on the random strategy. This allows the initial network layer to randomly adapt to the degree of reuse of hyperparameters for the initial network layer in each training operation round, so that the trained target model can output model output results with higher accuracy in application scenarios with different output delay requirements, thereby improving the generalization ability of the target model.

[0124] Figure 7 The block diagram of a task execution device according to an embodiment of the present disclosure is schematically shown.

[0125] like Figure 7 As shown, the task execution device 700 includes: a storage unit 710 and an operator unit 720.

[0126] The operator unit 720 is configured to: read the hyperparameters of the target network layer in the target model from the storage unit; execute the first computing subtask in the computing task according to the hyperparameters of the target network layer to obtain the first feature of the output of the target network layer; while reusing the hyperparameters of the target network layer, execute the second computing subtask in the computing task based on the first feature read from the storage unit to obtain the second feature of the output of the target network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; and determine the model output result of the target model based on the second feature read from the storage unit.

[0127] According to an embodiment of the present disclosure, the storage unit includes an on-chip storage unit, and the hyperparameters, the first feature, and the second feature of the target network layer are stored in the on-chip storage unit.

[0128] According to an embodiment of the present disclosure, a computing task includes a preset number of subtasks executed in sequence, and the preset number is determined based on demand information, and the demand information includes at least one of the following: delay requirement information, which characterizes the output delay requirement of the target model output model output result; accuracy requirement information, which characterizes the output accuracy requirement of the model output result.

[0129] According to an embodiment of the present disclosure, the operator unit is further configured to perform the following operations to determine the target model: using the operator unit to determine the similarity index of at least one specified basic network layer in the trained basic large model, wherein the similarity index characterizes the hyperparameter similarity between the specified basic network layer and other basic network layers in the trained basic large model; based on the similarity index, determine N basic network layers that meet the similarity conditions from the trained basic large model; and determine the target model based on the M basic network layers that meet the similarity conditions, wherein N>M≥1, and N and M are integers.

[0130] According to an embodiment of the present disclosure, the target network layer includes at least one of an attention layer and a feedforward layer, and the first feature or the second feature includes at least one of an attention feature and a feedforward feature.

[0131] According to an embodiment of the present disclosure, the first feature and the second feature include text features, the text features are determined based on the initial text, and the model output result includes output text corresponding to the initial text.

[0132] Figure 8 A block diagram of a model training device according to an embodiment of the present disclosure is schematically shown.

[0133] like Figure 8 As shown, the model training device 800 includes: a storage unit 810 and an operator unit 820.

[0134] The operator unit 820 is configured to: read the hyperparameters of the initial network layer in the initial model from the storage unit; execute the first computing subtask in the computing task according to the hyperparameters of the initial network layer to obtain the first initial features output by the initial network layer; execute the second computing subtask in the computing task based on the first initial features read from the storage unit while reusing the hyperparameters of the initial network layer to obtain the second initial features output by the initial network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; determine the model output result of the initial model based on the second initial features read from the storage unit; determine the target loss information according to the model output result of the initial model; and train the initial model according to the target loss information to obtain the trained target model.

[0135] According to an embodiment of the present disclosure, the operator unit is further configured to perform the following operations to determine the initial model: using the operator unit to determine the similarity index of at least one specified basic network layer in the basic large model, wherein the similarity index characterizes the hyperparameter similarity between the specified basic network layer and other basic network layers in the basic large model; based on the similarity index, determine K basic network layers that meet the similarity conditions from the basic large model; and determine the initial model based on P basic network layers that meet the similarity conditions, wherein K>P≥1, and K and P are integers.

[0136] According to an embodiment of the present disclosure, the operator unit is further configured to perform the following operations to determine the similarity index of at least one specified basic network layer in the basic big model: remove at least one specified basic network layer in the basic big model to obtain a processed basic big model; based on preset training data, perform basic computing tasks based on the hyperparameters of the updated basic big model to obtain the basic output results of the processed basic big model; process the basic output results of the processed basic big model and the labels corresponding to the training data to obtain the basic output accuracy of the processed basic big model; and determine the similarity index of the specified basic network layer based on the basic output accuracy of the processed basic big model.

[0137] According to an embodiment of the present disclosure, the operator unit is further configured to perform the following operations to determine the target loss information based on the model output result of the initial model: based on the knowledge distillation mechanism, the model output result of the initial model and the basic output result of the basic large model are processed to obtain output loss information; at least one initial feature and a basic task calculation result are calculated to obtain intermediate loss information, wherein the basic task calculation result is determined by using the operator unit to perform a basic calculation task based on the hyperparameters of the basic network layer in the basic large model, the basic output result is determined based on the basic task calculation result, and the initial feature includes at least one of the first initial feature and the second initial feature; and the output loss information and the intermediate loss information are fused to obtain the target loss information.

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

[0139] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and 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 execute a task execution method or a model training method.

[0140] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute a task execution method or a model training method.

[0141] According to an embodiment of the present disclosure, a computer program product includes a computer program, which implements a task execution method or a model training method when executed by a processor.

[0142] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement the task execution method and model training method of 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.

[0143] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. Computing unit 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to bus 904.

[0144] Various components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0145] The computing unit 901 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as the task execution method and the model training method. For example, in some embodiments, the task execution method and the model training method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the task execution method and the model training method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute the task execution method or the model training method in any other appropriate manner (for example, by means of firmware).

[0146] Various embodiments of the systems and techniques described above 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), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes 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.

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

[0148] 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, apparatus, or device. 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, 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), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0149] 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).

[0150] The systems and techniques described herein can 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 can 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.

[0151] A computer system may include clients and servers. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0152] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0153] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A task execution method, comprising: Read the hyperparameters of the target network layer in the target model from the storage unit; Using an operator unit to perform a first computing subtask in the computing task according to the hyperparameters of the target network layer, to obtain a first feature output by the target network layer; In the case of reusing the hyperparameters of the target network layer, using the operator unit to perform a second computing subtask in the computing task based on the first feature read from the storage unit to obtain a second feature output by the target network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; as well as Based on the second feature read from the storage unit, a model output result of the target model is determined using the operator unit.

2. The method according to claim 1, wherein The storage unit includes an on-chip storage unit, and the hyperparameters of the target network layer, the first feature, and the second feature are stored in the on-chip storage unit.

3. The method according to claim 1 or 2, wherein: The computing task includes a preset number of subtasks to be executed sequentially, where the preset number is determined based on demand information, and the demand information includes at least one of the following: Delay requirement information, representing the output delay requirement of the target model outputting the model output result; The accuracy requirement information represents the output accuracy requirement of the output result of the model.

4. The method according to claim 1, wherein The target model is determined based on the following operations: Determining a similarity index of at least one specified basic network layer in the trained basic large model using the operator unit, wherein the similarity index represents a hyperparameter similarity between the specified basic network layer and other basic network layers in the trained basic large model; and Determining N basic network layers that meet similarity conditions from the trained basic large model based on the similarity index; and The target model is determined based on M basic network layers that meet similarity conditions, wherein N>M≥1, and N and M are integers.

5. The method according to claim 1, wherein The target network layer includes at least one of an attention layer and a feedforward layer, and the first feature or the second feature includes at least one of an attention feature and a feedforward feature.

6. The method according to any one of claims 1 to 5, wherein The first feature and the second feature include text features, the text features are determined based on initial text, and the model output result includes output text corresponding to the initial text.

7. A model training method comprising: Read the hyperparameters of the initial network layers in the initial model from the storage unit; Using an operator unit to perform a first computing subtask in the computing task according to the hyperparameters of the initial network layer, to obtain a first initial feature output by the initial network layer; In the case of reusing the hyperparameters of the initial network layer, using the operator unit to perform a second computing subtask in the computing task based on the first initial features read from the storage unit, to obtain a second initial feature output by the initial network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; determining, by using the operator unit, a model output result of the initial model based on the second initial feature read from the storage unit; determining target loss information using the operator unit according to a model output result of the initial model; and According to the target loss information, the initial model is trained using the operator unit to obtain a trained target model.

8. The method according to claim 7, wherein: The initial model is determined based on the following operations: Determining a similarity index of at least one specified basic network layer in the basic large model using the operator unit, wherein the similarity index represents a hyperparameter similarity between the specified basic network layer and other basic network layers in the basic large model; Determining K basic network layers that meet similarity conditions from the basic large model based on the similarity index; and The initial model is determined based on P basic network layers that meet similarity conditions, wherein K>P≥1, and K and P are integers.

9. The method according to claim 8, wherein The determining of the similarity index of at least one designated basic network layer in the basic large model by using the operator unit includes: removing at least one of the designated basic network layers in the basic large model by using the operator unit to obtain a processed basic large model; Based on the preset training data, the operator unit is used to perform a basic computing task based on the hyperparameters of the updated basic large model to obtain a basic output result of the processed basic large model; Using the operator unit to process the basic output result of the processed basic large model and the label corresponding to the training data, to obtain the basic output accuracy of the processed basic large model; and Based on the basic output accuracy of the processed basic large model, the similarity index of the specified basic network layer is determined using the operator unit.

10. The method according to claim 7, wherein: Determining target loss information using the operator unit according to the model output result of the initial model includes: Based on the knowledge distillation mechanism, the operator unit is used to process the model output result of the initial model and the basic output result of the basic large model to obtain output loss information; Processing at least one initial feature and a basic task calculation result using the operator unit to obtain intermediate loss information, wherein the basic task calculation result is determined by performing a basic calculation task based on hyperparameters of a basic network layer in the basic large model using the operator unit, and the basic output result is determined based on the basic task calculation result, and the initial feature includes at least one of the first initial feature and the second initial feature; and The output loss information and the intermediate loss information are fused using the operator unit to obtain the target loss information.

11. A task execution device, comprising: storage unit; Operator unit, configured as: Read the hyperparameters of the target network layer in the target model from the storage unit; Execute a first computing subtask in the computing task according to the hyperparameters of the target network layer to obtain a first feature output by the target network layer; In the case of reusing the hyperparameters of the target network layer, executing a second computing subtask in the computing task based on the first feature read from the storage unit to obtain a second feature output by the target network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; as well as A model output result of the target model is determined based on the second feature read from the storage unit.

12. A model training device comprising: storage unit; Operator unit, configured as: Read the hyperparameters of the initial network layers in the initial model from the storage unit; Execute a first computing subtask in the computing task according to the hyperparameters of the initial network layer to obtain a first initial feature output by the initial network layer; In the case of reusing the hyperparameters of the initial network layer, performing a second computing subtask in the computing task based on the first initial features read from the storage unit to obtain a second initial feature output by the initial network layer, wherein the first computing subtask and the second computing subtask are subtasks executed sequentially in the computing task; determining a model output result of the initial model based on the second initial feature read from the storage unit; determining target loss information based on a model output result of the initial model; and The initial model is trained according to the target loss information to obtain a trained target model.

13. 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 10.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 10.

15. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.