A joint training method and system for search recommendation tasks based on a large language model

By jointly training large language models and domain-specific models, we can solve the data sparsity and negative migration problems of large language models in personalized recommendation and search tasks, realize the complementarity of information across systems and across tasks, and improve the performance and robustness of recommendation and search systems.

CN120104862BActive Publication Date: 2025-08-08PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411979746.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-08-08
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The existing large language models have problems of data sparsity and insufficient domain knowledge in personalized recommendation and search tasks, and negative migration is prone to multi-task optimization, which fails to fully utilize the information sharing potential between recommendation and search tasks.

Method used

By jointly training large language models and multiple domain-specific models, the knowledge and reasoning capabilities of the large model are used to share information among different tasks, combined with domain knowledge pre-training and domain task fine-tuning, the information complementarity between cross-systems and cross-tasks is achieved, and the deep mutual distillation algorithm and general domain gated network are used to solve negative migration problems, enhancing the performance of the model in personalized recommendation and search tasks.

Benefits of technology

Effectively alleviate the problem of sparse data, improve the accuracy and robustness of recommendation and search systems, reduce the impact of negative migration, improve the overall performance of multitasking, and enhance the optimization capabilities of cross-domain recommendation and search systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104862B_ABST
    Figure CN120104862B_ABST
Patent Text Reader

Abstract

The present invention discloses a joint training method and system for search and recommendation tasks based on a large language model, which belongs to the field of artificial intelligence and data science. The present invention realizes cross-system and cross-task information complementarity by jointly training multiple domain-specific systems with a unified large model, combining domain knowledge pre-training with domain task fine-tuning, effectively alleviating the data sparsity problem and improving the execution efficiency of recommendation and search tasks. In addition, the unified large model further reduces the impact of negative transfer and improves the performance in multi-task processing by integrating business knowledge from multiple fields. The present invention not only provides a new approach to solving the data sparsity problem, but also provides an effective technical means for optimizing cross-domain recommendation and search systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence and data science, and in particular to a joint training method and system for search recommendation tasks based on a large language model (LLM). Technical Background

[0002] With the surge in information, personalized recommendation and search systems have been widely used in a variety of practical fields, including e-commerce, news media, and online recruitment. However, personalized recommendation and search systems often face the problem of data sparsity, especially in scenarios such as the emergence of new users and new items. In this context, large language models (LLMs) have gradually become an effective tool for addressing data sparsity due to their extensive knowledge base and reasoning capabilities. Large models have achieved remarkable results in multiple tasks, including text generation, text classification, and logical reasoning. Recently, some studies have attempted to apply large models to personalized recommendation and search tasks and have made some progress. By designing appropriate prompt words, the capabilities of large models can be directly utilized to handle recommendation tasks, such as sequential recommendation.

[0003] The introduction of large models serves two main purposes. First, large models can be used as content recommendation systems, directly handling recommendation tasks through their emerging capabilities. Second, large models can also leverage their powerful knowledge and reasoning capabilities to support domain-specific models, thereby improving the performance of recommendation systems. Taking the job recommendation scenario as an example, the InstructRec method uses a sequential fine-tuning method to further improve the recommendation capabilities of the large model by fine-tuning it. The LGIR method leverages the summarization and reasoning capabilities of the large model to generate new user resumes based on the user's resume and historical interactive job descriptions, thereby improving personalized job recommendations.

[0004] However, existing large models still face some problems when applied to domain-specific tasks. On the one hand, existing general-purpose LLMs lack sufficient domain knowledge. Although large models perform well in tasks such as movie recommendations, the lack of domain knowledge limits the reasoning ability of large models in more professional recommendation scenarios (such as online recruitment). On the other hand, although some studies have attempted to use large models to handle multiple related domain tasks simultaneously, there is still a lack of research on solving personalized search tasks and personalized recommendation tasks simultaneously. These two tasks share the same user, item, and domain information. Therefore, being able to share information within the same business can not only break through information barriers but also alleviate the problem of data sparsity. However, there is a negative transfer phenomenon in multi-task optimization problems. That is, when optimizing multiple tasks simultaneously, as the performance of one or several tasks improves, the performance of other tasks may not continue to improve, or may even decline. This is determined by the complex and conflicting correlations between multiple tasks and needs to be solved urgently.

[0005] In summary, the introduction of large language models provides new opportunities for research in personalized recommendation and search systems. Large models can not only directly undertake recommendation tasks but also, through their powerful knowledge and reasoning capabilities, support the performance improvement of domain-specific models. Existing research has primarily focused on optimizing single tasks and has yet to fully explore the potential for information sharing between recommendation and search tasks. Therefore, within the same business scenario, how to comprehensively leverage the multi-task learning capabilities of large models to further improve the overall performance of recommendation and search systems, address data sparsity and insufficient domain knowledge, and solve the problem of negative transfer in multi-task training, remains a pressing technical challenge. Summary of the Invention

[0006] To overcome the limitations of existing technologies for personalized recommendation and search tasks, this paper proposes a joint training method and system for search and recommendation tasks based on a large language model. By jointly training a large model with multiple domain-specific models, this method leverages the knowledge and reasoning capabilities of the large model to share information across different tasks, effectively alleviating data sparsity and improving the accuracy and robustness of recommendation and search systems. Furthermore, it addresses the negative transfer phenomenon that can occur during joint multi-task training.

[0007] To achieve the above objectives, the technical solution of the present invention includes the following contents.

[0008] A joint training method for search and recommendation tasks based on a large language model, the method comprising:

[0009] Construct a search task training dataset, a recommendation task training dataset, and a natural language vocabulary V for pre-training large models; wherein the search task training dataset includes: user ID, search query instruction, item ID, and domain-specific system S for performing search tasks search The user-item interaction matrix H in search The recommendation task training data set includes: user ID, item ID and domain-specific system S for performing recommendation tasks rec The user-item interaction matrix H in rec ;

[0010] Generate domain-specific system S task Domain embedding representation of user ID in and domain embedding representation of item ID Among them, task∈[search, rec];

[0011] Embed the user ID, search query command and item ID into the prompt template C search , embed the user ID and item ID into the prompt template C rec After that, the template C will be promptedtask , domain embedding representation and domain embedding representation Input into the large model and combine it with the natural language vocabulary V and the user-item interaction matrix H task , get the large model loss L llm ;

[0012] Extract the large model according to the prompt template C task The generated top feature vector The top feature vector Input field dedicated system S task , and combined with the domain embedding representation of user ID and domain embedding representation of item ID Get domain-specific system S task loss Among them, the input field dedicated system S search The top eigenvector of Include: User Context C u The top eigenvector of Item Context C i The top eigenvector of and the top feature vector X of the search query instruction q , input domain-specific system S rec The top eigenvector of Include: User Context C u The top eigenvector of and item context C i The top eigenvector of

[0013] Based on the total loss of large models and domain-specific systems S task Update the parameters to obtain the trained large model and domain-specific system S task ; Wherein, the total loss includes: large model loss L llm and domain-specific systems S task loss

[0014] Furthermore, the prompt template C task , domain embedding representation and domain embedding representation Input into the large model and combine it with the natural language vocabulary V and the user-item interaction matrix H task , get the large model loss L llm ,include:

[0015] Build a vocabulary W and combine it with the vocabulary W to generate a prompt template C task Embedding vector of The vocabulary W includes: the natural language embedding matrix V of the natural language vocabulary V e , user ID vocabulary U tok User embedding matrix and item ID vocabulary I tok The item embedding matrix

[0016] Based on embedding vector Get the probability distribution z of the large model predicting the next word in the vocabulary W task ;

[0017] Based on the probability distribution z task and the user-item interaction matrix H task , obtain the loss of the large model performing search or recommendation tasks

[0018] The loss of a comprehensive large model for search and recommendation tasks Get the large model loss L llm .

[0019] Further, generate prompt template C task Embedding vector of include:

[0020] Construct user ID vocabulary U tok User embedding matrix Item ID Vocabulary I tok The item embedding matrix And the natural language embedding matrix V of the natural language vocabulary V e ;

[0021] Concatenate the natural language embedding matrix V e , user embedding matrix and item embedding matrix Get the matrix W e ;

[0022] Prompt Template C task The information in is one-hot encoded, and based on the one-hot encoding result and the matrix W e , get the embedding vector

[0023] Furthermore, a domain-specific system S task Field embedding representation of user ID in and domain embedding representation of item ID To initialize the user embedding matrix and item embedding matrix And based on the user embedding representation u eand item embedding representation i e Make updates;

[0024] Generate the user embedding representation u e and the item embedding representation i e The process includes:

[0025] Based on prompt template C task , generating a large model embedding representation of the user ID and item ID embedding representation And generate the embedding vector tid of the task ID;

[0026] Embedding large models into representations Domain Embedding Representation The embedded vector tid is input into the fully connected layer and combined with the Sigmoid activation function to generate the user's general-domain combination weight α u ;

[0027] According to the user's general-domain combination weight α u Embedding representations for large models and domain embedding representation Perform weighted calculation to obtain the user embedding representation u e ;

[0028] Embedding large models into representations Domain Embedding Representation The embedded vector tid is input into the fully connected layer and combined with the Sigmoid activation function to generate the general-domain combination weight α of the item i ;

[0029] According to the general-domain combined weight α of the item i Embedding representations for large models and domain embedding representation Perform weighted calculation to obtain the item embedding representation i e .

[0030] Furthermore, the total loss also includes: distillation loss of large model and domain-specific systems S task Distillation loss

[0031] Get the distillation loss of the large model and the domain-specific system S task Distillation loss The process includes:

[0032] Embedding user items into representations for large models and domain-specific systems S taskThe user item embedding representation of the large model is alternately input into the mutual distillation module; wherein the user item embedding representation of the large model includes: the large model embedding representation and large model embedding representations The domain-specific system S task The user-item embedding representation includes: domain embedding representation and domain embedding representation The mutual distillation module is used to achieve cross-model and cross-task information sharing;

[0033] Combined with the user embedding M of the current mutual distillation module u and item embedding M i , get the distillation loss of the large model and domain-specific systems S task Distillation loss

[0034] Furthermore, the top feature vector Input field dedicated system S task , and combined with the domain embedding representation of user ID and domain embedding representation of item ID Get domain-specific system S task loss include:

[0035] The top feature vector is transformed through the bidirectional Transformer layer Encode and obtain bidirectional knowledge features

[0036] Use the fully connected layer to realize the bidirectional knowledge features Perform pooling to obtain the knowledge feature vector E C ; Wherein, the knowledge feature vector E C Includes: User knowledge feature vector Item knowledge feature vector and search feature vector E q ;

[0037] The knowledge feature vector E C , domain embedding representation of user ID and domain embedding representation of item ID Merge and obtain the predicted label between user ID and item ID based on the merged output vector

[0038] According to the predicted label and the user-item interaction matrix H task , computing field dedicated system S task loss

[0039] Furthermore, the user ID, search query instruction and item ID are embedded into the prompt template C search , embed the user ID and item ID into the prompt template C rec Previously, it also included:

[0040] Based on domain-specific system S search and domain-specific systems S rec Fine-tune large models with data from different vendors.

[0041] A large language model-based joint training system for search and recommendation tasks, comprising:

[0042] The data acquisition module is used to construct a search task training data set, a recommendation task training data set, and a natural language vocabulary V for pre-training large models; wherein the search task training data set includes: user ID, search query instruction, item ID, and domain-specific system S for performing search tasks search The user-item interaction matrix H in search The recommendation task training data set includes: user ID, item ID and domain-specific system S for performing recommendation tasks rec The user-item interaction matrix H in rec ; Generate domain-specific system S task Domain embedding representation of user ID in and domain embedding representation of item ID task∈[search,rec];

[0043] Large model loss calculation module, used to embed user ID, search query instruction and item ID into prompt template C search , embed the user ID and item ID into the prompt template C rec After that, the template C will be prompted task Input into the large model and combine it with the natural language vocabulary V and the user-item interaction matrix H task , get the large model loss L llm ;

[0044] Domain-specific system loss calculation module, used to extract large models according to the prompt template C task The generated top feature vector The top feature vector Input field only

[0045] System S task , and combined with the domain embedding representation of user ID and domain embedding representation of item ID Get domain-specific system S task loss Among them, the input field dedicated system S search The top eigenvector of Include: User Context C u The top eigenvector of Item Context C i The top eigenvector of and the top feature vector X of the search query instruction q , input domain-specific system S rec The top eigenvector of Include: User Context C u The top eigenvector of and item context C i The top eigenvector of

[0046] Parameter update module for comparing large models with domain-specific systems S based on total loss task Update the parameters to obtain the trained large model and domain-specific system S task ; Wherein, the total loss includes: large model loss L llm and domain-specific systems S task loss

[0047] A search recommendation method based on a large language model, characterized in that the method includes:

[0048] The user ID is input into the trained domain-specific system S in the joint training method for search recommendation tasks based on a large language model according to any of the above items. task , to obtain the item search results or item recommendation results for the user ID;

[0049] or,

[0050] Embed the user ID, search query command and item ID into the prompt template C search , and the prompt template C search Inputting the trained large model in the joint training method for search recommendation tasks based on a large language model according to any of the above items to obtain item search results generated by the user ID;

[0051] or,

[0052] Embed the user ID and item ID into the prompt template C rec , and prompt template C rec The trained large model is input into the joint training method for search recommendation tasks based on a large language model according to any of the above items to obtain the item recommendation result generated by the user ID.

[0053] An electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements any of the above-mentioned joint training methods for search recommendation tasks based on a large language model or the above-mentioned search recommendation method based on a large language model.

[0054] Compared with the existing technology, the present invention proposes a joint training method and system for search and recommendation tasks based on a large language model, which breaks through the limitations of traditional domain-specific systems in data sparsity and cross-domain information sharing. Unlike existing single-task training methods, the present invention achieves cross-system and cross-task information complementarity by jointly training multiple domain-specific systems with a unified large model, combining domain knowledge pre-training with domain task fine-tuning, effectively alleviating the data sparsity problem and improving the execution efficiency of recommendation and search tasks. In addition, the unified large model further reduces the impact of negative transfer by integrating business knowledge from multiple fields, thereby improving performance in multi-task processing. The present invention not only provides a new approach to solving the data sparsity problem, but also provides an effective technical means for optimizing cross-domain recommendation and search systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 Training flowchart for the joint training method for search and recommendation tasks based on large language models.

[0056] Figure 2 Diagram of the training device architecture for the joint training method for search and recommendation tasks based on large language models.

[0057] Figure 3 Schematic diagram of a joint reasoning system consisting of a domain-specific system and a large language model.

[0058] Figure 4 This is the prompt word template that corresponds to the system when using a large model for search and recommendation tasks.

[0059] Figure 5 Schematic diagram of the general domain gating network proposed by the system to solve the negative transfer problem during multi-task training.

[0060] Figure 6 A bidirectional knowledge vector pooling network proposed when the system is a dedicated system for the training domain.

[0061] Figure 7 The figure is a flowchart of the joint reasoning system composed of a domain-specific system and a large language model during the reasoning application stage.

[0062] Figure 8 Schematic diagram of the joint reasoning system consisting of a domain-specific system and a large language model in the reasoning application stage.

[0063] Figure 9 Examples of different domain-specific systems used by the system. DETAILED DESCRIPTION

[0064] The present invention will be further described in detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.

[0065] The overall structure of the present invention is composed of a domain-specific system (a search task-specific domain system, a recommendation task-specific domain system) and a large model system.

[0066] Domain-specific systems specialize in personalized recommendation and search tasks, processing user needs through their respective domain-specific systems. The recommendation-specific domain system calculates prediction scores based on user and item characteristics and makes top-K recommendations. The search-specific domain system matches user queries with information about related items and predicts the probability of interaction between the user and the corresponding item. Domain-specific systems can independently perform reasoning based on a pre-stored knowledge feature database output by a large model, maintaining high efficiency and reducing reliance on the large model during reasoning.

[0067] The large model system is a large language model fine-tuned using domain-specific data. It integrates business knowledge from multiple domains through a multi-task joint training framework. The large model provides cross-system knowledge sharing and information complementarity, supporting efficient execution of personalized recommendations and search tasks. Furthermore, the large model regularly updates its knowledge feature database, ensuring that domain-specific systems can effectively leverage the latest business knowledge for reasoning.

[0068] like Figure 1 、 Figure 2 and Figure 3 As shown, the joint training method for search recommendation tasks based on a large language model of the present invention includes: a training data preparation stage, a large model fine-tuning stage, and a large model and domain-specific system joint training stage, etc.

[0069] 1. Training data stage.

[0070] The data required for the present invention include constructing a search task training data set, a recommendation task training data set, and a natural language vocabulary V for pre-training a large model. The search task training data set mainly includes user ID, search query instructions, item ID, and a domain-specific system S for executing the search task. search The user-item interaction matrix H in search , the recommendation task training dataset includes: user ID, item ID and domain-specific system S that performs the recommendation task rec The user-item interaction matrix H in rec In addition, context information C of each user and item needs to be prepared u 、Ci For each interaction, a prompt word instruction C can be generated based on the relevant information of the user, item, or user, item and query. task , input to the large language model.

[0071] Specifically, in order to train the recommendation subsystem and the search subsystem, we first need to prepare the input data of users and items. Let the user set U = {u1, ..., u N} and item set I = {i1, ..., i M}, where N is the number of users and M is the number of items. According to the requirements of personalized recommendation tasks, an interaction matrix can be constructed through the interaction records between users and items. It is defined as follows:

[0072]

[0073] Similarly, for the personalized search task, user u performs a search query q and then interacts with item i. The set of search queries of all users is denoted as Q = {q1, ..., q S}, where S is the number of queries. The interaction records between users and items can be represented as an interaction matrix It is defined as follows:

[0074]

[0075] In addition, each user and item has context information. Taking the online recruitment scenario as an example (other recommendation scenarios are similar, and the present invention is not limited to a specific application scenario), the user's context information mainly refers to his resume C u , while the contextual information of the item mainly refers to the job description C i For each interaction, a prompt instruction C can be generated based on the relevant information of the user, item and query task (English: Prompt) is used to input into large language models, such as Figure 4 shown.

[0076] 2. Large model fine-tuning stage.

[0077] During the large-model fine-tuning stage, the present invention samples data from the recommendation and search field-specific systems, prepares training data, labels, and corresponding prompt words for the fine-tuning stage, and then completes the fine-tuning of the large model based on the above-mentioned sampled data.

[0078] 3. Joint training phase of large models and domain-specific systems.

[0079] The total loss of joint training of large models and domain-specific systems mainly includes the large model loss L llm and domain-specific systems S taskloss However, in an optional embodiment, in order to achieve information complementarity between multiple domain-specific systems and the large model, the total loss also includes the distillation loss of the large model and domain-specific systems S task Distillation loss The following describes the technical solution for joint training based on the above optional embodiments.

[0080] Step 3.1: Jointly train the embedding representations of the large model and the domain-specific system using mutual distillation.

[0081] This paper proposes a collaborative training method based on the deep inter-distillation algorithm to achieve information complementarity between multiple domain-specific systems and a large model. By leveraging the common structure of user and item embedding vectors, the algorithm can effectively jointly train the large model and multiple domain models, thereby improving the performance of personalized recommendation systems.

[0082] Specifically, the present invention introduces an information sharing module ML. During the training process, the large model and the domain-specific system will alternately update the parameters in the information sharing module, including the user embedding M u and item embedding M i To further constrain the differences in embedding vectors between models, this paper introduces the mutual distillation loss The calculation formula is as follows:

[0083]

[0084] Among them, m∈{LLM,rec,search}, respectively represent the large model, the recommendation domain-specific system and the search domain-specific system, and Represent the user and item embedding vectors in each model respectively, Denotes the mean square error loss function. Through the above steps, the present invention can effectively transfer knowledge between specialized systems in different fields, promote the improvement of model performance, and avoid potential training problems caused by data mismatch.

[0085] Step 3.2: Fine-tune the large model with a general domain gating network, while solving the negative transfer problem in multi-task training.

[0086] This paper proposes an innovative solution to the complex and conflicting correlation problems in multi-task learning. Since shared parameters in the model may lead to negative transfer, that is, when optimizing certain tasks, the performance of other tasks may decline, thus affecting the effect of the overall model. Therefore, this paper proposes a universal domain gating network that divides the model parameters into universal parameters and domain parameters to avoid the negative transfer problem between multiple tasks. Figure 5 As shown in the figure, domain parameters are represented by red and green, while universal parameters are represented by blue. When multiple tasks jointly optimize the same model through backpropagation of a neural network, the universal domain gating network strengthens the common information between multiple tasks by optimizing the universal parameters, while focusing on the characteristic information of each task by optimizing the domain parameters, effectively alleviating the negative transfer problem.

[0087] In the multi-task learning framework of the present invention, the advantages of domain-specific systems and large models are combined. The embedding of the domain-specific system is used as a domain parameter, while the embedding of the large model is used as a universal parameter. The two are integrated through a universal-domain gating network. The domain-specific system focuses on extracting task-specific features on a single task, while the large model mines common features between tasks through multi-task training. In this way, not only the convergence speed of the model is accelerated, but also the shared information between tasks can be maximized, thereby reducing the impact of the negative transfer problem.

[0088] Specifically, the present invention combines the embedding vectors of domain-specific systems and large models Together with the task ID information tid, it is input into the gating network, where task∈{rec,search}. This gating network consists of fully connected layers and a sigmoid activation function to calculate the general-domain combination weight α. The embedding vectors of the domain-specific system and the large model are then weighted summed according to the calculated combination weight to obtain the final embedding vector. This process can be formally expressed as:

[0089]

[0090] Among them, σ represents the Sigmoid function, u e and i e They represent the embedding vectors of users and items after passing through the gating network, tid represents the embedding vector corresponding to the task ID, that is, the recommendation task or search task, and FC represents the fully connected layer.

[0091] Step 3.3: Unify user and item embeddings to enable information sharing across models and multiple tasks.

[0092] Existing recommendation system methods have certain limitations when distinguishing between users and items. Traditional recommendation systems use identifiers "uid_1" and "iid_2" to distinguish between users and items. However, according to the word segmentation principle of the large language model, these identifiers will be decomposed into multiple sub-word units (English: token). For example, "uid_1" will be decomposed into ["uid", "_", "1"], thereby losing the ability to distinguish. Therefore, relying solely on identifiers is not enough for recommendation algorithms based on large language models to generate accurate personalized predictions. The present invention enhances the performance of large language models in personalized recommendation tasks by introducing a method of domain-specific word lists. Through these special tags, the large language model can better identify and distinguish between users and items. In addition, the present invention also proposes to effectively integrate non-text domain information into the large model by preloading and fine-tuning the embedding vectors of these special word lists.

[0093] Specifically, let the natural language vocabulary of the large language model be V and the user ID vocabulary be U tok (from <uid1>arrive <uidn>), the item ID vocabulary is I tok (from <iid1>arrive <iidm>). The new vocabulary of the training device is defined as W = V∪U tok ∪I tok The training device uses a hybrid embedding layer to embed the domain-specific vocabulary of users and items into the calculation of the large model. The embedding matrices of users and items are expressed as and The embedding matrix and The elements in are respectively the embedding vector u e and i e For prompt instruction C task =[w1, ..., w k ],w j ∈W, the prompt instruction C is obtained by the following method task The corresponding embedding vector

[0094]

[0095]

[0096] Among them, concat represents vector concatenation operation, one_hot represents single hot encoding, V e Represents the word vector of the large model natural language vocabulary, and the embedding matrix W e Contains embedding representations of all natural language, item IDs, and user IDs This ensures their unique contribution in the decision-making space.

[0097] However, training the hybrid embedding layer faces several challenges. First, unlike other parameters in the large model, the domain-specific vocabulary has not been pre-trained on massive amounts of data. Therefore, it is difficult to converge during supervised fine-tuning training and to adapt to the parameters of the large model that has been pre-trained on massive amounts of text. Second, in real-world recommender system scenarios, the number of users and items is typically very large, so training these newly introduced special word vectors from scratch requires a large amount of training data and computing resources.

[0098] This paper adopts the user and item embedding vectors ( and ) to initialize and This method can not only accelerate the convergence speed of newly added special word vectors, but also pass non-text domain information (such as user collaborative behavior pattern information) extracted by domain-specific systems to the large language model, thereby improving the overall effect of the recommendation system.

[0099] Through the above steps, the present invention integrates effective domain information into personalized recommendation prompts, which can significantly improve the recommendation performance of the large language model system and provide a more accurate and robust foundation for the follow-up.

[0100] Step 3.4: Calculate the large model loss L llm .

[0101] For personalized recommendation tasks and personalized search tasks, the present invention designs corresponding prompt instructions C task Afterwards, the prompt instruction C can be obtained based on steps 3.1 to 3.3 task Embedding vector of And because of how to embed the vector To get the probability distribution Z of the large model predicting the next word on the entire vocabulary W task It is common knowledge in this field. For the convenience of expression, the probability distribution Z task It can be expressed as:

[0102] Z task =LLM(C task )

[0103] Here we take the online recruitment scenario as an example. Figure 4 As shown in the figure, the goals of the two tasks are to predict the interaction probability between users and items, with possible answers of "yes" or "no", denoted as A and B respectively. rec and A search The objective function of supervised fine-tuning training of large language models for personalized recommendation and search tasks can be expressed as:

[0104]

[0105] Therefore, the large model loss of the present invention can be expressed as:

[0106]

[0107] Among them, C task They correspond to the prompt word instructions for personalized recommendation tasks and personalized search tasks respectively. The prompt for personalized recommendation tasks is represented by C rec , including user ID u, user context C u , item ID i and item context C i The hint for the personalized search task is represented as C search , and also includes the query q. task∈{rec,search} represents the recommendation or search task, and softmax(z)[w] represents the predicted probability that the next word is w (here, the probability corresponding to "yes" and "no").

[0108] Through the above steps, the present invention introduces task-specific embedding information when fine-tuning the large model, and combined with the weight adjustment of the gating network, it can effectively promote parameter sharing and domain feature extraction in multi-task learning, thereby improving the performance of personalized recommendation and search tasks, overcoming the negative transfer problem, and enhancing the overall performance of the model.

[0109] Step 3.5: Based on the bidirectional knowledge vector pooling network training recommendation, search domain-specific system, and obtain the domain-specific system S task loss

[0110] The present invention proposes a method to transfer the knowledge and reasoning information of users, items and queries contained in a large model to a domain-specific system. Specifically, the present invention transfers the user context C u , Item Context C i and query q are constructed as instruction input models to obtain their top-level feature vectors, which are expressed as and X q .

[0111] However, unlike traditional language models like BERT, the top-level embeddings of large generative models cannot be used as sentence vectors. In order for domain-specific systems to better utilize the top-level feature vectors of the large model, these vectors need to be integrated to form sentence vectors. Specifically, the embedding vectors output by large generative models are unidirectional, while knowledge information should be bidirectional. Therefore, this structure cannot effectively transfer knowledge vectors to domain-specific systems.

[0112] Therefore, this paper proposes a bidirectional knowledge vector pooling network, which refers to the structure of the BERT model and adopts a bidirectional encoding method to better capture knowledge information. Through the bidirectional Transformer layer, knowledge information is integrated from the top embedding vector output by the large model, such as Figure 6 Specifically, the top feature vector of the large model is Input into the bidirectional Transformer network of layer b to extract bidirectional knowledge features Where L and K represent the length of the sentence and the dimension of the large model feature vector respectively. Then, the fully connected layer is used for pooling to obtain the knowledge feature vector E c The process can be formally expressed as:

[0113] X b =bi_transformers(X t )

[0114] E c =FC(X b )

[0115] Where bi_transformers represents a bidirectional Transformer network with layer b. For personalized recommendation and search tasks, the objective function of the domain-specific system can be expressed as:

[0116]

[0117] Among them, task∈{rec,search}, DM represents the domain-specific system (English: Domain-SpecificModel).

[0118] Through the above steps, the present invention effectively enhances the knowledge representation capability of the domain model, successfully captures the bidirectional dependencies of knowledge information, and generates more accurate knowledge feature vectors through pooling operations. These feature vectors can better support domain-specific systems and improve the model's performance in personalized recommendation and search tasks.

[0119] Step 3.6: Calculate the final loss function to optimize the model parameters.

[0120] Through this multi-task learning strategy, the present invention achieves knowledge exchange and collaborative optimization between large models and domain-specific systems. The large model can obtain key information, such as user collaborative behavior patterns, from the domain-specific system, while the domain-specific system can fully benefit from the knowledge and reasoning capabilities provided by the large model. More importantly, the synergy between search and recommendation tasks effectively alleviates data sparsity and promotes information complementarity and sharing.

[0121] The total loss function of multi-model multi-task learning integrates the optimization objectives between each task, comprehensively considers the training loss of large models and domain-specific systems, and introduces the mutual distillation loss term to further improve the learning efficiency and accuracy of the model. Specifically, the loss function can be expressed as:

[0122]

[0123] Among them, task∈{rec,search}, γ is the balance parameter of the mutual distillation loss, L llm and Represent the training losses of the large model and the models in each field respectively, and represents the corresponding inter-distillation loss.

[0124] In one embodiment, after the training device trains the system using the objective function, it can also output the trained prototype network (including large models and domain-specific systems) to the execution device (such as a terminal device, edge device, or other target device). In the above embodiment of the present application, how to train the prototype network is specifically explained. The trained network can be sent to the execution device, and the execution device specifically applies the trained prototype network. In this way, the training process and application process of the prototype network are separated, which reduces the amount of calculation on the execution device side and saves the computing power of the execution device.

[0125] In addition, the present invention also discloses a search recommendation method based on a large language model, such as Figure 7 As shown, related devices (such as execution devices or training devices) can make predictions through the trained prototype network. The execution device can use a new model application method. In the application stage, in the joint reasoning system composed of the domain-specific system and the large language model proposed by the present invention, although the large model and the domain-specific system can be trained collaboratively and share information, in order to ensure real-time and high efficiency, the large model and the domain-specific system can operate independently in the reasoning stage, such as Figure 8 As shown. Due to its large number of layers and massive parameters, the large model may cause a significant increase in delay during the reasoning process, so it is not suitable for direct application in some industrial scenarios with high real-time requirements. To avoid this problem, the present invention designs a solution in which the reasoning of the large model only depends on the corresponding task instruction C ui , and can perform reasoning efficiently according to different task types.

[0126] The execution device needs to calculate a prediction score for a given user and item. However, because the output of the large model is natural language, it does not directly generate a prediction score related to ranking. Therefore, this paper proposes a method for calculating the prediction score based on the probability values of "yes" and "no" predicted by the large model. The specific formula is as follows:

[0127]

[0128] "Yes" and "No" represent the output of the large model during inference. By using this prediction score, recommendation algorithms based on large models can effectively solve common recommendation tasks such as top-K recommendations and interaction probability prediction.

[0129] For domain-specific systems, their reasoning process relies on the knowledge feature vector E provided by the large model in the information sharing framework. Cu and E Ci To improve the inference efficiency of domain-specific systems, this paper proposes a pre-computation strategy: large models can pre-compute these knowledge feature vectors during the inference phase and store them in a knowledge feature database. This allows the domain-specific system to perform inference independently, fully leveraging its efficiency advantage for specific tasks.

[0130] There are two main ways to update knowledge feature vectors in large models:

[0131] (1) When users choose a large model as a recommendation system, the knowledge vectors of users and related items will be updated as a by-product during the recommendation process;

[0132] (2) Even if the user does not actively use the big model for recommendation, the knowledge vector will be updated offline regularly so that the performance of the domain-specific system can be improved by the knowledge of the big model.

[0133] By increasing the update frequency of the knowledge vector database, we can effectively alleviate the performance degradation problem caused by the timeliness of knowledge features and ensure that the recommendation system always makes inferences and decisions based on the latest knowledge.

[0134] The specific recommendation and search method to be performed (using a large model or a domain-specific system) depends on the instructions issued by the user to the execution device. Figure 4 Figure 2 shows a schematic diagram of a joint reasoning execution system consisting of a domain-specific system and a large language model. This approach not only enhances the collaboration between the large model and the domain-specific system but also resolves the conflict between the real-time performance of the execution device and inference efficiency. This allows recommendation and search tasks to maintain accuracy while improving inference efficiency, adapting to the real-time demands of industrial applications.

[0135] In summary, the present invention achieves cross-system and cross-task information complementarity by jointly training multiple domain-specific systems with a unified large model, utilizing domain knowledge pre-training and domain task fine-tuning, thereby alleviating the data sparsity problem. The large model integrates business knowledge from multiple fields, supports the efficient execution of personalized recommendations and search tasks, and can also alleviate the impact of negative transfer, thereby improving the performance of large models and domain-specific systems in multi-task (search, recommendation) processing. The method can significantly improve the performance of recommendation systems and search systems, improve data sparsity problems, and enhance the accuracy and robustness of business decisions. The present invention provides an effective technical means for the optimization of cross-domain recommendation systems and search systems.

[0136] The method of the present invention is highly adaptable and applicable to a variety of applications. It effectively combines search and recommendation systems using a large model. The method is intuitive, effective, and easy to use. The method proposed in the present invention is applicable to all application scenarios where search and recommendation tasks can be combined, not just in recruitment scenarios, but also in e-commerce, healthcare, finance, and other scenarios.

[0137] It should be noted that the recommendation subsystem and search subsystem involved in the present invention have no explicit requirements, such as Figure 9 As shown, it can be common recommendation algorithms (such as LightGCN, NCF, etc.) and common search algorithms (such as HEM, IHGNN, JSR, etc.).

[0138] Finally, the method of the present invention is only a preferred embodiment and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.< / iidm> < / uidn>

Claims

1. A joint training method for search and recommendation tasks based on a large language model, characterized in that: The method comprises: Construct a search task training dataset, a recommendation task training dataset, and a natural language vocabulary V for pre-training large models; wherein the search task training dataset includes: user ID, search query instruction, item ID, and domain-specific system S for performing search tasks search The user-item interaction matrix H in search The recommendation task training data set includes: user ID, item ID and domain-specific system S for performing recommendation tasks rec The user-item interaction matrix H in rec ; Generate domain-specific system S task Domain embedding representation of user ID in and domain embedding representation of item ID Among them, task∈[search,rec]; Embed the user ID, search query command and item ID into the prompt template C search , embed the user ID and item ID into the prompt template C rec After that, the template C will be prompted task , domain embedding representation and domain embedding representation Input into the large model and combine it with the natural language vocabulary V and the user-item interaction matrix H task , get the large model loss L llm ; Extract the large model according to the prompt template C task The generated top feature vector The top feature vector Input field dedicated system S task , and combined with the domain embedding representation of user ID and domain embedding representation of item ID Get domain-specific system S task loss Among them, the input field dedicated system S search The top eigenvector of Include: User Context C u The top eigenvector of Item Context C i The top eigenvector of and the top feature vector X of the search query instruction q , input domain-specific system S rec The top eigenvector of Include: User Context C u The top eigenvector of and item context C i The top eigenvector of Based on the total loss of large models and domain-specific systems S task Update the parameters to obtain the trained large model and domain-specific system S task ; Wherein, the total loss includes: large model loss L llm and domain-specific systems S task loss 2. The joint training method for search recommendation tasks based on a large language model according to claim 1, characterized in that: The template C task , domain embedding representation and domain embedding representation Input into the large model and combine it with the natural language vocabulary V and the user-item interaction matrix H task , get the large model loss L llm ,include: Build a vocabulary W and combine it with the vocabulary W to generate a prompt template C task Embedding vector of The vocabulary W includes: the natural language embedding matrix V of the natural language vocabulary V e , user ID vocabulary U tok User embedding matrix and Item ID Vocabulary I tok The item embedding matrix Based on embedding vector Get the probability distribution z of the large model predicting the next word in the vocabulary W task ; Based on the probability distribution z task and the user-item interaction matrix H task , obtain the loss of the large model performing search or recommendation tasks The loss of a comprehensive large model for search and recommendation tasks Get the large model loss L llm .

3. The joint training method for search recommendation tasks based on a large language model according to claim 2, characterized in that: Generate prompt template C task The embedding vector E Ctask ,include: Construct user ID vocabulary U tok User embedding matrix Item ID Vocabulary I tok The item embedding matrix And the natural language embedding matrix V of the natural language vocabulary V e ; Concatenate the natural language embedding matrix V e , user embedding matrix and item embedding matrix Get the matrix W e ; Prompt Template C task The information in is one-hot encoded, and based on the one-hot encoding result and the matrix W e , get the embedding vector 4. The joint training method for search recommendation tasks based on a large language model according to claim 3, characterized in that: Adopting domain-specific system S task Field embedding representation of user ID in and domain embedding representation of item ID To initialize the user embedding matrix and item embedding matrix And based on the user embedding representation u e and item embedding representation i e Make updates; Generate the user embedding representation u e and the item embedding representation i e The process includes: Based on prompt template C task , generating a large model embedding representation of the user ID and item ID embedding representation And generate the embedding vector tid of the task ID; Embedding large models into representations Domain Embedding Representation The embedded vector tid is input into the fully connected layer and combined with the Sigmoid activation function to generate the user's general-domain combination weight α u ; According to the user's general-domain combination weight α u Embedding representations for large models and domain embedding representation Perform weighted calculation to obtain the user embedding representation u e ; Embedding large models into representations Domain Embedding Representation The embedded vector tid is input into the fully connected layer and combined with the Sigmoid activation function to generate the general-domain combination weight α of the item i ; According to the general-domain combined weight α of the item i Embedding representations for large models and domain embedding representation Perform weighted calculation to get the item embedding representation i e .

5. The joint training method for search recommendation tasks based on a large language model according to claim 4, characterized in that: The total loss also includes: distillation loss of large model and domain-specific systems S task Distillation loss Get the distillation loss of the large model and the domain-specific system S task Distillation loss The process includes: Embedding user items into representations and domain-specific systems S for large models task The user item embedding representation of the large model is alternately input into the mutual distillation module; wherein the user item embedding representation of the large model includes: the large model embedding representation and large model embedding representations The domain-specific system S task The user-item embedding representation includes: domain embedding representation and domain embedding representation The mutual distillation module is used to achieve cross-model and cross-task information sharing; Combined with the user embedding M of the current mutual distillation module u and item embedding M i , get the distillation loss of the large model and domain-specific systems S task Distillation loss 6. The joint training method for search recommendation tasks based on a large language model according to claim 1, characterized in that: The top feature vector Input field dedicated system S task , and combined with the domain embedding representation of user ID and domain embedding representation of item ID Get domain-specific system S task loss include: The top feature vector is transformed through the bidirectional Transformer layer Encode and obtain bidirectional knowledge features Use the fully connected layer to realize the bidirectional knowledge features Perform pooling to obtain the knowledge feature vector E C ; Wherein, the knowledge feature vector E C Including: user knowledge feature vector E Cu , item knowledge feature vector and search feature vector E q ; The knowledge feature vector E C , domain embedding representation of user ID and domain embedding representation of item ID Merge and obtain the predicted label between user ID and item ID based on the merged output vector According to the predicted label and the user-item interaction matrix H task , computing field dedicated system S task loss 7. The joint training method for search recommendation tasks based on a large language model according to any one of claims 1 to 6, characterized in that: The user ID, search query instruction and item ID are embedded in the prompt template C search , embed the user ID and item ID into the prompt template C rec Previously, it also included: Based on domain-specific system S search and domain-specific systems S rec Fine-tune large models with data from different vendors.

8. A joint training system for search and recommendation tasks based on a large language model, characterized by: The system comprises: The data acquisition module is used to construct a search task training data set, a recommendation task training data set, and a natural language vocabulary V for pre-training large models; wherein the search task training data set includes: user ID, search query instruction, item ID, and domain-specific system S for performing search tasks search The user-item interaction matrix H in search The recommendation task training data set includes: user ID, item ID and domain-specific system S for performing recommendation tasks rec The user-item interaction matrix H in rec ; Generate domain-specific system S task Domain embedding representation of user ID in and domain embedding representation of item ID Large model loss calculation module, used to embed user ID, search query instruction and item ID into prompt template C search , embed the user ID and item ID into the prompt template C rec After that, the template C will be prompted task Input into the large model and combine it with the natural language vocabulary V and the user-item interaction matrix H task , get the large model loss L llm ; Domain-specific system loss calculation module, used to extract large models according to the prompt template C task The generated top feature vector The top feature vector Input field only System S task , and combined with the domain embedding representation of user ID and domain embedding representation of item ID Get domain-specific system S task loss Among them, the input field dedicated system S search The top eigenvector of Include: User Context C u The top eigenvector of Item Context C i The top eigenvector of and the top feature vector X of the search query instruction q , input domain-specific system S rec The top eigenvector of Include: User Context C u The top eigenvector of and item context C i The top eigenvector of Parameter update module for comparing large models with domain-specific systems S based on total loss task Update the parameters to obtain the trained large model and domain-specific system S task ; Wherein, the total loss includes: large model loss L llm and domain-specific systems S task loss 9. A search recommendation method based on a large language model, characterized in that: The method comprises: The user ID is input into the trained domain-specific system S in the joint training method for search recommendation tasks based on a large language model according to any one of claims 1 to 7. task , to obtain the item search results or item recommendation results for the user ID; or, Embed the user ID, search query command and item ID into the prompt template C search , and the prompt template C search Inputting the trained large model in the joint training method for search recommendation tasks based on a large language model according to any one of claims 1 to 7 to obtain item search results generated by the user ID; or, Embed the user ID and item ID into the prompt template C rec , and prompt template C rec The trained large model is input into the joint training method for search recommendation tasks based on a large language model according to any one of claims 1 to 7 to obtain the item recommendation result generated by the user ID.

10. An electronic device, characterized in that: The electronic device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the joint training method for search recommendation tasks based on a large language model as described in any one of claims 1 to 7 or the search recommendation method based on a large language model as described in claim 9.

Citation Information

Patent Citations

  • Recommendation system model training method and device, electronic equipment and storage medium

    CN116911958A

  • Intelligent agent recommendation system and method based on knowledge enhancement and large model

    CN118467840A