Cross-domain recommendation method, model training method and device

By embedding a domain type encoder and supervised fine-tuning optimization into a large language model, and using user profile data to generate an initial set of recommended objects and perform target domain matching, the problems of data sparsity and feature space inconsistency in cross-domain recommendation are solved, and more accurate and effective recommendations are achieved.

CN122019871APending Publication Date: 2026-05-12BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2026-01-16
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Traditional single-domain recommendation methods face problems of data sparsity and inconsistent feature spaces in heterogeneous domains, resulting in poor cross-domain recommendation performance.

Method used

By acquiring user profile data in the source domain, prompts are generated and input into a large language model. The large language model is then used for deep semantic association to generate an initial set of recommended objects, which are then matched in the target domain. Combined with a domain type encoder and supervised fine-tuning, the model is optimized to improve recommendation accuracy.

Benefits of technology

It eliminates the distribution differences of user characteristics across different domains, improves the accuracy and effectiveness of cross-domain recommendations, avoids invalid recommendations, and enhances recommendation performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019871A_ABST
    Figure CN122019871A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a cross-domain recommendation method and device and a model training method and device. The method comprises the following steps: acquiring user portrait data of a user in at least one source field; generating a first prompt instruction based on the user portrait data, inputting the first prompt instruction into the first large language model, obtaining an initial recommendation object set generated by the first large language model, the first prompt instruction being used for prompting the first large language model to generate an initial recommendation object belonging to the target field according to the user portrait data; matching the candidate objects in a candidate object set of the target field based on the initial recommendation object set to obtain a target recommendation object set, each target recommendation object in the target recommendation object set being a candidate object matched with the initial recommendation object in the candidate object set, the candidate objects in the candidate object set are pre-configured objects which can be recommended. The cross-domain recommendation effect can be improved based on the semantic comprehension ability and the generative retrieval ability of the large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of personalized recommendation technology, and in particular to a cross-domain recommendation method, model training method and apparatus. Background Technology

[0002] With the explosive growth of the Internet and mobile Internet, the amount of information available to users has increased exponentially, and recommendation systems have become a core means of alleviating information overload.

[0003] Traditional recommendation systems rely on user-object interactions, using techniques such as matrix factorization and deep neural networks to learn user preferences and then make similarity-based recommendations within a specific domain. However, when user behavior is distributed across multiple heterogeneous domains such as video, e-commerce, music, and news, single-domain recommendation methods face bottlenecks such as data sparsity and inconsistent feature spaces. To break down these "data silos," cross-domain recommendation frameworks are increasingly being used, leveraging shared features of users in both the source and target domains for object recommendations. However, this approach is limited by the varying distribution of user features across different domains, resulting in unsatisfactory recommendation performance. Summary of the Invention

[0004] In view of this, this application provides a cross-domain recommendation method, a model training method, and an apparatus to improve the cross-domain recommendation effect.

[0005] This application provides the following solution: Firstly, a cross-domain recommendation method is provided, which includes: Obtain user profile data in at least one source domain; The first prompt instruction is generated based on the user profile data and input into the first language model to obtain the initial recommended object set generated by the first language model. The first prompt instruction is used to prompt the first language model to generate initial recommended objects belonging to the target domain based on the user profile data. Based on the initial set of recommended objects, candidate objects are matched in the candidate object set in the target domain to obtain the target set of recommended objects. Each target recommended object in the target set is a candidate object that matches the initial recommended object in the candidate object set. The candidate objects in the candidate object set are pre-configured objects that can be recommended.

[0006] Optionally, based on the initial set of recommended objects, candidate objects are matched in the candidate object set in the target domain to obtain the target set of recommended objects, including: Generate description information for each initial recommendation object in the initial recommendation object set; Each initial recommendation object description is converted into a corresponding initial recommendation object vector representation. Based on the initial recommended object vector representation and the candidate object vector representation corresponding to each candidate object in the candidate object set, similarity retrieval is performed to obtain the target recommended object set.

[0007] Optionally, generate initial recommendation object description information corresponding to each initial recommendation object in the initial recommendation object set, including: Based on each initial recommended object in the initial recommended object set, a second prompt instruction is generated and input into the second language model. The second prompt instruction is used to prompt the second language model to generate the initial recommended object description information corresponding to each initial recommended object. Obtain the description information of each initial recommendation object generated by the second language model.

[0008] Optionally, the description information of each initial recommended object is converted into a corresponding vector representation of the initial recommended object, including: The embedding model is used to convert the description information of each initial recommendation object into a corresponding vector representation of the initial recommendation object.

[0009] Optionally, user profile data includes user attribute data and user behavior data in at least one source domain, with the behavior data including behavior sequences and / or behavior statistics.

[0010] Optionally, the first large language model is a cross-domain recommendation model obtained by embedding a domain type encoder in the backbone network of a pre-trained large language model and performing supervised fine-tuning; or, the first large language model is a cross-domain recommendation model obtained by embedding a domain type encoder in the backbone network of a pre-trained large language model and performing supervised fine-tuning and preference alignment optimization.

[0011] Secondly, a model training method is provided, which includes: An initial model is obtained by embedding a domain type encoder into the backbone network of a pre-trained large language model. The domain type encoder is used to convert the input natural language into a domain identifier vector, which is used to describe the domain to which the natural language corresponds. Acquire multiple first training samples, which include user profile data of sample users in at least one source domain and interaction objects in the target domain; The initial model is fine-tuned under supervision using multiple first training samples to obtain the first large language model for cross-domain object recommendation. In the process of supervised fine-tuning, the first prompt instruction generated based on user profile data is used as the input of the initial model, and the interactive object in the target domain is used as the target output of the initial model. The first prompt instruction is used to prompt the initial model to generate recommended objects belonging to the target domain based on the user profile data.

[0012] Optionally, the method further includes: Based on the recommended objects generated by the first language model, multiple object sample pairs are generated. Each object sample pair includes a positive object sample and a negative object sample. The positive object sample is the object that the user positively feedbacks in the recommended objects generated by the first language model, and the negative object sample is the object that the user negatively feedbacks in the recommended objects generated by the first language model. The first language model is optimized for preference alignment using multiple object samples.

[0013] Optionally, the first large language model is optimized for preference alignment using multiple object samples, including: Based on the first set of sample pairs among multiple object sample pairs, the first stage of preference alignment optimization is performed on the first large language model; Based on the second set of sample pairs in multiple object sample pairs, the first language model obtained by the first stage of preference alignment optimization is optimized in the second stage. The learning difficulty of the first set of sample pairs is lower than that of the second set of sample pairs.

[0014] Thirdly, a cross-domain recommendation device is provided, the device comprising: The acquisition module is used to acquire user profile data for a user in at least one source domain. The generation module is used to generate a first prompt instruction based on user profile data and input the first prompt instruction into the first language model. The first prompt instruction is used to prompt the first language model to generate initial recommended objects belonging to the target domain based on user profile data and to obtain the set of initial recommended objects generated by the first language model. The matching module is used to match candidate objects in the candidate object set in the target domain based on the initial recommended object set to obtain the target recommended object set. Each target recommended object in the target recommended object set is a candidate object in the candidate object set that matches the initial recommended object. The candidate objects in the candidate object set are pre-configured objects that can be recommended.

[0015] Fourthly, a model training device is provided, the device comprising: The model building module is used to embed a domain type encoder into the backbone network of a pre-trained large language model to obtain an initial model. The domain type encoder is used to convert the input natural language into a domain identifier vector, which is used to describe the domain to which the natural language corresponds. The supervised fine-tuning module is used to acquire multiple first training samples, which include user profile data of sample users in at least one source domain and interaction objects in the target domain. The initial model is then fine-tuned using the multiple first training samples to obtain a first language model for cross-domain object recommendation. During the supervised fine-tuning process, a first prompt instruction generated based on the user profile data is used as the input to the initial model, and the interaction objects in the target domain are used as the target output of the initial model. The first prompt instruction is used to prompt the initial model to generate recommended objects belonging to the target domain based on the user profile data.

[0016] Fifthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first or second aspects above.

[0017] Sixthly, an electronic device is provided, comprising: One or more processors; and A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any one of the first or second aspects above.

[0018] A seventh aspect provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of the method described in any one of the first or second aspects above.

[0019] According to the specific embodiments provided in this application, the following technical effects are disclosed: The cross-domain recommendation method provided in this application generates prompts based on user profile data in the source domain and inputs them into a large language model. This allows the large language model to perform deep semantic associations on user profile data from different source domains, capturing the correlations between user preference features across different domains and achieving a deep understanding of the user profile data. Then, based on the generative retrieval capabilities of the large language model, an initial set of recommended objects belonging to the target domain is generated according to this deep understanding of the user profile data. In this way, the powerful semantic understanding and generative retrieval capabilities of the large language model can eliminate the distribution differences of user features across different domains, thereby integrating user behavioral features from different source domains to obtain initial recommended objects and improving the accuracy of cross-domain recommendations. Furthermore, the initial recommended objects can be matched against a candidate object set in the target domain to obtain a final set of target recommended objects. This ensures that the final recommended objects are within the candidate object set, avoiding invalid recommendations and improving the overall effectiveness of cross-domain recommendations. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the implementation environment corresponding to this application.

[0022] Figure 2 This is one of the flowcharts illustrating the cross-domain recommendation method provided in this application embodiment.

[0023] Figure 3 This is the second flowchart illustrating the cross-domain recommendation method provided in this application embodiment.

[0024] Figure 4 This is a flowchart illustrating the model training method provided in an embodiment of this application.

[0025] Figure 5 This is a schematic diagram of the model processing flow provided in the embodiments of this application.

[0026] Figure 6 This is a schematic diagram illustrating preference alignment optimization provided in an embodiment of this application.

[0027] Figure 7 This is a schematic diagram illustrating the composition of the cross-domain recommendation device provided in an embodiment of this application.

[0028] Figure 8 This is a schematic diagram of the composition of the model training device provided in the embodiments of this application.

[0029] Figure 9 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0031] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0032] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0033] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0034] With the explosive growth of the Internet and mobile Internet, the amount of information available to users has increased exponentially, and recommendation systems have become a core means of alleviating information overload.

[0035] Traditional recommendation systems rely on user-object interactions, using techniques such as matrix factorization and deep neural networks to learn user preferences and then make similarity-based recommendations within a specific domain. However, when user behavior is distributed across multiple heterogeneous domains such as video, e-commerce, music, and news, single-domain recommendation methods face bottlenecks such as data sparsity and inconsistent feature spaces. To break down these "data silos," cross-domain recommendation frameworks are increasingly being used, leveraging shared features of users in both the source and target domains for object recommendations. However, this approach is limited by the varying distribution of user features across different domains, resulting in unsatisfactory recommendation performance.

[0036] In view of this, this application provides a cross-domain recommendation method that can generate prompts based on user profile data in the source domain and input them into a large language model. This allows the large language model to perform deep semantic associations on user profile data from different source domains, capturing the correlations between user preference features across different domains and achieving a deep understanding of the user profile data. Then, based on the generative retrieval capabilities of the large language model, an initial set of recommended objects belonging to the target domain is generated according to this deep understanding of the user profile data. Thus, the powerful semantic understanding and generative retrieval capabilities of the large language model can eliminate the distribution differences of user features across different domains, thereby integrating user behavioral features from different source domains to obtain initial recommended objects and improving the accuracy of cross-domain recommendations. Furthermore, the initial recommended objects can be matched against a candidate object set in the target domain to obtain a final target recommended object set. This ensures that the final recommended objects are within the candidate object set, avoiding invalid recommendations and improving the recommendation effect of cross-domain recommendations.

[0037] To facilitate understanding of this application, the implementation environment corresponding to this application will be described first. Figure 1 A schematic diagram of the implementation environment corresponding to this application is shown, such as... Figure 1 As shown, the implementation environment may include: terminal devices and servers.

[0038] Terminal devices can include, but are not limited to, smart mobile terminals, wearable devices, PCs (Personal Computers), and smart home devices. Smart mobile devices can include devices such as mobile phones, tablets, laptops, PDAs (Personal Digital Assistants), and connected car terminals. Wearable devices can include devices such as smartwatches, smart glasses, smart bracelets, VR (Virtual Reality) devices, AR (Augmented Reality) devices, and mixed reality devices (devices that support both virtual and augmented reality). Smart home devices can include devices such as smart TVs and smart assistant devices.

[0039] Terminal devices can interact with servers via a network; for example, a terminal device can send data such as user behavior data to a server.

[0040] A server can be a server that provides related services (such as personalized recommendation services), it can be a single server, a server cluster consisting of multiple servers, or a cloud server.

[0041] It should be understood that Figure 1 The number of terminal devices and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices and servers can be used.

[0042] Figure 2 This is a flowchart illustrating the cross-domain recommendation method provided in an embodiment of this application. The method can be... Figure 1 The terminal device or server shown can execute the command, or both can execute it collaboratively. For example... Figure 2 As shown, the method may include the following S201-S203.

[0043] S201. Obtain user profile data for the user in at least one source domain.

[0044] For example, the source domain can be the domain in which the user interaction scenario takes place, such as including but not limited to video, social media, e-commerce, music, news, search and other fields.

[0045] User profile data can include any user-related data, such as user attribute data and user behavior data in at least one source domain (e.g., behavior sequences and / or behavior statistics). This user profile data provides a relatively comprehensive representation of user behavior characteristics and preferences in the source domain, facilitating subsequent recommendations that match user habits.

[0046] S202. Generate a first prompt instruction based on user profile data and input the first prompt instruction into the first large language model to obtain the initial recommendation object set generated by the first large language model.

[0047] The first prompt instruction is used to instruct the first language model to generate initial recommended objects belonging to the target domain based on user profile data. Thus, the first language model can generate corresponding initial recommended objects based on its generative retrieval capabilities according to the input first prompt instruction. The target domain can be the domain to which the recommended objects belong; for example, the recommended objects can be products, items, video resources, audio resources, image resources, etc., and the corresponding target domain can be the product domain, item domain, video domain, audio domain, image domain, etc., without restriction.

[0048] It should be noted that, in some possible embodiments of this application, the first large language model used to generate the initial set of recommended objects can be a built-in model to prevent the user profile data contained in the first input prompt from being leaked, thereby improving the security of user information.

[0049] For example, the first prompt instruction can be a natural language prompt description generated based on user profile data and preset system prompt words and instruction prompt words. Specifically, the user profile data can first be converted into natural language descriptions to serve as user prompt words, and then the system prompt words, user prompt words, and instruction prompt words can be integrated to generate the first prompt instruction.

[0050] For example, if the target domain for recommendations is the product domain (i.e., the recommended objects are products), and the source domain is the domains where users interact in different scenarios on the short video platform, then the system prompt could be configured as: "You are a user interest prediction expert on a short video platform. You will infer the interests of a short video user based on various comprehensive information I provide about them on the platform. I will provide you with various basic and behavioral information about a short video user on the platform. Please analyze this information comprehensively." Correspondingly, the instruction prompt could be configured as: "Based on the above user's various basic and behavioral information, please predict 10 products that the user may be interested in. Directly provide the product names without any additional descriptions." Based on this, user profile data can first be organized into natural language descriptions such as: "On short video platforms, this user's possible basic user information is as follows: xxx. Among the short videos pushed by the platform, the user's video content preference information is as follows: The video categories with the most views, sorted from highest to lowest, are: xxx; The types of video bloggers followed by the user, sorted from highest to lowest, are: xxx. The user's search and purchase information on the platform is as follows: The user's recent search content is as follows: xxx; The number of times the user recently searched for content categories, sorted from highest to lowest, is: xxx; The information on items recently added to the user's shopping cart is: xxx; The information on items recently purchased by the user is: xxx." This allows us to obtain user suggestion keywords. Then, the system prompts, user prompts, and instruction prompts can be integrated to obtain the first prompt instruction: "You are a user interest prediction expert on a short video platform. You will infer the interests of a short video user based on the comprehensive information I provide about that user on the platform. I will provide you with various basic and behavioral information about a short video user on the platform. Please analyze this information comprehensively. On the short video platform, this user's possible basic information is as follows... Based on the above user's basic and behavioral information, please predict 10 products that the user may be interested in, directly providing the product names without any additional descriptions."

[0051] Of course, the above is only an exemplary description of the first prompt instruction generated based on user profile data. In practical applications, any implementation method based on related technologies can also be used to generate a first prompt instruction that prompts the first language model to generate initial recommended objects belonging to the target domain based on user profile data. No restrictions are imposed here.

[0052] S203. Based on the initial set of recommended objects, match the candidate objects in the candidate object set in the target domain to obtain the target set of recommended objects.

[0053] In this context, the candidate objects in the candidate object set are pre-configured objects that can be recommended, and each target recommended object in the target recommended object set is a candidate object that matches the initial recommended object in the candidate object set. This ensures that the final recommended object comes from the candidate object set, avoiding invalid recommendations and improving the recommendation effect.

[0054] In this embodiment of the application, the candidate object set can be obtained in advance based on the expected situation of the recommended objects or the set of objects in the target domain obtained by other means. The specific settings can be set according to the actual situation, and no restrictions are imposed here.

[0055] In some possible implementations, each initial recommended object in the initial recommended object set and each candidate object in the candidate object set can be directly matched to obtain the target recommended object set.

[0056] In other possible implementations, each initial recommended object in the initial recommended object set can be first converted into a corresponding vector representation. Then, matching can be performed on each initial recommended object and candidate object along the dimension of the vector representation to obtain the target recommended object set. In this way, a deeper similarity matching of the initial recommended objects and candidate objects can be performed based on the vector representation, improving the correlation between the final target recommended object set and the candidate object set.

[0057] For example, we can first generate initial recommendation object descriptions for each initial recommendation object in the initial recommendation object set. Then, we convert these initial recommendation object descriptions into corresponding initial recommendation object vector representations. Based on these initial recommendation object vector representations and the corresponding candidate object vector representations in the candidate object set, we perform similarity retrieval to obtain the target recommendation object set. That is, based on similarity retrieval, we match the corresponding candidate object vector representations for each initial recommendation object vector representation, and then use the candidate objects corresponding to the matched candidate object vector representations as the target recommendation objects in the target recommendation object set.

[0058] In generating the initial recommendation object description information corresponding to each initial recommendation object in the initial recommendation object set, a second large language model can be used. This improves the efficiency and accuracy of obtaining the initial recommendation object description information, leveraging the strong semantic understanding and generation capabilities of the large language model to obtain more comprehensive and complete description information. For example, a second prompt instruction can be generated based on each initial recommendation object in the initial recommendation object set. This second prompt instruction is used to prompt the second large language model to generate the initial recommendation object description information corresponding to each initial recommendation object. The second prompt instruction is input into the second large language model, and then the initial recommendation object description information corresponding to each initial recommendation object generated by the second large language model is obtained. In this embodiment, the second large language model can be the same model as the first large language model, or it can be any separately configured open-source large language model or a self-trained large language model; no restrictions are imposed here.

[0059] Of course, the above is merely an illustrative explanation of how to generate the initial recommendation object description information corresponding to each initial recommendation object. In practical applications, any other method can be used to obtain the initial recommendation object description information based on relevant technologies; no restrictions are imposed here. For example, the corresponding initial recommendation object description information can be generated based on the description template and the relevant information of the initial recommendation object.

[0060] Furthermore, when converting the description information of each initial recommendation object into its corresponding vector representation, an embedding model can be used to improve the efficiency and effectiveness of obtaining the vector representation. This embedding model can be any model or encoder capable of encoding text into its corresponding vector representation; there are no restrictions here. For example, the embedding model could be a lightweight text encoder such as the BGA (BAAI General Embedding) encoder.

[0061] In this embodiment, the same method used to obtain the initial recommendation object vector representation can be applied to pre-obtain the candidate object vector representation corresponding to each candidate object from the candidate object set, for use when performing similarity retrieval based on vector representations to obtain the target recommendation object set. For example, candidate object description information corresponding to each candidate object can be generated first, and then each candidate object description information can be converted into a corresponding candidate object vector representation.

[0062] Based on the above examples, in order to more clearly illustrate the complete process of the cross-domain recommendation method provided in the embodiments of this application, as a possible implementation example, such as... Figure 3As shown, the candidate object set can be pre-encoded to obtain a candidate object vector representation set containing the vector representations of each candidate object. Therefore, a first prompt instruction can be generated based on user profile data, and then input into the first large language model to obtain an initial recommendation object set. This initial recommendation object set can then be encoded to obtain an initial recommendation object vector representation set containing the vector representations of each initial recommendation object. Based on this initial recommendation object vector representation set and the candidate object vector representation set, similarity retrieval can be performed to obtain the target recommendation object set.

[0063] It should be noted that in some possible implementations of this application's embodiments, step S203 can be omitted, and the initial recommendation object set generated by the first language model can be directly used as the final recommendation result. This allows for quick and convenient cross-domain recommendations.

[0064] In the embodiments of this application, the aforementioned first large language model can be any open-source or self-trained large language model, or the first large language model can be a cross-domain recommendation model obtained by supervised fine-tuning and / or preference alignment optimization based on any pre-trained large language model. There are no restrictions here, as long as it is a large language model that can generate initial recommended objects belonging to the target domain based on user profile data according to the prompt of the first prompt instruction.

[0065] For example, this application also provides a model training method to obtain the aforementioned first large language model based on a pre-trained large language model, for cross-domain object recommendation. Figure 4 As shown, the model training method may include the following S401-S403.

[0066] S401. An initial model is obtained by embedding a domain type encoder into the backbone network of a pre-trained large language model.

[0067] The domain type encoder is used to convert the input natural language into domain identifier vectors, which describe the domain to which the natural language belongs. For example, the domain type encoder can be a domain type embedding layer embedded in the backbone network of a pre-trained large language model.

[0068] S402, Obtain multiple first training samples.

[0069] The first training sample includes user profile data of sample users in at least one source domain and interaction objects in the target domain. For example, user profile data can be user profile data corresponding to different source domains such as video, music, e-commerce, and social, and interaction objects in the target domain can be products that users interact with in the e-commerce domain, video resources that users interact with in the video domain, music resources that users interact with in the music domain, etc.

[0070] S403. Supervised fine-tuning of the initial model using multiple first training samples yields the first major language model for cross-domain object recommendation.

[0071] In this process of supervised fine-tuning, a first prompt instruction generated based on user profile data is used as the input to the initial model, and the interactive object in the target domain is used as the target output of the initial model. The first prompt instruction is used to prompt the initial model to generate recommended objects belonging to the target domain based on the user profile data. The method of generating the first prompt instruction based on user profile data can refer to the relevant implementation methods involved in the aforementioned cross-domain recommendation methods, and will not be elaborated here.

[0072] In the pre-trained large language model's input stage, which converts input natural language text into model input, the text is converted into a token ID. Then, based on the embedding layer (LLM Emb), the corresponding word vector (token ID embedding) is generated according to the token ID. This embodiment obtains the initial model through an embedding domain type encoder. This adds the process of converting the text into a domain identifier (domain ID) and generating a corresponding domain identifier vector (domain idembedding) during the initial model's input stage, thus allowing both the word vector (token ID embedding) and the domain identifier vector (domain idembedding) to be input into the model. Thus, the first language model trained based on this initial model can describe the domain corresponding to the user profile data in the natural language of the first prompt instruction through the domain identifier vector. This enhances the model's ability to understand and judge different domains of the user profile data in the natural language of the input, enabling the model to better understand the differences of the same semantics in different domains. This, in turn, mitigates the impact of data heterogeneity between different domains in the user profile data in the natural language of the input when the model generates recommended objects in the target domain based on the input, thereby improving the accuracy of recommendations.

[0073] Taking the domain type encoder as an example, embedded in the domain type embedding layer of the backbone network of a pre-trained large language model, then for the resulting first large language model, such as... Figure 5 As shown, when the first prompt instruction is input, the prompt instruction can be processed by the Domain Emb and the Large Language Model Emb, respectively, to obtain the token id embedding and the domain id embedding. After processing by the Large Language Model Decoder, the recommended object is obtained.

[0074] In this embodiment of the application, the first language model trained above can also be optimized for preference alignment, so that the first language model can better capture the fine-grained preferences of users in different outputs, further improve the accuracy of the recommended objects output by the first language model, and enhance the personalization of the recommendations.

[0075] As an example, multiple object sample pairs can be generated based on the recommendation objects generated by the first language model. Each object sample pair includes a positive object sample and a negative object sample. The positive object sample is the object that the user positively responded to in the recommendation objects generated by the first language model, and the negative object sample is the object that the user negatively responded to in the recommendation objects generated by the first language model. Then, the first language model is optimized for preference alignment using multiple object sample pairs.

[0076] The first language model can be optimized for preference alignment using any implementation method based on preference alignment optimization techniques; no limitations are imposed here. For example, a response-level reward model trained on online feedback can be introduced, and a preference alignment framework can be adopted to optimize the first language model for preference alignment based on the Direct Preference Optimization (DPO) method using multiple object samples. Alternatively, the first language model can also be optimized for preference alignment based on the Proximal Policy Optimization (PPO) method.

[0077] For example, in this embodiment of the application, when optimizing the first language model for preference alignment using multiple object sample pairs, the multiple object sample pairs can be divided into two levels according to their learning difficulty for progressive optimization. The previous stage model is used as a new reference model to form an iteration, which can gradually optimize the model's understanding of user preferences, thereby improving the effect of preference alignment optimization. Specifically, object sample pairs with low learning difficulty are those with a clear difference in quality, while object sample pairs with high learning difficulty are those with a less clear difference in quality.

[0078] For example, such as Figure 6 As shown, a first-stage preference alignment optimization can be performed on the first large language model based on a first set of sample pairs from multiple object sample pairs. Then, a second-stage preference alignment optimization is performed on the first large language model obtained from the first-stage preference alignment optimization based on a second set of sample pairs from multiple object sample pairs, to obtain the final optimized first large language model. The learning difficulty of the first set of sample pairs is lower than that of the second set of sample pairs; that is, the comparison of the quality of object sample pairs in the first set is relatively obvious, while the comparison of the quality of object sample pairs in the second set is relatively insignificant.

[0079] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0080] According to another embodiment, a cross-domain recommendation device is provided. Figure 7 A schematic diagram illustrating the components of a cross-domain recommendation device is shown. For example... Figure 7 As shown, the device includes: an acquisition module 701, used to acquire user profile data of a user in at least one source domain; a generation module 702, used to generate a first prompt instruction based on the user profile data and input the first prompt instruction into a first large language model, the first prompt instruction being used to prompt the first large language model to generate initial recommended objects belonging to the target domain based on the user profile data, and to acquire a set of initial recommended objects generated by the first large language model; and a matching module 703, used to match candidate objects in a candidate object set in the target domain based on the initial recommended object set to obtain a target recommended object set, wherein each target recommended object in the target recommended object set is a candidate object in the candidate object set that matches the initial recommended object, and the candidate objects in the candidate object set are pre-configured objects that can be recommended.

[0081] Optionally, the matching module 703 is specifically used to generate initial recommendation object description information corresponding to each initial recommendation object in the initial recommendation object set; convert each initial recommendation object description information into a corresponding initial recommendation object vector representation; and perform similarity retrieval based on the initial recommendation object vector representation and the candidate object vector representation corresponding to each candidate object in the candidate object set to obtain the target recommendation object set.

[0082] Optionally, the matching module 703 is specifically used to generate a second prompt instruction based on each initial recommendation object in the initial recommendation object set and input the second prompt instruction into the second language model. The second prompt instruction is used to prompt the second language model to generate initial recommendation object description information corresponding to each initial recommendation object; and to obtain the initial recommendation object description information corresponding to each initial recommendation object generated by the second language model.

[0083] Optionally, the matching module 703 is specifically used to convert the description information of each initial recommendation object into a corresponding vector representation of the initial recommendation object using an embedding model.

[0084] Optionally, user profile data includes user attribute data and user behavior data in at least one source domain, with the behavior data including behavior sequences and / or behavior statistics.

[0085] Optionally, the first large language model is a cross-domain recommendation model obtained by embedding a domain type encoder in the backbone network of a pre-trained large language model and performing supervised fine-tuning; or, the first large language model is a cross-domain recommendation model obtained by embedding a domain type encoder in the backbone network of a pre-trained large language model and performing supervised fine-tuning and preference alignment optimization.

[0086] According to another embodiment, a model training apparatus is provided. Figure 8 A schematic diagram illustrating the components of a model training device is shown. Figure 8 As shown, the device includes: a model building module 801, used to embed a domain type encoder into the backbone network of a pre-trained large language model to obtain an initial model, the domain type encoder being used to convert the input natural language into a domain identifier vector, the domain identifier vector being used to describe the domain corresponding to the natural language; a supervised fine-tuning module 802, used to acquire multiple first training samples, the first training samples including user profile data of sample users in at least one source domain and interactive objects in the target domain; using the multiple first training samples to perform supervised fine-tuning of the initial model to obtain a first large language model for cross-domain object recommendation; wherein, during the supervised fine-tuning process, a first prompt instruction generated based on user profile data is used as the input of the initial model, and the interactive objects in the target domain are used as the target output of the initial model, the first prompt instruction being used to prompt the initial model to generate recommended objects belonging to the target domain based on the user profile data.

[0087] Optionally, the device further includes: a preference alignment optimization module 803, used to generate multiple object sample pairs based on the recommended objects generated by the first large language model, each object sample pair including a positive object sample and a negative object sample, the positive object sample being the object of positive feedback from the user in the recommended objects generated by the first large language model, and the negative object sample being the object of negative feedback from the user in the recommended objects generated by the first large language model; and to perform preference alignment optimization on the first large language model using multiple object sample pairs.

[0088] Optionally, the preference alignment optimization module 803 is specifically used to perform a first-stage preference alignment optimization on the first large language model based on a first sample pair set among multiple object sample pairs; and to perform a second-stage preference alignment optimization on the first large language model obtained from the first-stage preference alignment optimization based on a second sample pair set among multiple object sample pairs; wherein the learning difficulty of the first sample pair set is lower than that of the second sample pair set.

[0089] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the description of the method embodiments. The system and device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0090] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0091] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0092] And an electronic device, comprising: One or more processors; and A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any of the foregoing method embodiments.

[0093] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0094] in, Figure 9 An exemplary architecture of an electronic device is illustrated, which may specifically include a bus 901, a processor 902, a memory 903, and a communication interface 904. The processor 902, memory 903, and communication interface 904 communicate via the bus 901. The memory 903 stores computer program code, including computer instructions. When these instructions are executed by the processor 902, the electronic device performs the methods provided in the foregoing embodiments. It should be understood that this application does not limit the number of processors 902 and memories 903 in the electronic device.

[0095] The 901 bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The 901 bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus 901 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 901 may include a path for transmitting information between various components of an electronic device (e.g., memory 903, processor 902, communication interface 904).

[0096] Processor 902 may include any one or more processors such as a central processing unit, a graphics processing unit, a microprocessor (MP), or a digital signal processor (DSP).

[0097] Memory 903 may include volatile memory, such as random access memory (RAM). Memory 903 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0098] The communication interface 904 uses a command distribution module, such as, but not limited to, a network interface card or transceiver, to enable communication between the device and other devices or communication networks.

[0099] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer program product. This computer program product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0100] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A cross-domain recommendation method, characterized in that, include: Obtain user profile data in at least one source domain; Based on the user profile data, a first prompt instruction is generated and input into the first large language model to obtain the initial recommendation object set generated by the first large language model. The first prompt instruction is used to prompt the first large language model to generate initial recommendation objects belonging to the target domain based on the user profile data. Based on the initial recommended object set, candidate objects are matched in the candidate object set in the target domain to obtain a target recommended object set. Each target recommended object in the target recommended object set is a candidate object in the candidate object set that matches the initial recommended object. The candidate objects in the candidate object set are pre-configured objects that can be recommended.

2. The method according to claim 1, characterized in that, The step of matching candidate objects in the candidate object set of the target domain based on the initial recommended object set to obtain the target recommended object set includes: Generate initial recommendation object description information corresponding to each initial recommendation object in the initial recommendation object set; Each of the initial recommendation object descriptions is converted into a corresponding initial recommendation object vector representation; Based on the initial recommended object vector representation and the candidate object vector representation corresponding to each candidate object in the candidate object set, a similarity search is performed to obtain the target recommended object set.

3. The method according to claim 2, characterized in that, The step of generating initial recommendation object description information corresponding to each initial recommendation object in the initial recommendation object set includes: Based on each initial recommendation object in the initial recommendation object set, a second prompt instruction is generated and the second prompt instruction is input into the second large language model. The second prompt instruction is used to prompt the second large language model to generate initial recommendation object description information corresponding to each initial recommendation object. Obtain the description information of each initial recommendation object generated by the second language model.

4. The method according to claim 2, characterized in that, The step of converting the description information of each initial recommendation object into a corresponding initial recommendation object vector representation includes: The embedding model is used to convert the description information of each initial recommendation object into a corresponding vector representation of the initial recommendation object.

5. The method according to claim 1, characterized in that, The user profile data includes user attribute data and user behavior data in at least one source domain, and the behavior data includes behavior sequences and / or behavior statistics.

6. The method according to any one of claims 1-5, characterized in that, The first large language model is a cross-domain recommendation model obtained by embedding a domain type encoder into the backbone network of a pre-trained large language model and performing supervised fine-tuning; or, the first large language model is a cross-domain recommendation model obtained by embedding a domain type encoder into the backbone network of a pre-trained large language model and performing supervised fine-tuning and preference alignment optimization.

7. A model training method, characterized in that, include: An initial model is obtained by embedding a domain type encoder into the backbone network of a pre-trained large language model. The domain type encoder is used to convert the input natural language into a domain identifier vector, which is used to describe the domain corresponding to the natural language. Acquire multiple first training samples, the first training samples including user profile data of sample users in at least one source domain and interaction objects in the target domain; The initial model is supervised and fine-tuned using the multiple first training samples to obtain a first large language model for cross-domain object recommendation; wherein, during the supervised fine-tuning process, a first prompt instruction generated based on user profile data is used as the input of the initial model, and the interactive object in the target domain is used as the target output of the initial model, and the first prompt instruction is used to prompt the initial model to generate recommended objects belonging to the target domain based on the user profile data.

8. The method according to claim 7, characterized in that, The method further includes: Based on the recommended objects generated by the first large language model, multiple object sample pairs are generated. Each object sample pair includes a positive object sample and a negative object sample. The positive object sample is the object that the user positively feedbacks in the recommended objects generated by the first large language model, and the negative object sample is the object that the user negatively feedbacks in the recommended objects generated by the first large language model. The first large language model is optimized for preference alignment using the multiple object samples.

9. The method according to claim 8, characterized in that, The step of optimizing the first large language model by using the multiple object samples includes: Based on the first set of sample pairs among the multiple object sample pairs, the first large language model is optimized for preference alignment in the first stage. Based on the second set of sample pairs among the multiple object sample pairs, the first large language model obtained by the first stage of preference alignment optimization is subjected to the second stage of preference alignment optimization. The learning difficulty of the first set of sample pairs is lower than that of the second set of sample pairs.

10. A cross-domain recommendation device, characterized in that, include: The acquisition module is used to acquire user profile data for a user in at least one source domain. The generation module is used to generate a first prompt instruction based on the user profile data and input the first prompt instruction into the first large language model. The first prompt instruction is used to prompt the first large language model to generate initial recommendation objects belonging to the target domain based on the user profile data, and to obtain the set of initial recommendation objects generated by the first large language model. The matching module is used to match candidate objects in the candidate object set in the target domain based on the initial recommended object set to obtain a target recommended object set. Each target recommended object in the target recommended object set is a candidate object in the candidate object set that matches the initial recommended object. The candidate objects in the candidate object set are pre-configured objects that can be recommended.

11. A model training device, characterized in that, include: The model building module is used to embed a domain type encoder into the backbone network of a pre-trained large language model to obtain an initial model. The domain type encoder is used to convert the input natural language into a domain identifier vector, which is used to describe the domain corresponding to the natural language. A supervised fine-tuning module is used to acquire multiple first training samples, which include user profile data of sample users in at least one source domain and interaction objects in the target domain; the initial model is supervisedly fine-tuned using the multiple first training samples to obtain a first large language model for cross-domain object recommendation; wherein, in the supervised fine-tuning process, a first prompt instruction generated based on the user profile data is used as the input of the initial model, and the interaction objects in the target domain are used as the target output of the initial model, and the first prompt instruction is used to prompt the initial model to generate recommended objects belonging to the target domain based on the user profile data.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1 to 6, or the steps of the method according to any one of claims 7 to 9.

13. An electronic device, characterized in that, include: One or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1 to 6, or perform the steps of the method according to any one of claims 7 to 9.

14. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 6, or the steps of the method according to any one of claims 7 to 9.