Method and device for constructing multi-task learning model, electronic equipment and storage medium
By interleaving sub-network layers and search layers between input nodes and task nodes, a search space is constructed and a multi-task learning model is generated, which solves the problem of low efficiency in the existing technology and realizes efficient construction of multi-task learning models and improvement of learning capabilities.
Patent Information
- Application Number
- CN202010555648.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-17
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2040-09-09
AI Technical Summary
Existing technologies lack efficient solutions for building multi-task learning models, relying mainly on manual verification, which leads to low efficiency and consumes a lot of human and material resources.
By interleaving sub-network layers and search layers between input nodes and multiple task nodes, a search space is constructed, and a multi-task learning model is generated through sampling and training, which automatically and accurately determines candidate network structures.
It achieves automated construction of multi-task learning models, improves construction efficiency, enhances learning capabilities, and enables hierarchical multi-task learning.
Smart Images

Figure CN111723910B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a method and device for constructing a multi-task learning model, an electronic device, and a computer readable storage medium. BACKGROUND
[0002] Artificial intelligence (AI) is a comprehensive technology of computer science, which enables machines to have the functions of perception, reasoning and decision-making by studying the design principles and implementation methods of various intelligent machines. Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, such as natural language processing technology and machine learning / deep learning. With the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0003] In the related art, there is a lack of effective solutions for determining a multi-task learning model based on artificial intelligence. Instead, the most suitable network structure is selected as the multi-task learning model by manually verifying various models. However, this approach is too inefficient and wastes a lot of manpower and resources. SUMMARY
[0004] The embodiments of the present application provide a method and device for constructing a multi-task learning model, an electronic device, and a storage medium, which can automatically and accurately construct a multi-task learning model and improve the efficiency of constructing a multi-task learning model.
[0005] The technical solutions of the embodiments of the present application are as follows:
[0006] The embodiments of the present application provide a method for constructing a multi-task learning model, comprising:
[0007] Between the input node and the plurality of task nodes, a search space composed of a plurality of sub-network layers and a plurality of search layers is constructed by interleaving the sub-network layers and the search layers;
[0008] The paths from the input node to each of the task nodes via the search space are sampled to obtain candidate paths, which are used as candidate network structures.
[0009] According to the sample data, the parameters of the candidate network structures are trained to generate a multi-task learning model for performing multi-task prediction.
[0010] The embodiments of the present application provide a device for constructing a multi-task learning model, comprising:
[0011] A constructing module is configured to construct a search space composed of a plurality of sub-network layers and a plurality of search layers by interleaving the sub-network layers and the search layers between an input node and a plurality of task nodes;
[0012] A sampling module is configured to sample a path from the input node to each of the task nodes via the search space to obtain a candidate path and as a candidate network structure;
[0013] A generating module is configured to train parameters of the candidate network structure according to sample data to generate a multi-task learning model for performing a plurality of task predictions.
[0014] In the technical solution, the constructing module is further configured to sample outputs of a plurality of sub-network modules in the sub-network layer to obtain outputs of the plurality of sub-network modules;
[0015] The outputs of the plurality of sub-network modules are weighted and summed according to weights of each sub-network module in the plurality of sub-network modules, and a result of the weighted and summed outputs is taken as an output of a local structure in a search block to construct a transmission path in the search block, wherein the search block is a module in a search layer adjacent to the sub-network layer.
[0016] In the technical solution, the search block further includes a gating node, and the constructing module is further configured to sample one signal source from a signal source set of the sub-network layer, wherein the signal source is an output of the input node or an output of a predecessor sub-network module of the sub-network layer;
[0017] The signal source is predicted by the gating to obtain a prediction value of each sub-network module in the plurality of sub-network modules;
[0018] The prediction value of each sub-network module is normalized to obtain a weight of each sub-network module.
[0019] In the technical solution, the search space includes N sub-network layers and N search layers, wherein N is a natural number greater than 1; and the constructing module is further configured to sample outputs of the plurality of sub-network modules from the first sub-network layer by an i-th search block in a first search layer, wherein i is a natural number, and
[0020] When the signal source is the output of the input node, the outputs of the plurality of sub-network modules are weighted and summed according to the weights of each sub-network module in the plurality of sub-network modules, and a result of the weighted and summed outputs is taken as an output of a local structure in the i-th search block to construct a transmission path in the i-th search block, until the construction of the transmission paths of all local structures in the i-th search block is completed.
[0021] sampling, from the i-th search block in the j-th search layer, outputs of a plurality of subnetwork modules in the j-th subnetwork layer, where 1
[0022] when the signal source is the input node or an output of a predecessor subnetwork module of the j-th subnetwork layer, performing weighted summation on the outputs of the plurality of subnetwork modules according to weights of the subnetwork modules, and taking a result of the weighted summation as an output of a local structure in the i-th search block in the j-th search layer, to construct a transmission path in the i-th search block in the j-th search layer, until construction of transmission paths of all local structures in the i-th search block in the j-th search layer is completed.
[0023] in the above technical solution, when the successor node of the search layer is the subnetwork module in the subnetwork layer, an output of the search block in the search layer is an input of the subnetwork module;
[0024] when the successor node of the search layer is the task node, an output of the search block in the search layer is an input of the task node.
[0025] in the above technical solution, the construction module is further configured to take the transmission path from the input node to the first subnetwork layer, the transmission path from the intermediate subnetwork layer to the adjacent search layer, and the transmission path from the last search layer to the task node as edges of a directed graph;
[0026] take the subnetwork modules in the plurality of subnetwork layers and the search blocks in the plurality of search layers as nodes of the directed graph;
[0027] combine the nodes and the edges of the directed graph to construct a search space for multi-task learning.
[0028] in the above technical solution, the sampling module is further configured to sample, according to a structure parameter of the search space, each search block in a search layer in the search space, to obtain a local structure corresponding to the each search block;
[0029] take a path from the input node to each task node via the local structure of the each search block as a candidate path.
[0030] in the above technical solution, the sampling module is further configured to perform mapping processing on the structure parameter of the search space, to obtain a sampling probability corresponding to the local structure in the each search block in the search space;
[0031] construct a multinomial distribution of the each search block according to the sampling probability of the local structure in the each search block;
[0032] Sample the polynomial distribution of each search block to obtain a local structure corresponding to each search block.
[0033] The generation module is further configured to train network parameters of the candidate network structure to obtain network parameters of an optimized candidate network structure.
[0034] According to the optimized candidate network structure, the structural parameters of the search space are trained to obtain optimized structural parameters of the search space.
[0035] According to the optimized structural parameters of the search space, a candidate network structure used for performing multiple task predictions is determined from each optimized candidate network structure, to serve as the multi-task learning model.
[0036] The generation module is further configured to perform multi-task prediction processing on the sample data through the candidate network structure to obtain a multi-task prediction result.
[0037] According to the multi-task prediction result and multi-task labels of the sample data, a loss function of the candidate network structure is constructed.
[0038] The network parameters of the candidate network structure are updated until the loss function converges, and the updated parameters of the candidate network structure when the loss function converges are used as the network parameters of the optimized candidate network structure.
[0039] The generation module is further configured to perform evaluation processing on the optimized candidate network structure through the sample data to obtain an evaluation result of the optimized candidate network structure.
[0040] According to the evaluation result, a target function of the structural parameters of the search space is constructed.
[0041] The structural parameters of the search space are updated until the target function converges, and the updated structural parameters of the search space when the target function converges are used as the optimized structural parameters of the search space.
[0042] The generation module is further configured to perform mapping processing on the optimized structural parameters of the search space to obtain a sampling probability of a local structure in each search block in the search space.
[0043] The local structure corresponding to the maximum sampling probability of the local structure in each search block is used as a local structure of a candidate network structure used for performing multiple task predictions.
[0044] The local structures of each candidate network structure are combined to obtain the multi-task learning model.
[0045] The embodiment of the present application provides a kind of electronic equipment for constructing multi-task learning model, the electronic equipment includes:
[0046] Memory, for storing executable instructions;
[0047] Processor, for executing the executable instructions stored in the memory, realize the method for constructing multi-task learning model provided by the embodiment of the present application.
[0048] The embodiment of the present application provides a kind of computer readable storage medium, stores executable instructions, for causing processor to execute, realize the method for constructing multi-task learning model provided by the embodiment of the present application.
[0049] The embodiment of the present application has the following beneficial effects:
[0050] By the way of interlaced arrangement of subnetwork layer and search layer between input node and multiple task nodes, the search space of multi-layer structure is constructed, and according to sample data, the multi-task learning model for carrying out multiple task prediction is searched from the search space, to realize automatically and accurately constructing multi-task learning model, improve the efficiency of multi-task learning model construction;Further, according to the search space composed of multiple subnetwork layers and multiple search layers, the multi-task learning model of multi-layer structure is determined, so that the multi-task learning model can carry out hierarchical multi-task learning, improve learning ability. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 It is the application scenario schematic diagram of multi-task learning model construction system provided by the embodiment of the present application;
[0052] Figure 2 It is the structure schematic diagram of electronic equipment for constructing multi-task learning model provided by the embodiment of the present application;
[0053] Figures 3-6 It is the flow schematic diagram of the method for constructing multi-task learning model provided by the embodiment of the present application;
[0054] Figure 7 It is the structure schematic diagram of multi-gate multi-expert model provided by the embodiment of the present application;
[0055] Figure 8 It is the schematic diagram of search block provided by the embodiment of the present application;
[0056] Figure 9 It is the schematic diagram of search space provided by the embodiment of the present application;
[0057] Figure 10 It is the flow schematic diagram of search process provided by the embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the objects, technical solutions and advantages of the present application clearer, the following further describes the present application in conjunction with the accompanying drawings, and the described embodiments should not be regarded as limitations to the present application. All other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0059] In the following description, the terms "first" and "second" are merely used to distinguish similar objects, and do not represent a specific order of the objects. Understandably, the "first" and "second" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are merely for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0061] Before the embodiments of the present application are further described in detail, the terms and phrases involved in the embodiments of the present application are explained, and the terms and phrases involved in the embodiments of the present application are applicable to the following explanations.
[0062] 1) Deep Learning (DL): a new research direction in the field of Machine Learning (ML). Learning the internal rules and representation levels of sample data to obtain the interpretation of data such as text, images and sound. Ultimately, let the machine have the analysis and learning ability like human beings, and can recognize data such as text, images and sound, and imitate human activities such as vision, hearing and thinking.
[0063] The embodiments of the present application provide a method and device for constructing a multi-task learning model, electronic equipment and computer readable storage medium, which can automatically and accurately construct a multi-task learning model and improve the efficiency of constructing a multi-task learning model.
[0064] The following describes an exemplary application of the electronic equipment for constructing a multi-task learning model provided by the embodiments of the present application.
[0065] The electronic device for constructing a multi-task learning model provided by the embodiments of the present application can be various types of terminal devices or servers, wherein the server can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services; the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited by the present application.
[0066] Taking the server as an example, for example, it can be a server cluster deployed in the cloud, which opens an artificial intelligence cloud service (AI as a Service, AIaaS) to developers, the AIaaS platform will split several common AI services, and provide independent or packaged services in the cloud. This service mode is similar to an AI theme mall, all developers can access one or more artificial intelligence services provided by the AIaaS platform through the application programming interface. For example, one of the artificial intelligence cloud services is a multi-task learning model construction service, that is, the server in the cloud encapsulates a multi-task learning model construction program. The developer calls the multi-task learning model construction service in the cloud service through the terminal, so that the server deployed in the cloud calls the encapsulated multi-task learning model construction program to determine the multi-task learning model from the constructed search space, and subsequently performs a recommended application according to the multi-task learning model. For example, for a news recommendation application, the click rate and completion rate of the news are estimated through the multi-task learning model, so as to perform personalized news recommendation according to the click rate and completion rate of each news.
[0067] Referring to Figure 1 , Figure 1 is a schematic diagram of an application scenario of the multi-task learning model construction system 10 provided by the embodiments of the present application. The terminal 200 is connected to the server 100 through the network 300, which can be a wide area network or a local area network, or a combination of the two.
[0068] The terminal 200 (running a client, such as a news client, a video client, etc.) can be used to obtain sample data, for example, the developer inputs a recommendation sample data set through the terminal, and after the input is completed, the terminal automatically obtains the recommendation sample data set.
[0069] In some embodiments, a client running in the terminal 200 can be implanted with a multi-task learning model construction plug-in to locally execute the method for constructing a multi-task learning model provided by the embodiments of the present application to determine a multi-task learning model from a constructed search space. For example, a recommendation client, such as a video client, a news client, etc., is installed on the terminal 200. After a developer inputs a recommendation sample data set in the recommendation client, the terminal 200 calls the multi-task learning model construction plug-in to construct a search space composed of multiple sub-network layers and multiple search layers, and searches for a multi-task learning model for performing multiple task predictions from the search space according to the sample data. Subsequently, a recommended application is performed according to the multi-task learning model. For example, for a video application, the click rate and completion rate of a video are estimated by the multi-task learning model, so that recommended videos are determined according to the click rate and completion rate of each video, and personalized video recommendation is performed through the video client. For a news application, the exposure rate and click rate of a news are estimated by the multi-task learning model, so that recommended news are determined according to the exposure rate and click rate of each news, and personalized news recommendation is performed through the news client.
[0070] In some embodiments, the terminal 200 can also send a recommendation sample data set input by a developer on the terminal 200 to the server 100 in the cloud through the network 300, and call a multi-task learning model construction interface of the server 100 (which can be provided in the form of a cloud service, i.e., a multi-task learning model construction service encapsulating a program for constructing a task learning model). After receiving the recommendation sample data set, the server 100 determines a multi-task learning model from a constructed search space by the method for constructing a multi-task learning model provided by the embodiments of the present application. For example, a recommendation client, such as a shopping client, is installed on the terminal 200. The developer inputs a recommendation sample data set in the recommendation client. The terminal 200 calls the multi-task learning model construction interface of the server 100, i.e., a program encapsulating the multi-task learning model construction, to construct a search space composed of multiple sub-network layers and multiple search layers, and searches for a multi-task learning model for performing multiple task predictions from the search space according to the sample data. Subsequently, a recommended application is performed according to the multi-task learning model. For example, for a shopping application, the click rate and purchase rate of a product are estimated by the multi-task learning model, so that recommended products are determined according to the click rate and purchase rate of each product, and the recommended products are returned to the shopping client, and personalized product recommendation is performed through the shopping client.
[0071] The structure of an electronic device for constructing a multi-task learning model provided by the embodiments of the present application is described below. The electronic device for constructing a multi-task learning model can be various terminals, such as a mobile phone, a computer, etc., or a server 100 as shown. Figure 1 The server 100.
[0072] Referring to Figure 2 , Figure 2 is a structural schematic diagram of an electronic device 500 for constructing a multi-task learning model provided by an embodiment of the present application, and the electronic device 500 is taken as an example of a server for illustration, Figure 2 The electronic device 500 for constructing a multi-task learning model shown in the embodiment of the present application includes at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. Various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between the components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the bus system 540 in Figure 2 .
[0073] The processor 510 can be an integrated circuit chip with signal processing capability, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc., wherein the general-purpose processor can be a microprocessor or any conventional processor.
[0074] The memory 550 includes a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), and the volatile memory can be a random access memory (RAM). The memory 550 described in the embodiment of the present application is intended to include any suitable type of memory. The memory 550 can optionally include one or more storage devices that are physically remote from the processor 510.
[0075] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules and data structures or subsets or supersets thereof, which are exemplarily illustrated below.
[0076] The operating system 551 includes system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for realizing various basic services and processing hardware-based tasks;
[0077] The network communication module 552 is configured to communicate with other computing devices via one or more (wired or wireless) network interfaces 520, such as Bluetooth, WiFi, Universal Serial Bus (USB), and the like.
[0078] In some embodiments, the apparatus for constructing a multi-task learning model can be implemented in software, for example, as a plug-in for constructing a multi-task learning model in the terminal, or as a multi-task learning model construction service in the server.
[0079] Of course, the apparatus for constructing a multi-task learning model can be provided in various software embodiments, including various forms of application programs, software, software modules, scripts, or computer codes.
[0080] In summary, the method for constructing a multi-task learning model can be implemented as a computer program product in any form and deployed in various electronic devices as needed.
[0081] Figure 2 The apparatus for constructing a multi-task learning model 555 stored in the memory 550 can be software in the form of programs and plug-ins, and includes a series of modules, including a construction module 5551, a sampling module 5552, and a generation module 5553; wherein the construction module 5551, the sampling module 5552, and the generation module 5553 are configured to implement the functions of the multi-task learning model construction provided by the embodiments of the present application.
[0082] As can be understood from the above, the method for constructing a multi-task learning model can be implemented by various types of electronic devices for constructing a multi-task learning model, such as smart terminals and servers.
[0083] The method for constructing a multi-task learning model provided by the embodiments of the present application will be described below in conjunction with exemplary applications and implementations of the server provided by the embodiments of the present application. Referring to Figure 3 , Figure 3 is a flowchart of the method for constructing a multi-task learning model provided by the embodiments of the present application, which will be described in conjunction with the steps shown in Figure 3 .
[0084] In the following steps, input nodes and task nodes are involved, which correspond to the entrance and exit of the multi-task learning model respectively, the data received by the input nodes is used as the basis for classification / prediction tasks performed by multiple (i.e. at least two) task nodes, and the number of task nodes is related to the number of classification / prediction tasks to be implemented in the specific application scenario.
[0085] In step 101, between the input node and the plurality of task nodes, a search space composed of a plurality of sub-network layers and a plurality of search layers is constructed by interleaving the sub-network layers and the search layers.
[0086] As an example of obtaining sample data, the developer can input a sample data set at the terminal, and after the input is completed, the terminal automatically sends the sample data set to the server, and the server receives the sample data set. For the recommended application scenario, the sample data is recommendation sample data, for example, for a news recommendation application, the sample data is news sample data; for a commodity recommendation application, the sample data is commodity sample data; for a movie recommendation application, the sample data is movie sample data.
[0087] After the server receives the sample data set, a program for constructing a multi-task learning model is called, and between the input node and the plurality of task nodes, a search space composed of a plurality of sub-network layers and a plurality of search layers is constructed, wherein the sub-network layers and the search layers are interleaved, each sub-network layer includes a plurality of sub-network modules, and each search layer includes a plurality of search blocks, for example, the input node is connected with the 1st sub-network layer, the 1st sub-network layer is connected with the 1st search layer, the 1st search layer is connected with the 2nd sub-network layer, and so on, until the last search layer is connected with the task node, that is, a search space composed of a plurality of sub-network layers and a plurality of search layers is constructed between the input node and the plurality of task nodes, after the search space is determined, a multi-task learning model is obtained from the search space, and multi-task prediction is performed through the multi-task learning model.
[0088] Among them, for the recommended application scenario, between the input node and the plurality of task nodes for recommendation prediction, a search space composed of a plurality of sub-network layers and a plurality of search layers is constructed by interleaving the sub-network layers and the search layers. Wherein, the input of the input node is recommendation data, such as commodity data, news data, etc., and the output of the task node is the prediction result for the recommendation data, such as click rate, completion degree (such as video watching completion degree, news browsing time) etc.
[0089] Among them, when the driven node of the search layer is the sub-network module in the sub-network layer, the output of the search block in the search layer is the input of the sub-network module; when the driven node of the search layer is the task node, the output of the search block in the search layer is the input of the task node.
[0090] Referring to Figure 4 , Figure 4 is an optional flowchart of the method for constructing a multi-task learning model provided by the embodiment of the application, Figure 4 shows Figure 3The method further includes steps 104-105: in step 104, sampling the outputs of the plurality of subnetwork modules in the subnetwork layer to obtain the outputs of the plurality of subnetwork modules; and in step 105, summing the outputs of the plurality of subnetwork modules according to the weights of the subnetwork modules in the plurality of subnetwork modules, and taking the result of the summing as the output of the local structure in the search block to construct the transmission path in the search block, wherein the search block is a module in a search layer adjacent to the subnetwork layer.
[0091] As an example, before constructing the search space, the structure of the search block in each search layer is constructed. The outputs of the plurality of subnetwork modules in the subnetwork layer are sampled to obtain the outputs of the plurality of subnetwork modules, as shown in Figure 8 For example, there are three subnetwork modules in a certain subnetwork layer, and the outputs (v1, v2, v3) of the three subnetwork modules are sampled to obtain seven sampling results, i.e., (v1), (v2), (v3), (v1 and v2), (v1 and v3), (v2 and v3), and (v1, v2, and v3). When the sampling obtains the output of one subnetwork module, for example, (v1), (v2), or (v3), the output of the subnetwork module is taken as the output of the local structure in the search block to construct the transmission path in the search block, which is a module in a search layer adjacent to the subnetwork layer. When the sampling obtains the outputs of multiple subnetwork modules, for example, (v1 and v2), (v1 and v3), (v2 and v3), or (v1, v2, and v3), the outputs of the plurality of subnetwork modules are summed according to the weights of the subnetwork modules in the plurality of subnetwork modules, and the result of the summing is taken as the output of the local structure in the search block to construct the transmission path in the search block, which is a module in a search layer adjacent to the subnetwork layer. Therefore, by constructing multiple transmission paths in the search block, the search space constructed subsequently can contain enough possible network structures, thereby solving the specific multi-task learning problem.
[0092] In some embodiments, the search block further includes a gating node, and after the sampling of the outputs of the plurality of subnetwork modules in the subnetwork layer, the method further includes: sampling one signal source from a signal source set of the subnetwork layer, the signal source being the output of the input node or the output of the predecessor subnetwork module of the subnetwork layer; predicting the signal source through the gating to obtain the predicted value of each subnetwork module in the plurality of subnetwork modules; and normalizing the predicted value of each subnetwork module to obtain the weight of each subnetwork module.
[0093] Taking the above example, in order to construct multiple transmission paths in the search block, for a certain sub-network layer, the server can sample a signal source from the signal source set of the sub-network layer, and predict the signal source through the gate to obtain the prediction value of each sub-network module in the multiple sub-network modules in the sub-network layer, that is, wherein e represents the prediction value of the multiple sub-network modules in the sub-network layer, represents the signal source, w k represents the learnable parameters of the gate. After the server obtains the prediction value of each sub-network module, the prediction value of the sub-network module can be normalized to obtain the weight of each sub-network module, that is, wherein s represents the number of sub-network modules. Therefore, by different signal sources, different weights are determined to construct multiple transmission paths in the search block, so that the search space constructed subsequently can contain enough possible network structures, thereby solving the specific multi-task learning problem.
[0094] In some embodiments, the search space includes N sub-network layers and N search layers, wherein N is a natural number greater than 1; before constructing the search space composed of multiple layers of sub-network layers and multiple layers of search layers, it includes: sampling the outputs of multiple sub-network modules from the 1st sub-network layer through the i-th search block in the 1st search layer, wherein i is a natural number, and when the signal source is the output of the input node, the outputs of the multiple sub-network modules are weighted and summed according to the weights of the sub-network modules in the multiple sub-network modules, and the result of the weighted summation is taken as the output of the local structure in the i-th search block to construct the transmission path in the i-th search block, until the construction of the transmission paths of all local structures in the i-th search block is completed; sampling the outputs of multiple sub-network modules from the j-th sub-network layer through the i-th search block in the j-th search layer, wherein 1
[0095] As an example, through the i-th search block in the 1st search layer, the output of one sub-network module or multiple sub-network modules is sampled from the 1st sub-network layer, the signal source of the 1st search layer is the output of the input node, then the prediction value of each sub-network module in the multiple sub-network modules is obtained by performing prediction processing on the signal source through the gate, the weight of each sub-network module is obtained by performing normalization processing on the prediction value of each sub-network module, and the weighted sum of the outputs of the multiple sub-network modules is obtained according to the weight of each sub-network module in the multiple sub-network modules, the result of the weighted sum is taken as the output of the local structure in the i-th search block, and the transmission path in the i-th search block is constructed, until the construction of the transmission paths of all local structures in the i-th search block is completed.
[0096] As an example, through the i-th search block in the 1st search layer, the output of one sub-network module or multiple sub-network modules is sampled from the 1st sub-network layer, the signal source of the 1st search layer is the output of the input node, then the prediction value of each sub-network module in the multiple sub-network modules is obtained by performing prediction processing on the signal source through the gate, the weight of each sub-network module is obtained by performing normalization processing on the prediction value of each sub-network module, and the weighted sum of the outputs of the multiple sub-network modules is obtained according to the weight of each sub-network module in the multiple sub-network modules, the result of the weighted sum is taken as the output of the local structure in the i-th search block, and the transmission path in the i-th search block is constructed, until the construction of the transmission paths of all local structures in the i-th search block is completed.
[0097] In some embodiments, the search space composed of multiple sub-network layers and multiple search layers is constructed, including: taking the transmission path from the input node to the first sub-network layer, the transmission path from the intermediate sub-network layer to the adjacent search layer, and the transmission path from the last search layer to the task node as the edge of the directed graph; taking the sub-network module in the multiple sub-network layers and the search block in the multiple search layers as the node of the directed graph; and combining the nodes and edges of the directed graph to construct the search space for multi-task learning.
[0098] As an example, the search space can be constructed in the form of a directed graph. The transmission path from the input node to the first sub-network layer is taken as the edge of the directed graph, and the transmission path from the intermediate sub-network layer (the first sub-network layer to the last sub-network layer) to the adjacent search layer is also taken as the edge of the directed graph, for example, the transmission path from the second sub-network layer to the adjacent second search layer, and the sub-network module in the multiple sub-network layers and the search block in the multiple search layers are taken as the node of the directed graph, then the search space for multi-task learning is constructed according to the nodes and edges of the directed graph. The edges of the directed graph can be subsequently sampled to realize the sampling of the search space, so as to obtain the candidate network structure.
[0099] In step 102, paths from the input node to each task node via the search space are sampled to obtain candidate paths and as candidate network structures.
[0100] After the server builds the search space, paths from the input node to each task node via the search space can be sampled to determine candidate network structures. Since the search space contains a sufficient number of possible network structures, the candidate network structures obtained by sampling paths from the input node to each task node via the search space contain a variety of structures, so that the specific multi-task learning problem can be solved.
[0101] Referring to Figure 5 , Figure 5 is an optional flowchart of a method for building a multi-task learning model according to an embodiment of the present application, Figure 5 shows Figure 3 Step 102 can be implemented by steps 1021-1022 in Figure 5 In step 1021, each search block in the search layer in the search space is sampled according to the structure parameters of the search space to obtain the local structure corresponding to each search block; in step 1022, the path from the input node to each task node via the local structure of each search block is taken as a candidate path.
[0102] As an example, since each search block in the search space contains multiple local structures, the local structure (transmission path) of each search block can be sampled according to the structure parameters of the search space, and the path from the input node to each task node via the local structure of each search block is taken as a candidate path, thereby forming a candidate network structure.
[0103] In some embodiments, sampling each search block in the search layer in the search space according to the structure parameters of the search space to obtain the local structure corresponding to each search block includes: performing mapping processing on the structure parameters of the search space to obtain the sampling probability of the local structure in each search block in the search space; constructing a multinomial distribution of each search block according to the sampling probability of the local structure in each search block; and performing sampling processing on the multinomial distribution of each search block to obtain the local structure corresponding to each search block.
[0104] In the above example, in order to sample the local structure of each search block, the structure parameters of the search space can be mapped first to obtain the sampling probability of each local structure in each search block, and a multinomial distribution of each search block can be constructed according to the sampling probability of each local structure in each search block, and finally the local structure in each search block can be sampled according to the multinomial distribution of each search block to obtain the local structure corresponding to each search block. For example, when the search space includes B search blocks, a plurality of local structures in each search block are sampled to obtain a corresponding local structure, and then B local structures can be obtained. By combining the B local structures, the input nodes, the sub-network modules and the task nodes, a complete candidate network structure can be obtained.
[0105] In step 103, the parameters of the candidate network structure are trained according to the sample data to generate a multi-task learning model for performing a plurality of task predictions.
[0106] After the server samples the candidate network structure according to the search space, the parameters of the candidate network structure are trained, and the iteration of sampling and training operations can generate a multi-task learning model for performing a plurality of task predictions. For the application scenario of recommendation, the parameters of the candidate network structure can be trained according to the recommended sample data to generate a multi-task learning model for performing a plurality of recommendation predictions. For example, the output of the task node is the click rate and completion rate of news, and the parameters of the candidate network structure are trained according to the news sample data to generate a multi-task learning model for performing a plurality of task predictions. The multi-task learning model is used to predict the click rate and completion rate of news, and subsequent news recommendation is performed according to the click rate and completion rate of news.
[0107] Referring to Figure 6 , Figure 6 is an optional flowchart of the method for constructing a multi-task learning model provided by the embodiment of the application, Figure 6 shows Figure 3 Step 103 can be implemented by steps 1031-1033 in Figure 6 In step 1031, the network parameters of the candidate network structure are trained to obtain the optimized network parameters of the candidate network structure. In step 1032, the structure parameters of the search space are trained according to the optimized candidate network structure to obtain the optimized structure parameters of the search space. In step 1033, the candidate network structure for performing a plurality of task predictions is determined from the optimized candidate network structures according to the optimized structure parameters of the search space, and is used as a multi-task learning model.
[0108] As an example, after the server samples the candidate network structure, the network parameters of the candidate network structure can be trained first, and then the structure parameters are trained, or the structure parameters are trained first, and then the network parameters are trained. For example, the network parameters of the candidate network structure can be trained, and after obtaining the optimized network parameters of the candidate network structure, the structure parameters of the search space are trained according to the optimized candidate network structure, and the optimized structure parameters of the search space are obtained. Finally, according to the optimized structure parameters of the search space, the candidate network structure used for performing multiple task prediction is determined from each optimized candidate network structure, which is used as a multi-task learning model. The network parameters refer to the parameters used by each module (such as a sub-network module, a search block, a task node, etc.) in the network structure for calculation, and the structure parameters are used to represent the possibility of sampling the local structure in the search block in the search space. For example, the i-th search block includes N local structures, and the structure parameters α i is an N-dimensional vector, where the value of the structure parameter α i is greater, the greater the possibility of sampling the local structure corresponding to the value.
[0109] In some embodiments, training the network parameters of the candidate network structure to obtain the optimized network parameters of the candidate network structure includes: performing multi-task prediction processing on the sample data through the candidate network structure to obtain the prediction results of the multiple tasks; constructing a loss function of the candidate network structure according to the prediction results of the multiple tasks and the multi-task labels of the sample data; updating the network parameters of the candidate network structure until the loss function converges, and the updated parameters of the candidate network structure when the loss function converges are used as the optimized network parameters of the candidate network structure.
[0110] After determining the value of the loss function of the candidate network structure according to the prediction results of the multiple tasks and the multi-task labels of the sample data, it can be determined whether the value of the loss function exceeds a preset threshold. When the value of the loss function exceeds the preset threshold, an error signal of the candidate network structure is determined based on the loss function, the error signal is back-propagated in the candidate network structure, and the model parameters of each layer are updated during the propagation.
[0111] Here, the back-propagation is described. The training sample data is input to the input layer of the neural network model, passes through the hidden layer, and finally reaches the output layer and outputs the result, which is the forward propagation process of the neural network model. Since there is an error between the output result of the neural network model and the actual result, the error between the output result and the actual value is calculated, and the error is back-propagated from the output layer to the hidden layer until it propagates to the input layer. In the process of back-propagation, the value of the model parameter is adjusted according to the error; the above process is iterated continuously until convergence. The candidate network structure belongs to the neural network model.
[0112] In some embodiments, the structure parameters of the search space are trained according to the optimized candidate network structure, to obtain the optimized structure parameters of the search space, including: performing evaluation processing on the optimized candidate network structure through sample data, to obtain an evaluation result of the optimized candidate network structure; constructing a target function of the structure parameters of the search space according to the evaluation result; updating the structure parameters of the search space until the target function converges, and taking the updated structure parameters of the search space when the target function converges as the optimized structure parameters of the search space.
[0113] For example, after the server obtains the optimized candidate network structure, the sample data is predicted through the optimized candidate network structure to obtain a prediction result of multiple tasks, and the optimized candidate network structure is evaluated according to the prediction result of multiple tasks to obtain an evaluation result of the optimized candidate network structure, such as accuracy, area under curve (AUC), loss, etc., and a target function of the structure parameters of the search space is constructed according to the evaluation result, that is, where p (a) represents a polynomial distribution determined by the structure parameter a, R val represents the evaluation result of the optimized candidate network structure, the structure parameters of the search space are updated until the target function converges, and the updated structure parameters of the search space when the target function converges are taken as the optimized structure parameters of the search space.
[0114] In some embodiments, according to the optimized structure parameters of the search space, a candidate network structure for performing multiple task prediction is determined from each optimized candidate network structure to serve as a multi-task learning model, including: performing mapping processing on the optimized structure parameters of the search space to obtain a sampling probability of a local structure in each search block in the corresponding search space; taking a local structure corresponding to the maximum sampling probability of the local structure in each search block as a local structure of the candidate network structure for performing multiple task prediction; and combining the local structures of each candidate network structure to obtain a multi-task learning model.
[0115] For example, after the server obtains the optimized structure parameters of the search space, the optimal network structure can be searched from the search space according to the optimized structure parameters of the search space. The optimized structure parameters of the search space are mapped, for example, a logistic regression function (softmax function), to obtain a sampling probability of a local structure in each search block in the corresponding search space, and a local structure corresponding to the maximum sampling probability of the local structure in each search block is taken as a local structure of the candidate network structure for performing multiple task prediction, and finally the local structures of each candidate network structure are combined to obtain a multi-task learning model.
[0116] Below, an exemplary application of the embodiments of the present application in an actual application scenario will be described.
[0117] The embodiments of the present application can be applied to various recommended application scenarios, such as Figure 1 As shown, the terminal 200 is connected to the server 100 deployed in the cloud through the network 300, a multi-task learning model construction application is installed on the terminal 200, and the developer inputs a recommended sample data set in the multi-task learning model construction application. The terminal 200 sends the recommended sample data set to the server 100 through the network 300, and the server 100 determines the optimal network structure from the constructed search space as a multi-task learning model after receiving the recommended sample data set. Subsequently, the multi-task learning model is used for recommendation application, for example, for a news recommendation application, the click rate and completion rate of news are estimated through the multi-task learning model, so as to perform personalized news recommendation according to the click rate and completion rate of news; for a commodity recommendation application, the click rate (CTR) and conversion rate (CVR) of commodities are estimated through the multi-task learning model, so as to perform personalized commodity recommendation according to the click rate and conversion rate of commodities; for a movie recommendation application, the purchase rate of movies and the score of users are estimated through the multi-task learning model, so as to perform personalized movie recommendation according to the purchase rate of movies and the score of users.
[0118] In the related art, a multi-task learning is performed through a multi-gate multi-expert method. Compared with bottom sharing, the multi-gate multi-expert method enables each task to dynamically aggregate and share the output of an expert, and can better handle the direct relationship between multiple tasks. The multi-gate multi-expert method decomposes the bottom shared layer into multiple experts (independent neural network modules, which can be composed of a single fully connected layer and an activation function), and then dynamically aggregates the output of the experts through a gate, and outputs the dynamically aggregated result to the corresponding task node. The multi-gate multi-expert method does not limit the number of experts, but the gate and the task are one-to-one, so the number of gates is equal to the number of tasks. As shown in Figure 7 As shown, the multi-gate multi-expert model includes 2 task nodes, 2 gates, and 3 experts. Assuming that the input is x, the input of the 3 experts is a d-dimensional vector x, and the output is where e represents a function transformation, that is, it can be regarded as a fully connected layer or a convolutional layer. For task A, gate A is used to calculate the weight (scalar) of the three experts for task A The gate can be a fully connected layer, and the input is a vector x and the output is the scores of the three experts where the weight is obtained by transforming the score through a normalized exponential function, that is, According to the weight calculated by gate A, the input of task A is obtained as where the processing process of task B is similar to that of task A, and the role of gate B is similar to that of gate A.
[0119] Although the multi-gate multi-expert method can perform multi-task learning, there are several problems, which are 1) all experts in the multi-gate multi-expert model (MMOE) are shared by all tasks, but this is not necessarily the optimal way; 2) the combination of experts in the multi-gate multi-expert model is linear (weighted sum), and the representation ability is limited; 3) when the number of expert layers increases, it is difficult to determine the input selection of the gate.
[0120] To solve the above problems, the embodiment of the present application starts from the perspective of neural network architecture search, and uses a search algorithm to find the optimal network structure in the search space, so as to greatly alleviate the cost of manually adjusting the network structure. First, a search space is designed, which enumerates the correspondence between subnetwork modules (experts) and between subnetwork modules and tasks. Since the search space can be multi-layered, and the input sources of the gate are also included in the search space, that is, the search space includes the above multi-gate multi-expert model. The embodiment of the present application uses a polynomial distribution sampling and a policy gradient algorithm to efficiently find the optimal network structure in the search space in a differentiable manner, so as to serve as a multi-task learning model, thereby achieving better results than the multi-gate multi-expert method.
[0121] Next, the multi-task learning oriented neural network architecture search method provided by the embodiment of the present application is described, which includes two parts, which are 1) construction of the search space; and 2) search algorithm.
[0122] 1) Construction of the search space
[0123] The goal of constructing the search space is to make the search space contain enough possible network structures, so as to solve a specific multi-task learning problem. First, the parameter sharing part is divided into several subnetworks. Assuming that for a machine learning problem with T tasks, the subnetwork layer (expert) has L layers, and each layer has H subnetwork modules.
[0124] Overall, the search space is composed of several search blocks. Each search block represents a sub-search space, which contains several local network structures (for example, the connection between subnetwork modules). Next, the specific structure of a search block is introduced:
[0125] As shown in Figure 8 , a search block represents a sub-search space, which contains a plurality of different local network structures (local structures). For a certain local structure, the dynamic aggregation of input features is realized by using a gate. Among them, the local structure is affected by two factors, which are 1) different inputs (combination); and 2) different gate signal sources (signal source).
[0126] where one search block represents a sub-search space can be formulated as where and denote sets, x denotes Cartesian product, denotes all combinations of input features (where the input comes from the output of the previous layer of subnetwork modules), set denotes as denotes all possible sources of gating signals, for example, all inputs of previous subnetwork layers and the original shared input can be used as signal sources, denotes a sub-search space. That is, there are different local structures in one search block. For any one local structure in the search block (the kth local structure, ), the input of the kth local structure is (s input features, each feature is d v dimension) and (gating signal source, dimension d q ), the output of the kth local structure is y k , i.e., the weighted sum of input features, the calculation formula is shown in formula (1):
[0127]
[0128] where, e=[e1,e2,...,e s ], g k denotes the gating of the local network, m i denotes the gating score (predicted value) of the ith input feature, w k denotes the learnable parameters of the gating.
[0129] As shown in Figure 9 , the search block in the search space is located between two adjacent layers of subnetwork layers, or between the last layer of subnetwork layers and the task layer (containing multiple task nodes). Therefore, the total number of search blocks is B=(L-1)*H+T, where T represents the number of task nodes. The search space of the embodiment of the present application can be represented as the Cartesian product of the space represented by B search blocks , that is, the physical structure can be regarded as an over-parameterized network (Over-Parameterized Network), which can include a variety of complex network structures.
[0130] 2) search algorithm
[0131] The embodiment of the present application aims to find the best network structure from the super network. Each search block contains A local structure, wherein i∈[1,2,...,B], by selecting a local structure in each search block, all local structures are combined to determine a complete network structure. A complete network structure is defined as B local structures determined by B sampling actions, w u represents the network parameters of the network structure (the network parameters refer to the parameters of each module in the network structure for calculation, for example, w k in formula 1).
[0132] For the optimization of the structure parameters, the sampling action u i (i∈[1,2,...,B]) is sampled from a multinomial distribution determined by the structure parameters (i∈[1,2,...,B]), wherein the structure parameter α i is used to represent the possibility of sampling the local structure in the i-th search block, for example, the i-th search block includes N local structures, then the structure parameter α i is an N-dimensional vector, wherein the value of the structure parameter α i is greater, the greater the possibility of sampling the local structure corresponding to the value, and its calculation formula is shown in formulas (2) and (3):
[0133] u i ~ multinomial(p i ) (2)
[0134] p i = softmax(α i ) (3)
[0135] Wherein, multinomial() represents a multinomial distribution, softmax() represents a logistic regression function, and p i represents the probability of sampling the local structure in the i-th search block. Therefore, by sampling B multinomial distributions, a complete network structure can be obtained. In order to be able to cope with non-differentiable evaluation indicators, the embodiment of the present application uses the reinforcement learning policy gradient (REINFORCE) algorithm to optimize the structure parameters. In the optimization process of the structure parameters, the network structure with good performance on the specified evaluation indicators will have a higher sampling probability, and the optimization target formula of the structure parameters is shown in formula (4):
[0136]
[0137] Wherein, p(α) represents a multinomial distribution determined by the structure parameter α, and Rval This represents the score (evaluation result) of the sampled structure on a specific metric (e.g., accuracy, area under the ROC curve (AUC), loss, etc.). According to the REINFORCE algorithm, the gradient of the structure parameters is obtained using the following formula (5):
[0138]
[0139] Here, b represents the benchmark used to reduce the variance of returns. It can be a moving average or 0.
[0140] like Figure 10 As shown, in each iteration, a candidate network structure is sampled from the supernetwork, and then the structure parameters and corresponding network parameters are trained alternately. As the iteration progresses, the probability of sampling a high-performing network structure increases. After the search is complete, the local structure with the highest probability is selected from each search block, and all local structures with the highest probability are combined to obtain the complete network structure. The pseudocode for the search process and obtaining the optimal network structure is shown in Algorithm 1 below:
[0141] Algorithm 1: Search process and obtaining the optimal network structure
[0142] Input: Training sample data, validation data, and a hypernetwork including B search blocks.
[0143] Output: Optimized structural parameters α and network parameters w
[0144]
[0145] Based on the optimized structural parameters α and network parameters w, the final network structure is obtained.
[0146] Therefore, by inputting training sample data, validation data, and a supernetwork including B search blocks, optimized structural parameters α and network parameters w can be obtained. Based on the optimized structural parameters α and network parameters w, the final network structure can be obtained as a multi-task learning model.
[0147] In summary, the embodiment of the present application can efficiently optimize the network structure for the specified multi-task data set, automatically balance the independent and shared relationship of different task branches, and search for a better network structure as a multi-task learning model. Multi-task learning is very important in a recommendation system, and can be used for network structure optimization in multi-task learning (multiple distribution index estimation: such as estimating click rate and completion rate) in a business recommendation scenario, fully utilizes the domain knowledge contained in different tasks (indices) to improve the generalization ability of the multi-task learning model, and thus quickly and accurately obtains specific indices of the recommendation system. Compared with the manual trial-and-error method for designing the network structure, the embodiment of the present application can more efficiently learn the most suitable network structure for the training data of a specific business, and accelerate product iteration and upgrading.
[0148] So far, the method for constructing a multi-task learning model provided by the embodiment of the present application has been described, and the cooperation of various modules in the device 555 for constructing a multi-task learning model provided by the embodiment of the present application will be described below.
[0149] The constructing module 5551 is configured to construct a search space composed of a plurality of sub-network layers and a plurality of search layers by interleaving the sub-network layers and the search layers between an input node and a plurality of task nodes; the sampling module 5552 is configured to sample a path from the input node to each of the task nodes via the search space to obtain a candidate path and as a candidate network structure; and the generating module 5553 is configured to train parameters of the candidate network structure according to sample data to generate a multi-task learning model for performing a plurality of task predictions.
[0150] In some embodiments, the constructing module 5551 is further configured to sample outputs of a plurality of sub-network modules in the sub-network layer to obtain outputs of the plurality of sub-network modules; perform weighted summation on the outputs of the plurality of sub-network modules according to weights of each sub-network module in the plurality of sub-network modules, and take a result of the weighted summation as an output of a local structure in a search block to construct a transmission path in the search block, wherein the search block is a module in a search layer adjacent to the sub-network layer.
[0151] In some embodiments, the search block further includes a gating node; and the constructing module 5551 is further configured to sample one signal source from a signal source set of the sub-network layer, the signal source being an output of the input node or an output of a predecessor sub-network module of the sub-network layer; perform prediction processing on the signal source through the gating to obtain a prediction value of each sub-network module in the plurality of sub-network modules; and perform normalization processing on the prediction value of each sub-network module to obtain a weight of each sub-network module.
[0152] In some embodiments, the search space includes N sub-network layers and N search layers, where N is a natural number greater than 1; the construction module 5551 is further configured to sample, by an i-th search block in a 1-st search layer, outputs of a plurality of sub-network modules from a 1-st sub-network layer, where i is a natural number, and when the signal source is an output of the input node, perform weighted summation on the outputs of the plurality of sub-network modules according to weights of each sub-network module in the plurality of sub-network modules, and take a result of the weighted summation as an output of a local structure in the i-th search block to construct a transmission path in the i-th search block, until construction of transmission paths of all local structures in the i-th search block is completed; sample, by an i-th search block in a j-th search layer, outputs of a plurality of sub-network modules from a j-th sub-network layer, where 1 < j ≤ N and j is a natural number, and when the signal source is an output of the input node or a predecessor sub-network module of the j-th sub-network layer, perform weighted summation on the outputs of the plurality of sub-network modules according to weights of each sub-network module in the plurality of sub-network modules, and take a result of the weighted summation as an output of a local structure in the i-th search block in the j-th search layer to construct a transmission path in the i-th search block in the j-th search layer, until construction of transmission paths of all local structures in the i-th search block in the j-th search layer is completed.
[0153] In some embodiments, when a successor node of the search layer is a sub-network module in the sub-network layer, an output of a search block in the search layer is an input of the sub-network module; when the successor node of the search layer is the task node, the output of the search block in the search layer is an input of the task node.
[0154] In some embodiments, the construction module 5551 is further configured to take, as edges of a directed graph, transmission paths from the input node to a 1-st sub-network layer, transmission paths from an intermediate sub-network layer to an adjacent search layer, and a transmission path from a last search layer to the task node; take, as nodes of the directed graph, sub-network modules in the plurality of sub-network layers and search blocks in the plurality of search layers; and combine the nodes and the edges of the directed graph to construct the search space for multi-task learning.
[0155] In some embodiments, the sampling module 5552 is further configured to sample, according to a structure parameter of the search space, each search block in a search layer in the search space to obtain a local structure corresponding to the each search block; and take, as a candidate path, a path from the input node to each task node via the local structure of the each search block.
[0156] In some embodiments, the sampling module 5552 is further configured to perform mapping processing on the structure parameters of the search space to obtain sampling probabilities corresponding to local structures in each search block in the search space; construct a multinomial distribution of each search block according to the sampling probabilities of the local structures in the search block; and perform sampling processing on the multinomial distribution of each search block to obtain the local structure corresponding to the search block.
[0157] In some embodiments, the generating module 5553 is further configured to train the network parameters of the candidate network structure to obtain optimized network parameters of the candidate network structure; train the structure parameters of the search space according to the optimized candidate network structure to obtain optimized structure parameters of the search space; and determine a candidate network structure for performing multi-task prediction from the optimized candidate network structures according to the optimized structure parameters of the search space, as the multi-task learning model.
[0158] In some embodiments, the generating module 5553 is further configured to perform multi-task prediction processing on the sample data by the candidate network structure to obtain a prediction result of the multi-task; construct a loss function of the candidate network structure according to the prediction result of the multi-task and multi-task labels of the sample data; update the network parameters of the candidate network structure until the loss function converges; and take the updated parameters of the candidate network structure when the loss function converges as the optimized network parameters of the candidate network structure.
[0159] In some embodiments, the generating module 5553 is further configured to perform evaluation processing on the optimized candidate network structure by the sample data to obtain an evaluation result of the optimized candidate network structure; construct an objective function of the structure parameters of the search space according to the evaluation result; update the structure parameters of the search space until the objective function converges; and take the updated structure parameters of the search space when the objective function converges as the optimized structure parameters of the search space.
[0160] In some embodiments, the generating module 5553 is further configured to perform mapping processing on the optimized structure parameters of the search space to obtain sampling probabilities corresponding to local structures in each search block in the search space; take a local structure corresponding to a maximum sampling probability of the local structures in each search block as a local structure of a candidate network structure for performing multi-task prediction; and combine the local structures of each candidate network structure to obtain the multi-task learning model.
[0161] The above merely illustrates the embodiments of the present application, but should not be used to limit the protection scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and range of the present application shall be included in the protection scope of the present application.
Claims
1. A method for constructing a multi-task learning model, characterized in that, A server applied to a recommendation system, the method comprising: receiving news sample data of a news recommendation application sent by a terminal; between an input node and a plurality of task nodes, a search space composed of a plurality of sub-network layers and a plurality of search layers is constructed by interleaving the sub-network layers and the search layers; the search space enumerates the correspondence between the sub-network modules in the sub-network layers and the multi-tasks, and the multi-tasks include a task of predicting the click rate of the news sample data and a task of predicting the completion degree of the news sample data; mapping the structure parameters of the search space to obtain the sampling probability of the local structure in each search block in the search space; according to the sampling probability, a multinomial distribution of each search block is constructed; the multinomial distribution is sampled to obtain the local structure corresponding to each search block; and a path from the input node to each task node via the local structure is taken as a candidate network structure; According to the news sample data, the parameters of the candidate network structure are trained to generate a multi-task learning model for multiple recommendation predictions, wherein the input of the input node in the multi-task learning model is the news sample data, and the output of the task node in the multi-task learning model is the prediction result for the news sample data, wherein the prediction result includes the click rate and the completion degree of the news sample data; The click rate and the completion degree of the news are estimated by the trained multi-task learning model, the recommended news is determined according to the click rate and the completion degree of each news, and personalized news recommendation is performed through a news client.
2. The method of claim 1, wherein, Before the search space composed of multiple sub-network layers and multiple search layers is constructed, it includes: sampling the outputs of the plurality of sub-network modules in the sub-network layer to obtain the outputs of the plurality of sub-network modules; According to the weight of each sub-network module in the plurality of sub-network modules, the outputs of the plurality of sub-network modules are weighted and summed, and the result of the weighted summation is taken as the output of the local structure in the search block to construct the transmission path in the search block, wherein the search block is a module in the search layer adjacent to the sub-network layer.
3. The method of claim 2, wherein: the search block further comprises a gating node; after the sampling processing of the outputs of the plurality of sub-network modules in the sub-network layer, it further includes: sampling a signal source from a signal source set of the sub-network layer, the signal source being the output of the input node or the output of the predecessor sub-network module of the sub-network layer; predicting the signal source through the gate to obtain the prediction value of each sub-network module in the plurality of sub-network modules; normalizing the prediction value of each sub-network module to obtain the weight of each sub-network module.
4. The method of claim 3, wherein: the search space includes N sub-network layers and N search layers, wherein N is a natural number greater than 1. The method comprises the following steps of: Before constructing the search space composed of multiple sub-network layers and multiple search layers, the following steps are included: sampling the outputs of multiple sub-network modules from the first sub-network layer through the i-th search block in the first search layer, wherein i is a natural number, and when the signal source is the output of the input node, performing weighted summation on the outputs of the multiple sub-network modules according to the weights of the sub-network modules, taking the result of the weighted summation as the output of the local structure in the i-th search block, and constructing the transmission path in the i-th search block until the construction of the transmission paths of all local structures in the i-th search block is completed; sampling the outputs of multiple sub-network modules from the j-th sub-network layer through the i-th search block in the j-th search layer, wherein 1 when the signal source is the output of the input node or the output of the predecessor sub-network module of the j-th sub-network layer, performing weighted summation on the outputs of the multiple sub-network modules according to the weights of the sub-network modules, taking the result of the weighted summation as the output of the local structure in the i-th search block in the j-th search layer, and constructing the transmission path in the i-th search block in the j-th search layer until the construction of the transmission paths of all local structures in the i-th search block in the j-th search layer is completed.
5. The method of claim 1, wherein when the successor node of the search layer is a sub-network module in the sub-network layer, the output of the search block in the search layer is the input of the sub-network module; 6. The method of claim 1, wherein, when the successor node of the search layer is the task node, the output of the search block in the search layer is the input of the task node. The method comprises the following steps of: taking the transmission paths from the input node to the first sub-network layer, the transmission paths from the intermediate sub-network layer to the adjacent search layer, and the transmission path from the last search layer to the task node as edges of a directed graph; taking the sub-network modules in the multiple sub-network layers and the search blocks in the multiple search layers as nodes of the directed graph; 7. The method of claim 1, wherein, combining the nodes and edges of the directed graph to construct the search space for multi-task learning. The method comprises the following steps of: training the network parameters of the candidate network structure to obtain the optimized network parameters of the candidate network structure; training the structure parameters of the search space according to the optimized candidate network structure to obtain the optimized structure parameters of the search space; 8. The method of claim 7, wherein, determining the candidate network structure for performing multiple recommendation predictions from each optimized candidate network structure according to the optimized structure parameters of the search space, so as to serve as the multi-task learning model. The method comprises the following steps of: performing multi-task prediction processing on the recommendation sample data through the candidate network structure to obtain the multi-task prediction results; and training the network parameters of the candidate network structure to obtain the optimized network parameters of the candidate network structure. construct a loss function of the candidate network structure according to the prediction result of the multi-task and the multi-task label of the recommended sample data; update the network parameters of the candidate network structure until the loss function converges, and use the updated parameters of the candidate network structure when the loss function converges as the network parameters of the optimized candidate network structure.
9. The method of claim 7, wherein, The training of the structure parameters of the search space according to the optimized candidate network structure comprises: performing evaluation processing on the optimized candidate network structure through the recommended sample data to obtain an evaluation result of the optimized candidate network structure; constructing a target function of the structure parameters of the search space according to the evaluation result; updating the structure parameters of the search space until the target function converges, and using the updated structure parameters of the search space when the target function converges as the structure parameters of the optimized search space.
10. The method of claim 7, wherein, The determination of the candidate network structure for performing multiple recommendation predictions from each optimized candidate network structure according to the structure parameters of the optimized search space to serve as the multi-task learning model comprises: performing mapping processing on the structure parameters of the optimized search space to obtain a sampling probability of a local structure in each search block in the search space; using the local structure corresponding to the maximum sampling probability of the local structure in each search block as the local structure of the candidate network structure for performing multiple recommendation predictions; combining the local structures of each candidate network structure to obtain the multi-task learning model.
11. An apparatus for constructing a multi-task learning model, comprising: A server applied to a recommendation system, the device comprising: a construction module configured to receive news sample data of a news recommendation application sent by a terminal, and construct a search space composed of a plurality of sub-network layers and a plurality of search layers by interlacing the plurality of sub-network layers and the plurality of search layers between an input node and a plurality of task nodes; the search space enumerates a correspondence between sub-network modules in the sub-network layers, between the sub-network modules and multi-tasks, the multi-tasks including a task of predicting a click rate of the news sample data and a task of predicting a completion degree of the news sample data; a sampling module configured to perform mapping processing on structure parameters of the search space to obtain a sampling probability of a local structure in each search block in the search space, construct a multinomial distribution of each search block according to the sampling probability, perform sampling processing on the multinomial distribution to obtain a local structure corresponding to each search block, and use a path from the input node to each task node via the local structure as a candidate network structure. The generating module is configured to train parameters of the candidate network structure according to the news sample data, to generate a multi-task learning model for performing a plurality of recommendation predictions, wherein an input of the input node in the multi-task learning model is the news sample data, and an output of the task node in the multi-task learning model is a prediction result for the news sample data, wherein the prediction result includes a click rate and a completion rate of the news sample data; the click rate and the completion rate of the news are estimated through the trained multi-task learning model, recommended news is determined according to the click rate and the completion rate of each news, and personalized news recommendation is performed through a news client.
12. An electronic device, comprising: The electronic device includes: a memory for storing executable instructions; a processor for executing the executable instructions stored in the memory, and implementing the method for constructing a multi-task learning model according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The executable instructions are stored in the memory and are configured to cause the processor to implement the method for constructing a multi-task learning model according to any one of claims 1 to 10 when executed by the processor.
14. A computer program product comprising computer-executable instructions or a computer program, characterized in that, The computer executable instructions or the computer program are executed by the processor to implement the method for constructing a multi-task learning model according to any one of claims 1 to 10.