Content recommendation method and training method of target recommendation model

CN122926006APending Publication Date: 2026-10-16SWEET POTATO TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611112060.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

例如,针对提升用户活跃度的策略需训练一个模型,针对提升用户消费时长的策略需训练另一个模型,导致模型训练阶段的算力资源消耗成倍增加,模型上线后还需为每个模型单独分配推理资源,造成机器资源的严重浪费;同时,多个模型之间的参数和知识相互隔离,无法共享不同推荐策略下学习到的用户兴趣模式,进一步降低了整体的模型推荐待推荐内容的效率

Benefits of technology

[0012] The content recommendation method provided in this application encodes historical interaction content and interaction types through the encoder of the target recommendation model to generate an interest representation sequence for the target user. This interest representation sequence enables the model to distinguish the degree of user interest reflected by different interaction behaviors, providing a more accurate user representation for subsequent generation. The target recommendation strategy is then obtained, and the interest representation sequence and the target recommendation strategy are input together into a multi-task decoder to generate content information to be recommended. The multi-task decoder is trained from multiple candidate recommendation strategies, with the target recommendation strategy being one of them. This allows a single decoder to have the ability to generate multiple recommendation strategies internally, eliminating the need to train and deploy independent recommendation models for each strategy. This solves the problems of high resource consumption and low recommendation efficiency in multi-model solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122926006A_ABST
    Figure CN122926006A_ABST
Patent Text Reader

Abstract

The embodiment of the specification provides a content recommendation method and a training method of a target recommendation model, wherein the content recommendation method comprises the following steps: obtaining historical interaction content of a target user and a corresponding interaction type; encoding the historical interaction content and the corresponding interaction type through an encoder of the target recommendation model to generate an interest representation sequence of the target user, the target recommendation model further comprising a multi-task decoder; obtaining a target recommendation strategy, inputting the interest representation sequence and the target recommendation strategy into the multi-task decoder to generate to-be-recommended content information, the multi-task decoder being obtained through training based on a plurality of candidate recommendation strategies, and the target recommendation strategy being at least one of the plurality of candidate recommendation strategies; and determining target recommended content of the target user based on the to-be-recommended content information. Without training and deploying an independent recommendation model for each recommendation strategy, the problem of large resource consumption and low recommendation efficiency of the multi-model scheme is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of artificial intelligence technology, and in particular to a content recommendation method and a training method for a target recommendation model. Background Technology

[0002] Existing content recommendation methods typically require training a separate recommendation model for each of the multiple recommendation strategies. For example, a model needs to be trained for strategies that increase user activity, and another model needs to be trained for strategies that increase user engagement time. This leads to a significant increase in computational resources consumed during model training. After the models are deployed, inference resources need to be allocated separately for each model, resulting in a serious waste of machine resources. At the same time, the parameters and knowledge of multiple models are isolated from each other, making it impossible to share user interest patterns learned under different recommendation strategies, which further reduces the overall efficiency of the model in recommending content.

[0003] Therefore, how to uniformly support multiple content recommendation strategies in a single model in order to reduce the resource consumption of model training and maintenance and improve recommendation efficiency has become an urgent technical problem to be solved. Summary of the Invention

[0004] In view of this, embodiments of this specification provide a content recommendation method. One or more embodiments of this specification also relate to a training method for a target recommendation model, a content recommendation apparatus, a training apparatus for a target recommendation model, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a content recommendation method is provided, comprising: Obtain the target user's historical interaction content and corresponding interaction types; The encoder of the target recommendation model encodes the historical interaction content and the corresponding interaction type to generate the interest representation sequence of the target user. The target recommendation model also includes a multi-task decoder. To obtain the target recommendation strategy, the interest representation sequence and the target recommendation strategy are input into the multi-task decoder to generate the content information to be recommended. The multi-task decoder is trained based on multiple candidate recommendation strategies, and the target recommendation strategy is at least one of the multiple candidate recommendation strategies. Based on the information of the content to be recommended, determine the target recommended content for the target user.

[0006] According to a second aspect of the embodiments of this specification, a content recommendation apparatus is provided, comprising: The first acquisition module is configured to acquire the target user's historical interaction content and the corresponding interaction type; The encoding module is configured to encode historical interaction content and corresponding interaction types through the encoder of the target recommendation model to generate an interest representation sequence of the target user. The target recommendation model also includes a multi-task decoder. The decoding module is configured to obtain the target recommendation strategy, input the interest representation sequence and the target recommendation strategy into the multi-task decoder, and generate the content information to be recommended. The multi-task decoder is trained based on multiple candidate recommendation strategies, and the target recommendation strategy is at least one of the multiple candidate recommendation strategies. The determination module is configured to determine the target recommended content for a target user based on the information of the content to be recommended.

[0007] According to a third aspect of the embodiments of this specification, a method for training a target recommendation model is provided, comprising: Obtain candidate recommendation models, which include pre-trained encoders and decoders to be trained; For each candidate recommendation strategy, a corresponding recommendation sample set is constructed. The recommendation sample set includes the sample interaction content under the corresponding candidate recommendation strategy, the interaction type corresponding to the sample interaction content, and the sample prediction content information. Based on the recommendation sample set corresponding to each candidate recommendation strategy, the decoder to be trained is trained on multiple tasks to obtain a multi-task decoder. The encoder and the multi-task decoder are used as the target recommendation model after training to execute the above content recommendation method.

[0008] According to a fourth aspect of the embodiments of this specification, a training apparatus for a target recommendation model is provided, comprising: The third acquisition module is configured to acquire candidate recommendation models, which include a pre-trained encoder and a decoder to be trained. The construction module is configured to build corresponding recommendation sample sets for each candidate recommendation strategy. The recommendation sample set includes sample interaction content under the corresponding candidate recommendation strategy, the interaction type corresponding to the sample interaction content, and sample prediction content information. The first training module is configured to perform multi-task training on the decoder to be trained based on the recommendation sample set corresponding to each candidate recommendation strategy, thereby obtaining a multi-task decoder. The encoder and the multi-task decoder are used as the target recommendation model after training to execute the above-mentioned content recommendation method.

[0009] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the above-mentioned content recommendation method and the training method of the target recommendation model.

[0010] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the above-described content recommendation method and the training method of the target recommendation model.

[0011] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described content recommendation method and the training method of the target recommendation model.

[0012] The content recommendation method provided in this application encodes historical interaction content and interaction types through the encoder of the target recommendation model to generate an interest representation sequence for the target user. This interest representation sequence enables the model to distinguish the degree of user interest reflected by different interaction behaviors, providing a more accurate user representation for subsequent generation. The target recommendation strategy is then obtained, and the interest representation sequence and the target recommendation strategy are input together into a multi-task decoder to generate content information to be recommended. The multi-task decoder is trained from multiple candidate recommendation strategies, with the target recommendation strategy being one of them. This allows a single decoder to have the ability to generate multiple recommendation strategies internally, eliminating the need to train and deploy independent recommendation models for each strategy. This solves the problems of high resource consumption and low recommendation efficiency in multi-model solutions. Attached Figure Description

[0013] Figure 1 A flowchart of a content recommendation method provided according to one embodiment of this specification is shown; Figure 2 A flowchart is shown illustrating a training method for a target recommendation model according to an embodiment of this specification; Figure 3 A visual interface diagram of a content recommendation method provided in one embodiment of this specification is shown; Figure 4 This specification shows a schematic diagram of the structure of a content recommendation device according to one embodiment; Figure 5 A schematic diagram of the structure of a training device for a target recommendation model provided in one embodiment of this specification is shown; Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0014] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0015] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0016] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0017] Furthermore, 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, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related 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.

[0018] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0019] LLM (Large Language Model): A large-scale deep learning model trained on massive amounts of data, capable of understanding and generating natural language, and performing tasks such as question answering and translation.

[0020] Generative Retrieval: A recall method that directly uses a generative model to generate relevant item identifiers for a query, without explicitly calculating the similarity between the item and the query.

[0021] Residual Quantization Clustering: A method that compresses and clusters vectors by quantizing residuals layer by layer. It is often used for efficient approximate nearest neighbor search.

[0022] The T5 model (Text-to-Text Transfer Transformer) unifies various natural language processing tasks into a text-to-text encoder-decoder model, using a prefix to indicate the task type.

[0023] Beam Search: A dynamic programming algorithm that retains a fixed number (beam width) of optimal candidate paths during sequence generation, achieving a balance between search quality and efficiency.

[0024] Swing Algorithm: A recommendation recall algorithm based on the co-occurrence of user behaviors. It measures similarity by calculating the high-order overlap of users who interact with items.

[0025] This specification provides a training method for a target recommendation model, a content recommendation device, a training device for a target recommendation model, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0026] See Figure 1 , Figure 1 A flowchart of a content recommendation method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0027] Step 102: Obtain the target user's historical interaction content and corresponding interaction types; The target user is the specific user for whom recommended content needs to be generated. Their historical behavioral data serves as the basis for analyzing interests and preferences and generating personalized recommendations. For example, the target user could be a registered user on a short video platform who triggers a recommendation refresh request; or, for example, a reader currently browsing a page in a news application.

[0028] Historical interaction content refers to content items in which a target user has interacted over a past period. It reflects the user's content consumption preferences and interests, providing raw material for constructing a user interest representation. For example, historical interaction content could be a list of videos the user has watched, liked, or shared on a short video platform; or it could be a collection of articles the user has clicked and read in a news application.

[0029] Interaction type is a category label for the specific actions performed by the target user on historical interactive content. It is used to distinguish the differences in user interest reflected by different actions, enabling the model to assign different interest weights to content based on the behavior type. For example, interaction types can include operation categories such as click, like, favorite, share, comment, follow, purchase, and complete playback; for example, interaction types can also be divided into levels such as browsing, shallow interaction, and deep interaction according to the strength of the behavior.

[0030] Obtaining the target user's historical interaction content and corresponding interaction types can specifically involve querying and extracting a list of content and the behavior category of each interaction generated by the user in the past preset time period based on the target user's user identifier from the user behavior log or interaction record database.

[0031] One possible implementation is to query the target user's recent interaction records from the user behavior log system. Each record contains a content identifier and an interaction type field, and the results are summarized to obtain a list of historical interaction content and a list of corresponding interaction types. For example, querying the behavior log of user "user_9527" for the past 30 days will yield three records: content "video_001" corresponding to the interaction type "like", content "article_030" corresponding to the interaction type "favorite", and content "video_102" corresponding to the interaction type "complete playback".

[0032] One possible implementation is to directly read the user's recent interaction sequence data from the context information of the current recommendation request. This data has been preprocessed into a structured interaction sequence by the upstream system. For example, the recommendation request includes serialized data of the user's 10 most recent interactions, with each data entry containing a content identifier and an interaction type encoding.

[0033] This specification describes an implementation of a personalized recommendation scenario on a short video platform. The target user pulls down to refresh the recommendation stream on the client, triggering a recommendation request. Based on the target user's user identifier "user_9527", the system queries the user's interaction records for the past 30 days, extracting a list of historical interaction content containing five videos: "video_001", "video_056", "video_203", "video_117", and "video_089". The corresponding interaction types are "like", "complete playback", "share", "comment", and "complete playback" respectively. These five entries and their corresponding interaction types are then used as the target user's historical interaction content and corresponding interaction types, and passed to the subsequent encoding processing stage.

[0034] By acquiring the target user's historical interaction content and corresponding interaction types, the subsequent encoding process can simultaneously consider what content the user consumed and how they consumed it, distinguish the differences in interest intensity reflected by different interaction types, provide multi-dimensional input information for building more distinctive user interest representations, and improve the personalized accuracy of subsequent recommendation results.

[0035] Step 104: The encoder of the target recommendation model encodes the historical interaction content and the corresponding interaction type to generate the interest representation sequence of the target user. The target recommendation model also includes a multi-task decoder.

[0036] A target recommendation model is a machine learning model used to perform content recommendation tasks. It consists of an encoder and a multi-task decoder. The encoder encodes the user's historical interaction sequences into interest representations, while the multi-task decoder generates recommendation results based on these interest representations and the target recommendation strategy. For example, a target recommendation model can be a neural network model based on the Transformer architecture, where the encoder uses a self-attention mechanism to capture the correlations between interactions in the sequence, and the multi-task decoder supports task vector inputs for multiple recommendation strategies.

[0037] An encoder is a component in a target recommendation model that encodes a user's historical interactions and corresponding interaction types into a dense vector representation sequence. It can extract features and fuse information from the input behavior sequence, enabling each behavior representation in the sequence to aggregate the contextual information of the entire sequence, thereby generating a vector representation that reflects the user's comprehensive interests. For example, the encoder can be a multi-layer self-attention network that calculates the attention weight between any two behavior representations in the sequence, fusing information from other positions into the representation at the current position. Alternatively, the encoder can be a recurrent neural network or a long short-term memory network that recursively fuses sequence information step by step.

[0038] An interest representation sequence is a set of vectors output by the encoder that represents the target user's multifaceted interests and preferences. Each vector in the interest representation sequence corresponds to a position in the historical interaction sequence, integrating the content features, behavior type, and sequence context information of that position, and can reflect the distribution of the user's interests from different dimensions.

[0039] For example, the vectors in the interest representation sequence can be arranged in the order of interaction time, and each vector is fused with information from other positions in the sequence through the encoder. The hidden state transfer and attention association between vectors enable the sequence as a whole to characterize the migration process of user interests over time, such as the change of a certain interest point from strong to weak, another interest point from weak to strong, or the alternating evolution between different interest points.

[0040] Specifically, the interest representation sequence can be a sequence containing multiple 512-dimensional vectors, each vector corresponding to a historical interaction behavior. Different dimensions in the vectors encode the features of each level of the content type and the intensity of the user's interest in the content. By observing the numerical changes of adjacent vectors in a specific dimension in the sequence, the trend of user interests gradually shifting from "technology content" to "lifestyle content" can be identified.

[0041] A multi-task decoder is a component in a target recommendation model that generates corresponding recommendation results based on different recommendation strategy inputs. It is jointly trained by training tasks corresponding to multiple candidate recommendation strategies. During recommendation execution, it switches between different recommendation generation logics by receiving different target recommendation strategy inputs, enabling a single model to respond to multiple recommendation needs. For example, a multi-task decoder can be a decoder jointly trained during the training phase using two tasks: strategies to increase user activity and strategies to increase user consumption time.

[0042] The encoder of the target recommendation model encodes historical interaction content and corresponding interaction types to generate a sequence of interest representations of the target user. Specifically, it can be an operation that organizes the target user's historical interaction content and corresponding interaction types into behavioral sequence data, inputs it into the encoder for feature extraction and sequence modeling, and outputs a vector sequence containing user interest information.

[0043] One possible implementation involves concatenating the content features of each historical interaction with the corresponding interaction type features to obtain a fusion vector. All fusion vectors are then arranged in chronological order to form a behavior sequence, which is input into an encoder. The encoder fuses contextual information at each position in the sequence and outputs an interest representation vector for each position, forming an interest representation sequence. For example, if a user has three historical interactions: “video_001 / like”, “article_030 / favorite”, and “video_102 / completed”, the video features are concatenated with the like behavior features, the article features with the favorite behavior features, and the video features with the completed behavior features, respectively, resulting in three fusion vectors. These are then input into the encoder in chronological order. The encoder fuses the contextual information of the entire sequence for each vector and outputs three interest representation vectors to form an interest representation sequence.

[0044] One possible implementation is that historical interaction content is represented by content type identifiers with hierarchical relationships. The content type identifier vector of each historical interaction content is concatenated with the interaction type vector and then input into the encoder. For example, if the content type identifier of a certain historical interaction content is "entertainment / film / science fiction", the hierarchical type identifier is mapped into a vector and concatenated with the vector of the interaction type "like" before being input into the encoder.

[0045] One possible implementation is that the encoder uses a self-attention mechanism to calculate attention weights for the behavior representations of any two positions in the sequence, and then aggregates the information of other positions based on the weights to generate an interest representation vector that integrates the global context. For example, if the representation vector of the third interaction "complete broadcast" in the sequence is found to be highly correlated with the first interaction "like" through the self-attention mechanism, then some information from the first interaction is introduced when updating the vector of the third interaction.

[0046] This specification describes an implementation of a content recommendation scenario applied to a short video platform. The target user's historical interaction content includes five videos: "video_001", "video_056", "video_203", "video_117", and "video_089", with corresponding interaction types of "like", "complete playback", "share", "comment", and "complete playback" respectively. The video feature vector of each historical interaction is concatenated with the corresponding interaction type behavior vector to obtain five fused vectors, which are arranged in chronological order of interaction occurrence to form a behavior sequence. This behavior sequence is input into the encoder of the target recommendation model. The encoder employs a multi-layer self-attention network, calculating the attention weight between the fused vector at each position in the sequence and the fused vectors at other positions. Based on the attention weights, information from other positions is aggregated to generate five interest representation vectors. Each vector not only contains the content features and interaction behavior features of the corresponding video but also incorporates contextual information from other related interactions in the sequence. This sequence of five interest representation vectors serves as the target user's interest representation sequence and is passed to the subsequent multi-task decoding processing stage.

[0047] In one optional embodiment of this specification, after step 102, the following steps are also included: Obtain the historical content type identifier corresponding to the historical interaction content. The historical content type identifier consists of multiple sub-type identifiers with a hierarchical relationship, which are used to represent the content type of the historical interaction content. Accordingly, step 104 also includes the following steps: The encoder of the target recommendation model encodes the historical interaction content type identifiers and the corresponding interaction types to generate a sequence of interest representations for the target user.

[0048] Historical content type identifiers are codes or tags used to characterize the content type to which historical interaction content belongs. They consist of multiple sub-type identifiers with a hierarchical relationship. Historical content type identifiers are used to describe the category affiliation of content at different granular levels, enabling the model to learn the hierarchical structural relationships between content types, thereby more accurately capturing users' interests and preferences at different content levels.

[0049] For example, a content type identifier for a short video / article / note can consist of three sub-type identifier levels: a first-level category "entertainment", a second-level category "film and television", and a third-level category "science fiction", with the overall identifier being "entertainment / film and television / science fiction".

[0050] For example, the hierarchical relationship between subtype identifiers can be a tree structure, where an upper-level category contains multiple lower-level subcategories, such as "sports" containing subcategories such as "basketball", "football", and "swimming". For example, the category to which each content belongs can be represented by a triple, in which the first element is taken from the number space corresponding to the first-level subtype identifier, the second element is taken from the number space corresponding to the second-level subtype identifier, and the third element is taken from the number space corresponding to the third-level subtype identifier. Multiple contents belonging to the same category share the same triple number.

[0051] Obtaining the historical content type identifier corresponding to the historical interaction content can specifically involve querying the multi-level category information to which the content belongs from the content information database or content metadata based on the content identifier of the historical interaction content, and organizing it into type identifiers according to the hierarchical order.

[0052] One possible implementation is that each subtype identifier in the historical content type identifier is stored in encoded form, and the pre-generated hierarchical code is directly read from the attribute field of the content as the historical content type identifier; for example, the metadata of the content "article_030" has stored the content type code "TECH_AI_NLP", and each segment of the code corresponds to a different level.

[0053] One optional implementation involves representing the category of content with a triplet. The size of each codebook layer is a preset value, such as 8192, meaning the numbering space for each subtype identifier is 8192. Multiple pieces of content belonging to the same category share the same triplet number. The triplet corresponding to the category to which the content belongs is read from the content's metadata and used as the historical content type identifier for that content. For example, videos "video_056" and "video_078" both belong to the "Entertainment / Film / Science Fiction" category. Their metadata stores the same triplet number, where the first-level number is the value of the "Entertainment" class in the first-level codebook space, the second-level number is the value of the "Film / Film" class in the second-level codebook space, and the third-level number is the value of the "Science Fiction" class in the third-level codebook space. This triplet is the historical content type identifier for these two videos.

[0054] The encoder of the target recommendation model encodes the type identifier of historical interaction content and the corresponding interaction type to generate the interest representation sequence of the target user. Specifically, it can be that the content type identifier and the corresponding interaction type of each historical interaction content are mapped into feature vectors, the two are combined and input into the encoder, and the encoder performs context modeling on the sequence and outputs the interest representation vector sequence.

[0055] An optional implementation involves mapping historical content type identifiers to content type vectors via an embedding matrix, mapping interaction types to behavior vectors via an embedding matrix, concatenating or adding the two to obtain a combined vector for the current interaction, arranging all the combined vectors of historical interactions in chronological order and inputting them into an encoder, and the encoder outputting the interest representation vector corresponding to each position to form an interest representation sequence.

[0056] For example, when the historical content type identifier is represented by a triplet number, each element in the triplet is mapped to a corresponding embedding vector through an embedding matrix. The embedding vectors at each level are concatenated or fused with the behavior vectors corresponding to the interaction type to obtain the combined vector of that interaction. Then, the combined vectors of each historical interaction are arranged in chronological order and input into the encoder. For example, the type identifier of historical interaction content is represented by a triplet number, and the codebook size at each level is 8192. After mapping the first-level number, the second-level number, and the third-level number to embedding vectors, they are concatenated with the interaction type vector to obtain the combined vector. After encoding by the encoder, the interest representation vector at the corresponding position is output.

[0057] By representing historical interaction content with hierarchical historical content type identifiers and encoding these identifiers together with the interaction types, the interest representation sequence simultaneously contains multi-level category information and behavior intensity information of the content interacted by the user, providing a more accurate user profile foundation for subsequent multi-task decoders.

[0058] In one optional embodiment of this specification, before obtaining the historical content type identifier corresponding to the historical interaction content, the following steps are further included: Based on the content IDs of each content in the full content pool, an initial content vector is constructed for each content. The content ID is used to uniquely represent the information of the corresponding content. The full content pool contains historical interaction content. Based on a pre-defined hierarchical clustering algorithm, hierarchical clustering is performed on each initial content vector to determine the multi-level content types of each content. Based on multi-level content types, determine the content type identifier for each piece of content.

[0059] The full content pool is the collection of all recommendable content in a content recommendation system, providing a complete data foundation for generating content type identifiers. For example, the full content pool could be a library of all uploaded video content on a short video platform; or it could be a collection of all published articles in a news application.

[0060] The content ID is a unique identifier for each piece of content in the full content pool, used to distinguish content and construct the initial content vector. For example, the content ID can be a unique integer identifier assigned to each piece of content by the system; alternatively, the content ID can be a fixed-length code generated based on the content hash value.

[0061] The initial content vector is a vector representation constructed for each content based on its content ID, serving as the input feature for hierarchical clustering. For example, the initial content vector can be a network content vector obtained by mapping the content ID to an embedding vector and fusing it with the content's own feature vector; alternatively, the initial content vector can also be an embedding vector obtained through random initialization or pre-training, indexed by the content ID.

[0062] Hierarchical clustering algorithms are clustering methods that divide data into different clusters at multiple granular levels, automatically constructing multi-level classification systems for content and discovering hierarchical category relationships between content without manual annotation. For example, a hierarchical clustering algorithm can be a top-down recursive clustering, where each layer performs K-means clustering on the content within the upper-level cluster to obtain the lower-level subcategories; alternatively, a hierarchical clustering algorithm can be residual quantization clustering, where a residual vector is calculated after each layer of clustering, and the residuals are then used for lower-level clustering to compensate for quantization errors.

[0063] Content type identifiers are codes generated for each content based on multi-level clustering results, representing the category affiliation of each level. They provide a unified content category input for the encoder. For example, a content type identifier is a triple consisting of three levels of numbers, with each element taken from a different numbering space. Based on the triples, an inverted index from category to content list can be constructed and stored in the retrieval engine for fast online retrieval by category.

[0064] Based on the content IDs of each content in the full content pool, an initial content vector is constructed for each content. Specifically, the embedding vector can be obtained by looking up the embedding matrix with the content ID as an index, and then fused with the content's own feature vector to obtain the initial content vector.

[0065] Based on a pre-defined hierarchical clustering algorithm, each initial content vector is hierarchically clustered to determine the multi-level content types of each content. Specifically, the initial content vectors can be divided layer by layer. One possible approach is recursive clustering: the first layer clusters the entire vector to obtain coarse-grained cluster numbers; the second layer clusters within each coarse-grained cluster to obtain medium-grained numbers; and the third layer clusters within each medium-grained cluster to obtain fine-grained numbers. Another possible approach is residual quantization clustering: after the first layer of K-means clustering, the first-layer numbers are recorded and the residuals are calculated. The residuals are then clustered in the second layer to obtain the second-layer numbers, and the residuals are calculated again for the third layer clustering to obtain the third-layer numbers. The number of clusters in each layer can be matched with the pre-defined numbering space size.

[0066] Based on multi-level content types, the content type identifier for each content is determined. Specifically, the number obtained from each level can be combined into a triple in hierarchical order and written into the content metadata. An inverted index from the triples to the content list is constructed based on the triples of all content and stored in the retrieval engine for querying candidate content by type identifier during recommendation.

[0067] This specification describes an implementation of a content recommendation scenario applied to a content sharing platform. The full content pool contains all published notes, each assigned a unique content ID. For each note, the embedding vector of the content ID is fused with the note's text feature vector to obtain an initial content vector. A residual quantization clustering algorithm is used to perform three layers of clustering on all initial content vectors: The first layer performs K-means clustering on all initial content vectors, assigning each vector to the nearest first-layer cluster center, and each note receives a first-layer ID; the residual vector between each vector and its corresponding first-layer cluster center is calculated. The second layer performs K-means clustering on all residual vectors, assigning each residual vector to the nearest second-layer cluster center, and each note receives a second-layer ID; the third layer performs K-means clustering on the second residual vector, assigning each residual vector to the nearest third-layer cluster center, and each note receives a third-layer ID. After clustering, note "note_001" receives a first-level ID of 102, a second-level ID of 8350, and a third-level ID of 17023. These three IDs are combined into a triplet content type identifier and stored in the metadata. An inverted index is built based on the triplets of all notes and stored in the retrieval engine, supporting fast searching by category. In subsequent processing, the triplet type identifier can be directly obtained based on the content ID of historical interaction content for encoder input.

[0068] This specification describes an implementation of a content recommendation scenario applied to a short video platform. The full content pool contains all videos uploaded to the platform, each assigned a unique content ID. For each video, the embedding vector of the content ID is fused with the video's visual feature vector to obtain an initial content vector. A top-down recursive K-means clustering algorithm is used to perform three layers of clustering on all initial content vectors: The first layer performs K-means clustering on the entire content pool, dividing all videos into several first-level clusters, with each video receiving a first-level ID to record its affiliation within the first-level category; the second layer performs K-means clustering within each first-level cluster, further dividing the videos within that cluster into several second-level clusters, with each video receiving a second-level ID; the third layer performs K-means clustering within each second-level cluster, obtaining tertiary clusters, with each video receiving a third-level ID. The number of clusters in each layer matches the size of the ID space for each layer. After clustering, video "video_032" is assigned a first-level ID of 305, a second-level ID of 12068, and a third-level ID of 21045. These three IDs are combined into a triplet content type identifier and stored in the video metadata. An inverted index from the triplets of all videos is constructed and stored in the retrieval engine, supporting rapid retrieval of videos of the same category by content type. Subsequently, for any historically interacted video, its triplet type identifier can be directly read for encoder input.

[0069] By constructing an initial vector based on content IDs and automatically generating multi-level content type identifiers using hierarchical clustering, hierarchical category relationships between content can be discovered without manual annotation. The generated triplet identifiers facilitate the encoder's unified processing of hierarchical category information, providing basic data with both semantic hierarchy and query efficiency for interest representation encoding and recommendation result retrieval.

[0070] In one optional embodiment of this specification, the target recommendation model further includes a type identification mapping layer and a feature fusion layer. The feature fusion layer includes a fully connected network layer. Accordingly, before step 104, the following steps are also included: Based on the embedding matrix of the type identifier mapping layer, feature extraction is performed on the type identifier of historical interaction content and the interaction type corresponding to the historical interaction content to obtain the content type vector corresponding to the historical interaction content and the behavior vector corresponding to the interaction type. The content type vector of the first historical interaction content and the behavior vector of the corresponding interaction behavior are concatenated to obtain the initial behavior representation vector of the first historical interaction content, where the first historical interaction content is any historical interaction content; Based on the feature fusion layer of the fully connected network layer, features are extracted from the initial behavior representation vector to obtain the target behavior representation vector corresponding to the first historical interaction content; Accordingly, step 104 also includes the following steps: The encoder of the target recommendation model encodes the target behavior representation vector to generate a sequence of interest representations of the target user.

[0071] The type identifier mapping layer is a network layer in the target recommendation model used to map discrete content type identifiers and interaction types into dense vector representations. The type identifier mapping layer contains an embedding matrix, which uses a lookup table operation to encode each category's identifier into a fixed-dimensional vector, enabling subsequent network layers to perform numerical calculations on category information. For example, the type identifier mapping layer can set independent embedding matrices for each of the three sub-type identifiers of the content type, with the number of rows in each embedding matrix equal to the size of the corresponding layer's codebook and the number of columns equal to the preset embedding dimension. Alternatively, a separate embedding matrix can be set for each interaction type, mapping each interaction behavior category to a corresponding behavior vector.

[0072] The feature fusion layer is a network structure in a target recommendation model used to fuse feature vectors of different types. It contains fully connected network layers and performs feature crossing and dimensionality transformation on the concatenated vectors through linear transformations and non-linear activations to generate a more expressive fused representation. For example, the feature fusion layer can consist of multiple fully connected networks, each containing a weight matrix and a bias term, followed by an activation function. Alternatively, the feature fusion layer can perform batch normalization after the concatenation operation before inputting it into the fully connected network layer for feature extraction.

[0073] The content type vector is a vector representation obtained by embedding the content type identifiers of historical interaction content into the type identifier mapping layer. It is used to convert discrete hierarchical category encodings into continuous vectors, enabling the model to capture semantic relationships between different categories. For example, when the content type identifier is in triplet form, the content type vector can be obtained by concatenating or adding the three embedding vectors after mapping each layer number in the triplet through the embedding matrix of the corresponding layer; for example, the content type vector can be obtained by mapping the complete content type identifier as a whole through a unified embedding matrix.

[0074] Behavior vectors are vector representations obtained by embedding the interaction types of historical interaction content through a type identifier mapping layer. Behavior vectors are used to convert discrete behavior categories into continuous vectors, enabling the model to distinguish the interest intensity reflected by different interaction behaviors. For example, the interaction type "like" is mapped to a fixed-dimensional behavior vector through the embedding matrix, while the interaction type "complete broadcast" is mapped to a different behavior vector. For example, interaction types can be pre-encoded according to their behavior intensity and then input into the embedding matrix, making behaviors of similar intensity closer together in the vector space.

[0075] The initial behavior representation vector is a vector obtained by concatenating the content type vector and the behavior vector. It is used to combine content category information and user behavior information into a single vector representation. For example, the initial behavior representation vector can be a longer vector obtained by concatenating the content type vector and the behavior vector end to end in the dimensional direction; for example, the initial behavior representation vector can also be a vector obtained by adding or weighting the content type vector and the behavior vector element by element.

[0076] The target behavior representation vector is a fused vector obtained by the feature fusion layer after extracting features from the initial behavior representation vector. The target behavior representation vector serves as the direct input to the encoder. Based on the initial behavior representation vector, it undergoes a non-linear transformation through a fully connected network, further fusing the cross-information between content type features and behavior type features. For example, the target behavior representation vector can be the output vector after the initial behavior representation vector passes through two fully connected network layers, with the same or different dimensions as the initial behavior representation vector; alternatively, the target behavior representation vector can be obtained by mapping the concatenated content type vector and behavior vector to a vector space with the same dimensions as the encoder input through a fully connected network.

[0077] Based on the embedding matrix of the type identifier mapping layer, features are extracted from the type identifier of historical interaction content and the interaction type corresponding to the historical interaction content to obtain the content type vector corresponding to the historical interaction content and the behavior vector corresponding to the interaction type. Specifically, it can be an operation of looking up the corresponding embedding vector from the embedding matrix according to each subtype identifier or the overall identifier in the content type identifier, and at the same time looking up the behavior vector from the behavior embedding matrix according to the interaction type.

[0078] One optional implementation involves obtaining three embedding vectors from the first, second, and third layer embedding matrices respectively, based on the layer numbers. These three embedding vectors are then concatenated or added to obtain the content type vector. Simultaneously, a behavior vector is obtained from the behavior embedding matrix corresponding to the interaction type. For example, if the triples of historical interaction content are first layer number 102, second layer number 8350, and third layer number 17023, the corresponding embedding vectors are extracted from the three layer embedding matrices and concatenated to obtain the content type vector. Then, the corresponding behavior vector is extracted from the behavior embedding matrix based on the interaction type "like".

[0079] One alternative implementation involves using the complete content type identifier as an index to look up the content type vector in a unified content type embedding matrix; and simultaneously looking up the behavior vector in a behavior embedding matrix based on the interaction type.

[0080] The initial behavior representation vector of the first historical interaction content is obtained by concatenating the content type vector and the behavior vector of the corresponding interaction behavior. Specifically, this can be achieved by concatenating the content type vector and the behavior vector end-to-end along their respective vector dimensions to form a long vector with a dimension equal to the sum of their dimensions. One optional implementation is to concatenate the content type vector (dimension d1) and the behavior vector (dimension d2) to obtain an initial behavior representation vector with dimensions d1 plus d2; for example, if the content type vector is 256-dimensional and the behavior vector is 64-dimensional, the concatenation results in a 320-dimensional initial behavior representation vector. Another optional implementation is to perform the concatenation in a preset order, such as with the content type vector first and the behavior vector second.

[0081] A fully connected network layer based on the feature fusion layer extracts features from the initial behavior representation vector to obtain the target behavior representation vector corresponding to the first historical interaction content. Specifically, this can be achieved by inputting the initial behavior representation vector into the fully connected network layer, performing a non-linear mapping through linear transformation and activation functions, and outputting the fused feature vector. One optional implementation is that the fully connected network layer contains at least one fully connected layer. Each layer performs matrix multiplication and weighted summation on the input vector, then passes it through an activation function to output the target behavior representation vector. For example, a 320-dimensional initial behavior representation vector can be input into a network containing two fully connected layers. The first layer maps the 320 dimensions to 256 dimensions, passes it through a ReLU activation function, and the second layer maps the 256 dimensions back to 256 dimensions, resulting in a 256-dimensional target behavior representation vector. Another optional implementation is that a normalization layer or residual connection can be added after the fully connected network layer to improve the stability of feature fusion.

[0082] The encoder of the target recommendation model encodes the target behavior representation vectors to generate a sequence of interest representations for the target user. Specifically, this can be achieved by arranging the target behavior representation vectors corresponding to each historical interaction in chronological order, inputting them into the encoder, and then using a self-attention mechanism or other sequence modeling methods to fuse sequence context information into each vector, outputting the interest representation vector corresponding to each position. An optional implementation involves inputting the target behavior representation vector sequence into an encoder based on a multi-head self-attention mechanism. The encoder calculates the attention weight between the vector at each position and the other vectors in the sequence, aggregating information from other positions based on the attention weights, and outputting an interest representation vector that incorporates the global context, thus forming an interest representation sequence. For example, if a user has three historical interactions, the corresponding three target behavior representation vectors form a sequence. After processing by the encoder, the output vector at each position contains the behavior information from the other two positions. Another optional implementation involves directly using the interest representation sequence output by the encoder to concatenate it with the target recommendation strategy before inputting it into a multi-task decoder.

[0083] This specification describes an implementation of a personalized recommendation scenario applied to a content sharing platform. The target user has three historical interaction records. The content type identifiers are in the form of triples: for note "note_001", the triples are layer 102, layer 8350, and layer 17023; for note "note_056", the triples are layer 305, layer 12068, and layer 21045; and for note "note_203", the triples are layer 102, layer 8350, and layer 18012. The corresponding interaction types are "like", "completed", and "favorited". The target recommendation model includes a type identifier mapping layer, a feature fusion layer, and an encoder. In the type identifier mapping layer, embedding matrices are set for the three subtype identifiers. The number of rows in each embedding matrix is ​​8192, which is the size of the codebook for the corresponding layer. For the note "note_001", the embedding vectors of the first layer number 102, the second layer number 8350, and the third layer number 17023 in its triple are extracted from the three embedding matrices and concatenated to obtain the content type vector. At the same time, the behavior vector is extracted from the behavior embedding matrix according to "like". The content type vector and the behavior vector are concatenated in the dimensional direction to obtain the initial behavior representation vector. The initial behavior representation vector is input into the fully connected network layer of the feature fusion layer. After nonlinear transformation by two fully connected network layers, the target behavior representation vector is output. The same operation is performed on notes "note_056" and "note_203" to obtain three target behavior representation vectors. These are arranged into a sequence according to the interaction time and input into the encoder. The encoder fuses the sequence context information of each vector through a self-attention mechanism and outputs three interest representation vectors to form the interest representation sequence of the target user.

[0084] This specification describes an implementation of a personalized recommendation scenario applied to a content sharing platform. The user's historical interaction content includes three notes, which are sequentially mapped to semantic numbers in a triplet. The numbers at each level of the triplet are: Level 1: 102; Level 2: 8350; Level 3: 17023 and interaction behavior type "like"; Level 1: 305; Level 2: 12068; Level 3: 21045 and interaction behavior type "complete broadcast"; Level 1: 102; Level 2: 8350; Level 3: 18012 and interaction behavior type "favorite". The interaction behavior type ranges from 0 to 2047, covering behaviors such as clicking, liking, and forwarding. The layer numbers in the triplet of the first note are mapped to embedding vectors using a three-layer learnable embedding matrix. The interaction type "like" is mapped to a behavior vector using a behavior embedding matrix. The embedding vectors and behavior vectors are concatenated and input into a two-layer fully connected network, each followed by a LeakyReLU activation function. After feature fusion and dimensionality transformation, the output is a comprehensive representation vector for the first note. The same operation is performed on the second and third notes, resulting in three comprehensive representation vectors for each note. These vectors are arranged in chronological order of interaction and input into an encoder. The encoder uses a self-attention mechanism to fuse sequence context information into each vector, outputting three interest representation vectors to form the target user's interest representation sequence, which is then passed to the subsequent multi-task decoding process.

[0085] By introducing a type identifier mapping layer and a feature fusion layer, discrete content type identifiers and interaction types are embedded and mapped before the encoder encodes to obtain content type vectors and behavior vectors. After concatenation, feature fusion is performed through a fully connected network. This allows the target behavior representation vector input to the encoder to not only contain multi-level category information of the content and interaction behavior information, but also achieve cross-fusion between the two types of features through the nonlinear transformation of the fully connected network. This improves the encoder's ability to jointly model content features and behavior features in user behavior sequences, providing a more sufficient feature foundation for generating more expressive interest representation sequences.

[0086] In one optional embodiment of this specification, step 104 further includes the following steps: Obtain the target behavior representation vector corresponding to each historical interaction content. The target behavior representation vector is used to represent the content types of multiple levels of historical interaction content and the behavior types corresponding to historical interaction content. Construct a sequence of behavior representations based on the behavior representation vectors of each target; The behavior representation sequence is input into the encoder. For each target behavior representation vector in the behavior representation sequence, the information of the other target behavior representation vectors in the behavior representation sequence is fused to obtain the interest representation vector. Based on each interest representation vector, the interest representation sequence of the target user is obtained.

[0087] The target behavior representation vector is a comprehensive vector used to characterize the multi-level content types and corresponding behavior types of historical interaction content. The target behavior representation vector integrates the category information of the content at each level and the user's interaction behavior type with that content, providing the encoder with a multi-dimensional feature representation of each interaction behavior. For example, the target behavior representation vector can be determined by the above embodiments.

[0088] Interest representation vectors are vectors output by the encoder after fusing contextual information into the target behavior representation vectors of the behavior representation sequence. Interest representation vectors not only contain the original content type and behavior type information of the corresponding location, but also aggregate information from other interactive behaviors in the sequence through an attention mechanism, reflecting the user's comprehensive interest at that location from the perspective of the overall behavior sequence.

[0089] Based on the target behavior representation vectors, a behavior representation sequence is constructed. Specifically, this can be an operation that arranges the target behavior representation vectors sequentially according to the interaction time order of each historical interaction content, forming a sequence of data. One optional implementation is to sort the target behavior representation vectors from earliest to latest according to the timestamp of the interaction behavior, forming a vector sequence of length equal to the number of historical interactions. For example, the vector corresponding to the earliest liked video is placed in the first position of the sequence, and the vector corresponding to the most recently completed video is placed in the third position. Another optional implementation is to attach a positional encoding to the target behavior representation vector at each position, enabling the encoder to identify the temporal position information of each vector in the sequence.

[0090] The behavior representation sequence is input into the encoder. For each target behavior representation vector in the behavior representation sequence, the information of the other target behavior representation vectors in the behavior representation sequence is fused to obtain the interest representation vector. Specifically, the encoder can calculate the attention weight between the vector at each position in the sequence and all position vectors in the sequence, perform weighted aggregation on the vector information at other positions based on the attention weight, fuse the aggregated context information with the current position vector, and output the interest representation vector corresponding to that position.

[0091] One possible implementation is that the encoder employs a multi-head self-attention mechanism, calculating a query vector, key vector, and value vector for each position vector. Attention weights are calculated by the dot product of the query vector and the key vector. The value vectors are then weighted and summed based on the weights to obtain the context representation of that position. Finally, a residual connection and layer normalization are performed with the original vectors to obtain the interest representation vector. For example, if the attention weights calculated between the third vector and the first vector in the sequence are higher, it indicates a strong interest correlation between the two interactions, and the third interest representation vector incorporates some information from the first vector.

[0092] In one alternative implementation, the encoder may also employ a recurrent neural network or a long short-term memory network to gradually fuse information from preceding positions in the sequence in a recursive manner.

[0093] Based on each interest representation vector, the interest representation sequence of the target user is obtained. Specifically, this can be achieved by preserving the interest representation vectors at each position output by the encoder in their original order, forming a vector sequence of the same length as the behavior representation sequence, which serves as the interest representation sequence of the target user.

[0094] One possible implementation is that each vector in the interest representation sequence corresponds to one historical interaction, and the dimension of the vector is consistent with the output dimension of the encoder. The sequence is then passed to the subsequent multi-task decoder. For example, the three interest representation vectors corresponding to three historical interactions constitute the interest representation sequence.

[0095] One possible implementation is to perform a pooling operation, such as average pooling or max pooling, on the interest representation sequence to obtain a fixed-length user interest vector, which serves as an aggregated representation of the interest representation sequence.

[0096] By constructing the target behavior representation vector into a behavior representation sequence and inputting it into the encoder for contextual information fusion, each vector in the interest representation sequence not only contains independent features of the corresponding interaction, but also aggregates information from other historical user interactions, providing a more comprehensive and accurate user understanding foundation for the multi-task decoder.

[0097] Step 106: Obtain the target recommendation strategy. Input the interest representation sequence and the target recommendation strategy into the multi-task decoder to generate the content information to be recommended. The multi-task decoder is trained based on multiple candidate recommendation strategies, and the target recommendation strategy is at least one of the multiple candidate recommendation strategies.

[0098] The target recommendation strategy is the recommendation strategy specified in the current recommendation request, used to determine which recommendation logic the multi-task decoder executes. The target recommendation strategy is selected from multiple candidate recommendation strategies. By switching the input strategy, the same decoder can generate content to be recommended that meets different recommendation goals. For example, the target recommendation strategy could be a strategy to increase user activity, under which the decoder prioritizes content types that are likely to trigger user clicks and interactions; alternatively, the target recommendation strategy could be a strategy to increase user consumption time, under which the decoder prioritizes content types with longer consumption durations or those that are easy to consume in an immersive way.

[0099] Candidate recommendation strategies are a collection of multiple recommendation strategies used by the multi-task decoder during the training phase. These strategies provide different training objectives for the multi-task decoder, enabling it to learn the ability to respond to various recommendation strategies during the learning process. For example, candidate recommendation strategies may include strategies to increase activity levels, increase consumption duration, and increase content diversity. For example, each candidate recommendation strategy corresponds to an independent task vector, and during training, switching task vectors allows the decoder to learn the recommendation generation logic under different strategies.

[0100] A multi-task decoder is a decoding component in a target recommendation model that generates corresponding recommendation results based on different recommendation strategy inputs. The multi-task decoder is jointly trained using training tasks corresponding to multiple candidate recommendation strategies. During the inference phase, it switches between different recommendation generation logics by receiving different target recommendation strategies. For example, during the training phase, the multi-task decoder uses two candidate recommendation strategies—increasing activity level and increasing consumption duration—for multi-task training. During the inference phase, when the task vector corresponding to the activity level strategy is input, it generates recommendation content emphasizing activity level; when the task vector corresponding to the consumption duration strategy is input, it generates recommendation content emphasizing consumption duration.

[0101] The content to be recommended information is intermediate information generated by the multi-task decoder based on the interest representation sequence and the target recommendation strategy, used to determine the final recommended content. For example, the content to be recommended information can be a target content type identifier, composed of multiple levels of sub-content type identifiers, indicating the category to which the recommended content should belong; for example, the content to be recommended information can be a list of content numbers or a content vector, directly corresponding to specific candidate recommended content.

[0102] The process involves obtaining the target recommendation strategy, inputting the interest representation sequence and the target recommendation strategy into a multi-task decoder, and generating information about the content to be recommended. Specifically, this can be done by reading the identifier of the target recommendation strategy from the recommendation request, converting the strategy into a corresponding task vector, combining the task vector with the interest representation sequence, and inputting the result into the multi-task decoder. The decoder then generates the type of content to be recommended or content information according to the strategy instructions.

[0103] One optional implementation involves reading the value of the target recommendation strategy field from the recommendation request, looking up the target task vector corresponding to the strategy in the strategy vector mapping table, concatenating the target task vector with each interest representation vector in the interest representation sequence to obtain the target task sequence, and inputting the target task sequence into a multi-task decoder for decoding. For example, if the target recommendation strategy specified in the recommendation request is "increase activity level", the task vector corresponding to the strategy is obtained from the mapping table, and the task vector is concatenated to each interest representation vector to form the target task sequence, which is then input into the decoder.

[0104] For example, the target recommendation strategy can be composed of multiple candidate recommendation strategies. The task vectors corresponding to the multiple candidate recommendation strategies are weighted and fused or concatenated one by one and then combined with the interest representation sequence before being input into the decoder. For example, when both activity level and consumption duration need to be considered simultaneously, the task vectors corresponding to the two strategies are added according to their weights and then concatenated with the interest representation sequence. An optional implementation is that the multi-task decoder decodes the target task sequence based on a self-attention mechanism. During the decoding process, the task vectors participate in the attention calculation with the interest representation vectors, so that the generated content information to be recommended is simultaneously influenced by both user interests and recommendation strategies.

[0105] This specification describes an implementation of a personalized recommendation scenario applied to a content sharing platform. The target user's interest representation sequence is generated by an encoder, containing three interest representation vectors, corresponding to the user's historical likes, views, and favorites of three notes. The recommendation request specifies the target recommendation strategy as "increase activity," and the target task vector corresponding to this strategy is obtained by looking up a pre-defined strategy vector mapping table. The target task vector is then concatenated dimensionally with the three interest representation vectors. Each concatenated vector with the target task vector results in a concatenated vector, and the three concatenated vectors constitute the target task sequence. The target task sequence is input into a multi-task decoder, which performs self-attention decoding. During decoding, the target task vector and the interest representation vectors interact with each other to generate information about the content to be recommended. This information is a target content type identifier composed of three layers of sub-content type identifiers, indicating that the recommended content should belong to that category.

[0106] This specification describes an implementation of a content recommendation scenario applied to a short video platform. The target user's recent interest representation sequence reflects a strong interest in content related to "technology / artificial intelligence / natural language processing." The target recommendation strategy in the recommendation request is specified as "increasing consumption time." The target task vector corresponding to this strategy is obtained from the strategy vector mapping table. This target task vector is concatenated with each interest representation vector in the interest representation sequence and then input into a multi-task decoder. Guided by the target recommendation strategy, the decoder integrates user interests and the recommendation goal of increasing consumption time to generate content information to be recommended. This content information serves as a target content type identifier, corresponding to the "technology / artificial intelligence / deep learning" category. Content in this category typically has longer durations and is easier to immerse the user in, aligning with the strategy goal of increasing consumption time.

[0107] By acquiring the target recommendation strategy and inputting the interest representation sequence along with the target recommendation strategy into the multi-task decoder, the decoder can generate the content information to be recommended based on the user's interest representation and the guidance direction of the current recommendation strategy. A single model can respond to multiple recommendation strategies without the need to train and deploy independent recommendation models for each strategy, thereby reducing the resource consumption for model training and maintenance.

[0108] In one optional embodiment of this specification, step 106 further includes the following steps: Obtain the target task vector corresponding to the target recommendation strategy, and concatenate the target task vector with the interest representation sequence to obtain the target task sequence; The target task sequence is input into the multi-task decoder to generate content information to be recommended.

[0109] The target task vector is a vectorized representation of the target recommendation policy, used to encode the recommendation policy into a continuous vector form acceptable to the multi-task decoder. By concatenating the target task vector with the interest representation sequence at the input, the decoder can identify the recommendation logic to be executed. For example, the target task vector can be a policy embedding vector learned along with the decoder parameters during multi-task training; alternatively, it can be a vector retrieved from a pre-defined policy vector mapping table based on the target recommendation policy identifier.

[0110] The target task sequence is a sequence of data obtained by concatenating the target task vector with each interest representation vector in the interest representation sequence. The target task sequence is used to inject recommendation policy information into each position of the user interest representation, enabling the decoder to perceive the current recommendation target when processing each interest representation. For example, the target task sequence can be a sequence of three concatenated vectors, each containing both user interest information and policy guidance information, obtained by concatenating a target task vector with three interest representation vectors respectively.

[0111] Obtain the target task vector corresponding to the target recommendation strategy, and concatenate the target task vector with the interest representation sequence to obtain the target task sequence. Specifically, this can be done by reading the corresponding vector from the strategy vector mapping table according to the identifier of the target recommendation strategy, and performing a head-to-tail connection operation between the vector and each interest representation vector in the interest representation sequence in the dimensional direction.

[0112] One possible implementation is to pre-assign a learnable task vector to each candidate recommendation strategy, store it in a strategy vector mapping table after training, and directly look up the target task vector in the table according to the target recommendation strategy identifier during inference. Then, concatenate the target task vector to each interest representation vector in the interest representation sequence to form the target task sequence.

[0113] An alternative implementation is to concatenate the target task vector to the beginning of the interest representation sequence or the beginning of the overall sequence, rather than to each interest representation vector.

[0114] The target task sequence is input into a multi-task decoder to generate information on the content to be recommended. Specifically, the target task sequence, which integrates strategy information and interest information, is input into the multi-task decoder. The decoder decodes the vector at each position in the sequence through a self-attention mechanism to generate information representing the type or range of recommended content.

[0115] An optional implementation specifically includes the following steps: Based on a multi-task decoder, the target task sequence is decoded, and the probability distribution of sub-content types of the content to be recommended is generated layer by layer. Based on the probability distribution of each level, a preset threshold sub-content type identifier is determined from each level using a preset search algorithm. Based on the sub-content type identifiers, a target content type identifier is constructed, which is used to characterize the content type of the content to be recommended.

[0116] Sub-content type identifiers are category codes at a certain level within the target content type identifiers, used to describe the category to which the content to be recommended belongs at a specific granular level. For example, a first-level sub-content type identifier can indicate the first-level category of the content, a second-level sub-content type identifier can indicate the second-level category under that category, and a third-level sub-content type identifier can indicate the finest-grained third-level category.

[0117] The preset search algorithm is a selection strategy used to choose sub-content type identifiers from the probability distribution at each level. The preset search algorithm determines the final selected sub-type from multiple candidate sub-types according to preset thresholds or rules, ensuring that the recommendation results align with both user interests and strategy guidance. For example, the preset search algorithm can be a beam search, retaining the highest-probability candidates at each level and expanding layer by layer to ultimately select the path with the highest overall probability; alternatively, the preset search algorithm can be a greedy search, directly selecting the highest-probability sub-type at each level, or selecting all sub-types at each level whose probability values ​​exceed a preset threshold.

[0118] The target content type identifier is a code composed of sub-content type identifiers selected at each level in hierarchical order. It is used to represent the complete content type of the content to be recommended and is used to retrieve specific recommended content belonging to this category from the full content pool.

[0119] Based on a multi-task decoder, the target task sequence is decoded, and the probability distribution of the sub-content types of the content to be recommended is generated layer by layer. Specifically, after receiving the target task sequence which integrates the task vector and the interest representation sequence, the decoder decodes it step by step in hierarchical order, and outputs the probability value of each candidate sub-type at each layer.

[0120] Based on the probability distribution of each level, a preset threshold sub-content type identifier is determined from each level through a preset search algorithm. Specifically, this can be an operation that selects the sub-type number that meets the conditions from the candidates of each level according to the value of the probability distribution of each level and the selected search strategy.

[0121] One possible implementation is to use a greedy search to directly select the subtype identifier with the highest probability value at each level; for example, if the probability value corresponding to number 102 is the highest in the probability distribution of the first level, then 102 is selected as the subtype identifier of the first level.

[0122] One possible implementation is to use beam search, retain the k candidate subtypes with the highest probability in the first layer, expand the second layer for each candidate and calculate the joint probability, retain the k paths with the highest joint probability, and finally select the subtype identifiers of each layer traversed by the path with the highest overall probability; for example, the beam width is set to 10, the first layer retains 10 candidates, the second layer expands each candidate into 10 second-layer candidates, a total of 10 paths, and the 10 paths with the highest joint probability are retained for further expansion.

[0123] Based on each sub-content type identifier, a target content type identifier is constructed. Specifically, this can be an operation that combines the selected sub-content type identifiers at each level into a complete content type identifier in hierarchical order.

[0124] This specification describes an implementation of a personalized recommendation scenario applied to a content sharing platform. The task set includes three candidate recommendation strategies: increasing activity level, increasing consumption time, and increasing interaction rate. Each candidate strategy is assigned a learnable task cue embedding vector. The recommendation request specifies the target recommendation strategy as increasing activity level. The task cue embedding vector corresponding to this strategy is retrieved from a strategy vector mapping table and concatenated to the front end of the target user's interest representation sequence to form a target task sequence. The target task sequence is then input into a multi-task decoder. The decoder employs a three-layer progressive decoding structure, with each layer having a codebook size of 8192. In the first layer of decoding, the decoder generates a probability distribution of the first-layer sub-content types based on the target task sequence. A pruned bundle search is used for candidate selection, with a bundle width of 10. From 8192 candidate sub-types, the 10 first-layer candidate sub-types with the highest joint probability are retained. In the second layer of decoding, using each first-layer candidate sub-type as a condition, the decoder generates a conditional probability distribution of the second-layer sub-content types. For each first-layer candidate, 10 second-layer candidates are retained, resulting in 100 combinations of candidates from the first two layers. From these, the 10 with the highest joint probability are retained. In the third layer of decoding, using each combination of candidates from the first two layers as a condition, the decoder generates a conditional probability distribution of the third-layer sub-content types. For each candidate combination, 10 third-layer candidates are retained. After three layers of inference, approximately 1000 candidate triples are obtained. From these, the 200 semantically encoded triples with the highest joint probability are selected as the target content type identifiers. The 200 triples generated by the activity enhancement task are written into a key-value store for online recommendation services to read. When a user initiates a recommendation request, the pre-generated recommendation content type corresponding to the task can be directly retrieved from the key-value store, and notes belonging to these types can be quickly recalled for recommendation.

[0125] Similarly, for the two tasks of increasing consumption time and increasing interaction rate, the corresponding task prompts are embedded into vectors and concatenated to the front end of the same user's interest representation sequence. After being decoded by a multi-task decoder, 200 triples are generated and written into the key-value storage. The online service can quickly switch to read the corresponding recommended content type according to different recommendation strategies, realizing flexible switching of multiple recommendation strategies supported by the same model.

[0126] By generating probability distributions of sub-content types layer by layer through a multi-task decoder and determining sub-type identifiers from each layer using a preset search algorithm, the decoder can generate recommended content types in an orderly manner according to the hierarchical structure of the content classification system, thereby improving the accuracy and diversity of recommended content types.

[0127] One possible implementation is that the multi-task decoder can generate sub-type identifiers for each level of the content to be recommended layer by layer, first determining the first-level category, then determining the second-level category based on the first-level category, and finally determining the third-level category.

[0128] This specification describes an implementation of a personalized recommendation scenario applied to a content sharing platform. The task set includes three candidate recommendation strategies: increasing user activity, increasing consumption time, and increasing interaction rate. Each candidate strategy is assigned a learnable task cue embedding vector, which is stored in a strategy vector mapping table after training. The recommendation request specifies the target recommendation strategy as increasing user activity, and the corresponding task cue embedding vector is retrieved from the strategy vector mapping table. The target user's interest representation sequence is generated by an encoder and contains three interest representation vectors, corresponding to the user's historical likes on notes in the "Technology / Artificial Intelligence / Natural Language Processing" category, completion views on notes in the "Lifestyle / Food / Baking" category, and collections of notes in the "Technology / Artificial Intelligence / Deep Learning" category. The task cue embedding vector corresponding to increasing user activity is concatenated to the beginning of the interest representation sequence to form the target task sequence, which is composed of the task cue embedding vector and the three interest representation vectors concatenated sequentially. The target task sequence is input into the multi-task decoder, which performs self-attention decoding on the target task sequence. The task prompt embedding vector is used as the starting position of the sequence to participate in the attention calculation, so that the decoder can perceive that the current task is to improve activity when processing the subsequent interest representation vector. Based on the distribution of user interest in technology and lifestyle content and the preference of the activity improvement strategy for content that is easy to click and interact with, the recommended content information is generated. The recommended content information is the target content type identifier, corresponding to the "lifestyle / food / baking" category. Content in this category is easy to trigger user likes and comments.

[0129] By transforming the target recommendation strategy into a target task vector and concatenating it with the interest representation sequence to form a target task sequence, the strategy information is directly integrated into each interest representation vector. During decoding, the multi-task decoder can simultaneously perceive the user's interest distribution and the current recommendation strategy orientation, realizing the application of multiple recommendation strategies within a single model and reducing the model deployment and maintenance costs in multi-strategy scenarios.

[0130] Step 108: Based on the information of the content to be recommended, determine the target recommended content for the target user.

[0131] The content to be recommended information is intermediate information generated by the multi-task decoder to determine the recommended content. For example, the content to be recommended information may be a target content type identifier; for example, the content to be recommended information may also be a set of content numbers.

[0132] The target recommended content is the specific content item that is ultimately determined and pushed to the target user. For example, the target recommended content may be several videos or notes displayed in the recommendation stream.

[0133] Based on the information of the content to be recommended, the target recommended content for the target user is determined. Specifically, this can be an operation of retrieving and filtering the final recommended content from the full content pool based on the information of the content to be recommended. An optional implementation is that when the information of the content to be recommended is a target content type identifier, candidate content is retrieved from the inverted index using that identifier, and the target recommended content is obtained after sorting and filtering.

[0134] In one implementation of this specification, the target content type identifier generated by the multi-task decoder corresponds to the "Lifestyle / Food / Baking" category. Notes of this category are retrieved from the search engine as candidate recommended content. After sorting by interaction rate and deduplication, 10 notes are selected as target recommended content and returned to the client.

[0135] By determining the target recommended content from the full content pool based on the information of the content to be recommended, the recommendation intent generated by the decoder is accurately transformed into specific content that users can consume, thus ensuring the accuracy and usability of the recommendation results.

[0136] In one optional embodiment of this specification, step 108 further includes the following steps: Based on the target content identifier, search for candidate recommended content from the full content pool; Based on a preset arrangement order, target recommended content for the target user is obtained from the candidate recommended content. The preset arrangement order is determined based on the behavioral similarity between historical users of the first candidate recommended content. Historical users are users who have interacted with the first candidate recommended content, and the first candidate recommended content is any one of the candidate recommended content.

[0137] Candidate recommended content is all recommendable content belonging to the target content type, retrieved from the full content pool based on the target content type identifier. This candidate recommended content serves as a filter pool for the final recommendation results, from which the target recommended content is subsequently selected according to a preset arrangement.

[0138] The preset sorting order is a rule used to rank candidate recommended content based on the similarity of historical user behavior. Based on this preset sorting order, content that better matches the behavioral patterns of a user group can be prioritized for recommendation, ensuring that the recommendation results are not only related to content type but also to the content consumption preferences of user groups with similar behaviors. For example, the preset sorting order can be arranged from high to low weight based on the behavioral similarity calculated between users who have interacted with the candidate content; for example, the preset sorting order can prioritize content that user groups with high behavioral similarity have jointly consumed.

[0139] Historical users are members of a set of users who have interacted with candidate recommended content. Their behavioral data is used to calculate behavioral similarity between users, thereby determining the ranking weight of candidate recommended content. For example, historical users can be those who have liked, saved, or shared a particular note; for example, behavioral similarity between historical users can be measured by the amount of content they have interacted with together.

[0140] The target recommended content is the content selected from the candidate recommended content according to a preset arrangement order and ultimately pushed to the target user. It is the final output of the entire recommendation process. For example, the target recommended content can be several notes with the highest arrangement weight among the candidate recommended content; for example, the target recommended content can be a list of content selected based on the arrangement order and then filtered for deduplication and diversity.

[0141] Based on the target content identifier, candidate recommended content is searched from the full content pool. Specifically, this can be done by retrieving all content belonging to the same category from the inverted index of the full content pool based on the subtype numbers of each level of the target content type identifier, and using them as candidate recommended content.

[0142] One possible implementation is to use the triplet that identifies the target content type as the query key to retrieve the content list corresponding to the triplet from the inverted index of the retrieval engine; for example, if the target content type is identified by a triplet, all notes belonging to the category of the triplet are queried from the inverted index to obtain a list of candidate recommended content.

[0143] Based on a preset arrangement order, the target recommended content for the target user is selected from the candidate recommended content. Specifically, this can be done by sorting the candidate recommended content according to a predetermined arrangement weight, and selecting the top-ranked content from the sorting results as the target recommended content.

[0144] One possible implementation is to determine the preset arrangement order based on the behavioral similarity between historical users of the candidate recommended content, obtain the arrangement weight corresponding to each candidate recommended content, sort them from high to low weight, and select the top few items as target recommended content; for example, if there are 50 notes in the candidate recommended content list, each note has a corresponding target weight, and the top 10 notes are selected as target recommended content after being sorted in descending order of weight, and further diversity filtering or deduplication can be performed after sorting, for example, only the highest-ranked one of multiple articles by the same author can be retained to ensure the diversity of the recommendation results.

[0145] This specification describes one implementation of a homepage recommendation scenario for a content sharing platform. For inactive users' first visit to the homepage, a separate activity task generates a target content type identifier. The 60 semantic ID triples with the highest joint probability corresponding to this task are retrieved from the key-value store. Using these triples as query keys, the corresponding note numbers are obtained from the inverted index of the retrieval engine as candidate recommended content. These are then filtered and returned as the target recommended content in a preset order of descending joint probability. For general users, both time-based and interaction tasks are used. 30 semantic ID triples are randomly selected from the 200 generated by the time-based task, and 30 are randomly selected from the 200 generated by the interaction task, for a total of 60 semantic ID triples as target content type identifiers. The corresponding note numbers are retrieved from the inverted index of the retrieval engine as candidate recommended content. These are then filtered and returned as the target recommended content in a preset order of random selection.

[0146] By limiting the information of the content to be recommended to the target content type identifier, and searching for candidate content from the full content pool based on the identifier, and then filtering according to the arrangement order determined by the similarity of historical user behavior, the recommendation results can be refined by using the collaborative behavior signals of user groups to improve the personalization and accuracy of the recommendations, based on matching the content type.

[0147] In one optional embodiment of this specification, the following steps are included before step 108: Determine the initial set of users who will interact with the candidate recommended content; Based on each user in the initial user set, construct initial user pairs, where each initial user pair consists of any two users in the initial user set; Based on the behavioral similarity of users in the first initial user pair, the association weight of the first initial user pair is determined. The user behavioral similarity is determined based on the amount of content that each user has interacted with. The first initial user pair is any one of the initial user pairs. The association weight is negatively correlated with the amount of content that has been interacted with. Identify the target user pairs consisting of the set of users who interact with the first candidate recommended content, obtain the association weights corresponding to each target user pair, and determine the target weights of the first candidate recommended content based on each association weight; Based on the weights of each objective, the preset arrangement order of candidate recommended content is determined.

[0148] The initial user set is a collection of users who have interacted with the candidate recommended content. The initial user set provides user behavior data, laying the foundation for calculating the behavioral similarity between users. For example, the initial user set could be all users who have liked, saved, or shared a note; alternatively, it could be users who have interacted with the candidate content within a preset time period.

[0149] An initial user pair is a combination of any two users randomly selected from the initial user set. Initial user pairs are used to measure the degree of behavioral similarity between any two users. For example, if the initial user set contains users A, B, and C, then the initial user pairs include combinations (A, B), (A, C), and (B, C).

[0150] Association weight is a numerical value used to characterize the degree of behavioral association between two users, determined based on the behavioral similarity of the two users in the initial user pair. Association weight is negatively correlated with the amount of content the two users have interacted with together; that is, the less content they have interacted with, the higher the distinguishability of this shared interaction behavior when both users have interacted with the same candidate content, and the greater the association weight. For example, if two users have interacted with each other on 100 notes, the association weight is 0.01; if another pair of users has interacted with each other on 5 notes, the association weight is 0.2.

[0151] A target user pair is any two users from the set of users who have interacted with the first candidate recommendation content. The target user pair is used to calculate the target weight of the candidate recommendation content by combining its corresponding association weights.

[0152] The target weight is a numerical value derived from the sum of the association weights of each target user pair that interacted with the candidate recommended content. The target weight is used to rank the candidate recommended content; the higher the target weight, the higher the ranking of the candidate recommended content. For example, the target weight of a candidate recommended content can be the sum of the association weights of each target user pair.

[0153] Determine the initial set of users who have interacted with the candidate recommended content. Specifically, this can be formed by querying user behavior logs to find all users who have interacted with the content in the candidate recommended content list.

[0154] Initial user pairs are constructed based on the users in the initial user set, and the association weight is determined based on the behavioral similarity of the users in each initial user pair. Specifically, for any two users in the initial user set, the number of shared interactions between the two users can be calculated, and the association weight can be determined as a value negatively correlated with this number. An optional implementation is that the association weight is the reciprocal of the number of shared interactions or the reciprocal after smoothing.

[0155] The target user pairs are determined by identifying the set of users who have interacted with the first candidate recommended content. The association weights of each target user pair are obtained and summarized to obtain the target weight of the first candidate recommended content. Specifically, the target user pairs that have both interacted with the first candidate recommended content can be selected from the initial user pairs. The association weights of these target user pairs are summed to obtain the target weight of the candidate recommended content.

[0156] Based on the target weights, the preset arrangement order of the candidate recommended content is determined. Specifically, the candidate recommended content can be sorted from high to low according to the target weights. The higher the target weight, the more likely the content is associated with common interactive behaviors with distinctiveness, and the higher it is placed in the arrangement.

[0157] In one implementation of this specification, the multi-task decoder generates a target content type identifier corresponding to the "Lifestyle / Food / Baking" category and retrieves three candidate notes from the inverted index. Users who have interacted with these three notes are queried from the user behavior log, forming an initial user set including users A, B, C, and D. All pairwise combinations are constructed as initial user pairs, and the association weight of each user pair is calculated. Users A and B have interacted with 10 notes together, with an association weight of 0.1; users C and D have interacted with 50 notes together, with an association weight of 0.02. For candidate note M, whose interacting users are A, B, and C, the association weight of the target user pair (A, B) is 0.1, (A, C) is 0.05, and (B, C) is 0.04, resulting in a target weight of 0.19. Similarly, the target weights of candidate notes N and P are calculated, and they are sorted in descending order of target weight, with note M ranked first as the priority recommendation content.

[0158] By determining the order of candidate recommended content based on user behavior similarity, and with the association weight being negatively correlated with the number of shared user interactions, user behaviors that have a small scope of shared interactions but interact with the same candidate content are given higher differentiation. This allows for the discovery of more personalized content associations, improving the diversity and accuracy of recommendation results.

[0159] Corresponding to the embodiments of the content recommendation method described above, this specification also provides embodiments of the training method for the target recommendation model. See [link to documentation]. Figure 2 , Figure 2 A flowchart is shown of a training method for a target recommendation model according to an embodiment of this specification, which specifically includes the following steps.

[0160] Step 202: Obtain candidate recommendation models, which include pre-trained encoders and decoders to be trained.

[0161] The candidate recommendation model is an intermediate-state model containing a pre-trained encoder and a decoder to be trained. The encoder already possesses the ability to extract general interest representations, while the decoder needs to be optimized through multi-task training. For example, the candidate recommendation model can be a model with pre-trained encoder weights loaded and the decoder randomly initialized; for example, it can also be a model with the encoder partially frozen and the decoder to be fine-tuned.

[0162] The pre-trained encoder is an encoder component that has been trained and converged using a general interest representation, providing a mature foundation of interest representations for multi-task training. For example, it could be a Transformer encoder trained under self-supervised conditions based on large-scale interactive data.

[0163] The decoder to be trained is a decoder component whose parameters have not been trained on multiple tasks, and is used to generate corresponding recommended content through subsequent multi-task learning. For example, it can be a randomly initialized multi-layer self-attention decoding network.

[0164] Obtaining candidate recommendation models can be achieved by loading pre-trained encoder weights and initializing the decoder to be trained, then combining them into a candidate recommendation model. One approach is to load encoder weights from a model repository, randomly initialize decoder parameters, and combine them according to the encoder-decoder architecture.

[0165] In one implementation of this specification, pre-trained converged encoder weights are loaded from the model repository, and the decoder is randomly initialized. The two are combined to form a candidate recommendation model for subsequent multi-task training.

[0166] By reusing the pre-trained encoder, multi-task training can be carried out on the basis of mature interest representation extraction capabilities, shortening training time and reducing computational resource consumption.

[0167] In one optional embodiment of this specification, step 202 further includes the following steps: Obtain the sample dataset, which includes the initial sample interaction content, the interaction type corresponding to the initial sample interaction content, and the initial sample prediction content; The initial sample interaction content and the corresponding interaction type are input into the target recommendation model. Based on the predicted content of the initial sample, the encoder and decoder of the target recommendation model are trained with general interest representations. When the preset stopping condition is reached, a candidate recommendation model is obtained. The general interest representation training is used to learn the interest representation relationship between the multi-level types of content and the user's interaction behavior with the content.

[0168] The sample dataset is a collection of data used to train the candidate recommendation model with a general interest representation. It contains users' historical interaction content, interaction types, and corresponding prediction target content, providing the input and supervision signals required for model training. For example, the sample dataset can be sampled from user behavior logs, with each sample containing a user's historical interaction sequence and the corresponding next interaction content as the prediction target; for example, the sample dataset can also contain multiple interaction sequences from multiple users, covering different content types and interaction behaviors.

[0169] The initial sample interaction content consists of historical user interactions within the sample dataset that serve as input to the model. This content drives the encoder to learn how to extract user interest representations from the interaction content. For example, the initial sample interaction content could be a sequence of notes that a user clicked, liked, or saved over a past period.

[0170] The initial sample prediction content is the content to be predicted in the sample dataset that serves as the training supervision target. It is used to calculate the loss between the model output and the true target, guiding the parameter updates of the encoder and decoder. For example, the initial sample prediction content could be the next note from which a user actually interacts after a historical interaction sequence.

[0171] General interest representation training is a pre-training process used to learn the interest representation relationship between multi-level content types and user interaction behaviors. This enables the encoder to extract general interest representations from user interaction sequences, providing a mature parameter foundation for subsequent multi-task training. For example, general interest representation training can be self-supervised training aimed at predicting the content of the user's next interaction. Through this training, the encoder learns to map similar content types to similar vector spaces and distinguish the interest intensity reflected by different interaction behaviors.

[0172] The preset stopping condition is a criterion used to determine whether the training of the general interest representation is complete, striking a balance between training effectiveness and training cost. For example, the preset stopping condition could be that the loss value on the validation set no longer decreases for a certain number of consecutive iterations; for example, the preset stopping condition could also be that the training has reached a preset number of iterations.

[0173] Obtaining a sample dataset can specifically involve collecting user interaction sequence data from a user behavior log system, dividing each sequence into a historical interaction portion and a prediction target portion, and constructing the sample dataset. One optional implementation involves, for each user, taking the interaction sequence within a time window, using the first few interactions as the initial sample interaction content and corresponding interaction type, and using the next immediately following interaction content as the initial sample prediction content.

[0174] The initial sample interaction content and corresponding interaction type are input into the target recommendation model. Based on the initial sample prediction content, the encoder and decoder are trained with a general interest representation. Specifically, the historical interaction sequence can be input into the encoder to obtain the interest representation sequence, the decoder generates the prediction content information, the loss is calculated with the initial sample prediction content, and the encoder and decoder parameters are updated by backpropagation.

[0175] One possible implementation is that the encoder encodes the type identifier and interaction type of the initial sample interaction content to generate an interest representation sequence, the decoder predicts the type identifier of the next interaction content based on the interest representation sequence, compares the predicted type identifier with the type identifier of the initial sample predicted content to calculate the cross-entropy loss, and updates the model parameters through gradient descent.

[0176] An alternative implementation involves training the general interest representation using self-supervised tasks such as mask prediction or next interaction prediction, enabling the model to learn the correspondence between multi-level content types and user interaction behaviors. When a preset stopping condition is met, the model parameters at this point are saved as a candidate recommendation model, where the encoder parameters are the pre-trained encoder, and the decoder parameters are the initial state of the decoder to be trained.

[0177] In one implementation of this specification, a sample dataset is collected from user behavior logs. Each sample contains the user's five most recent interaction sequences and the content of the sixth actual interaction. The content type identifiers and interaction types of the five interactions are input into the model. The encoder extracts the interest representation sequence, and the decoder predicts the type identifier of the next interaction content. The loss is calculated by comparing this prediction with the true target. Iterative training continues until the loss on the validation set does not decrease for three consecutive rounds. The model at this point is saved as a candidate recommendation model. The encoder parameters are pre-trained, and the decoder parameters serve as the initial state for multi-task training.

[0178] By pre-training with general interest representations, the encoder learns the general interest representation relationship between multi-level content types and user interaction behaviors, enabling subsequent multi-task training to be carried out on the basis of mature encoder parameters. At the same time, the general interest knowledge learned in the pre-training stage can be shared among multiple recommendation strategies, improving the overall modeling efficiency.

[0179] Step 204: For each candidate recommendation strategy, construct a corresponding recommendation sample set, wherein the recommendation sample set includes sample interaction content under the corresponding candidate recommendation strategy, the interaction type corresponding to the sample interaction content, and sample prediction content information.

[0180] A recommendation sample set is a training dataset constructed for a specific candidate recommendation strategy. It includes sample interaction content, interaction type, and predicted sample content information under that strategy, and is used to specifically train the decoder for that strategy. For example, the recommendation sample set corresponding to the activity enhancement strategy has predicted sample content information that represents the types of content that users actually clicked or interacted with; similarly, the recommendation sample set corresponding to the consumption duration enhancement strategy has predicted sample content information that represents the types of content that users actually consumed for extended periods.

[0181] The sample prediction content information consists of the content to be predicted in the recommendation sample set, which serves as the training supervision target. This content guides the decoder in learning what kind of recommended content should be generated under the given recommendation strategy. For example, the sample prediction content information could be an identifier of the content type that the user actually interacts with under this strategy.

[0182] For each candidate recommendation strategy, a corresponding recommendation sample set is constructed. Specifically, this can be done by selecting interaction sequences that meet the criteria from user behavior logs based on the objective of each candidate recommendation strategy, and constructing training sample sets accordingly. One approach is to select sequences of positive user interactions such as clicks and likes as positive samples for the activity enhancement strategy; and to select sequences of users completing the entire video or staying for a long time as positive samples for the consumption duration enhancement strategy. Each sample uses historical interactions as input and the interaction content corresponding to the strategy objective as the prediction target.

[0183] In one implementation process described in this specification, for three candidate recommendation strategies—increasing activity, increasing consumption time, and increasing interaction rate—interaction sequences that meet the objectives of each strategy are selected from user behavior logs to construct three recommendation sample sets for multi-task training.

[0184] By constructing recommendation sample sets for each candidate recommendation strategy, the decoder can learn the differentiated patterns of user interaction behavior under different strategies during training, thereby generating corresponding recommendation content based on the input target strategy during inference.

[0185] Step 206: Based on the recommendation sample set corresponding to each candidate recommendation strategy, perform multi-task training on the decoder to be trained to obtain a multi-task decoder. Use the encoder and multi-task decoder as the target recommendation model after training to execute the above content recommendation method.

[0186] Multi-task training is the process of sequentially training a decoder to be trained using recommendation sample sets from multiple candidate recommendation strategies, enabling the decoder to learn the ability to respond to different recommendation strategies. For example, sample sets for three strategies—increasing activity, consumption duration, and interaction rate—can be trained sequentially, with each strategy sharing the same encoder, and only the decoder parameters being updated as the strategy is switched.

[0187] A multi-task decoder is a decoder component obtained after multi-task training. It contains the generation logic for multiple recommendation strategies and switches between executing corresponding tasks based on the input target strategy during inference. For example, when the task vector of the activity enhancement strategy is input, content types emphasizing interaction are generated; when the task vector of the consumption duration strategy is input, content types emphasizing long-term consumption are generated.

[0188] Based on the recommendation sample sets corresponding to each candidate recommendation strategy, the decoder to be trained is subjected to multi-task training to obtain a multi-task decoder. Specifically, the decoder can be iteratively trained using the sample sets of each strategy in a preset order. One approach is to determine one strategy from the untrained strategies as the current strategy, concatenate its task prompt embedding vector with the sample interaction sequence, input it into the decoder, calculate the prediction loss, and update the decoder parameters. After training, this becomes the initial state for training the next strategy, and this process is repeated until all strategies are completed. The pre-trained encoder and the multi-task decoder are combined to form the trained target recommendation model.

[0189] In one implementation of this specification, the decoder to be trained is sequentially trained using recommendation sample sets based on three strategies: increasing activity level, consumption duration, and interaction rate. Each round uses a sample set for one strategy and its corresponding task cue embedding vector, updates the decoder parameters, and saves the results for use in the next training round. After three rounds of training, a multi-task decoder is obtained, which is combined with the pre-trained encoder to form the trained target recommendation model.

[0190] By acquiring candidate recommendation models containing pre-trained encoders and decoders to be trained, and training the decoders to be trained on multiple tasks based on the recommendation sample sets of each candidate recommendation strategy, the decoders within a single model can learn the generation logic of multiple recommendation strategies. The general interest representation capabilities provided by the pre-trained encoder are shared among the strategies, eliminating the need to train and maintain models independently for each strategy, thus reducing the resource consumption of model training and deployment.

[0191] In one optional embodiment of this specification, step 206 further includes the following steps: The first candidate recommendation strategy is determined from the candidate recommendation strategies that have never been trained; Based on the first recommendation sample set corresponding to the first candidate recommendation strategy, the decoder to be trained is trained to obtain the intermediate decoder; The intermediate decoder is selected as the decoder to be trained. The operation of determining the first candidate recommendation strategy from the candidate recommendation strategies that have never been trained is repeated until all candidate recommendation strategies have been trained, and a multi-task decoder is obtained.

[0192] The first candidate recommendation strategy is selected from the candidate recommendation strategies that have not yet been trained, and is used as the task objective for the current training round. For example, among the three strategies of increasing activity, consumption duration, and interaction rate, increasing activity is initially selected as the first candidate recommendation strategy; for example, in the next round, consumption duration is selected as the first candidate recommendation strategy from the strategies that have not been trained.

[0193] The intermediate decoder is a decoder obtained after training on the recommendation sample set of the first candidate recommendation strategy, serving as an intermediate state before training the next strategy. For example, the decoder obtained after training on the sample set of the activity enhancement strategy is the intermediate decoder, and its parameters will serve as the initial state for training using the consumption duration strategy.

[0194] The first candidate recommendation strategy is determined from the candidate recommendation strategies that have not yet been trained. Specifically, this can be done by filtering the remaining strategies that have not yet been trained from the candidate recommendation strategy set and selecting one of them as the training task for the current round. One approach is to select them in a preset order.

[0195] Based on the first recommendation sample set corresponding to the first candidate recommendation strategy, the decoder to be trained is trained to obtain an intermediate decoder. This can be achieved by performing multiple rounds of iterative training on the current decoder using the sample set of the first strategy, updating the parameters to obtain the intermediate decoder. The intermediate decoder is then selected as the decoder to be trained, and the above operation is repeated until all strategies have been trained, resulting in a multi-task decoder.

[0196] Specifically, it may also include the following steps: Obtain the initial task vector, which is a vector obtained through random initialization; Based on the sample interaction content and the corresponding interaction type in the first recommended sample set, the sample interest representation sequence is determined. The sample task sequence is obtained by concatenating the sample interest representation sequence and the initial task vector and passing it through a pre-trained encoder. Input the sample task sequence into the decoder to be trained to generate initial recommendation content information; Based on the initial recommended content information and the sample predicted content information, the decoder to be trained and the initial task vector are adjusted. The operation of determining the sample interest representation sequence based on the sample interaction content and the interaction type corresponding to the sample interaction content is repeatedly executed until the preset training stopping condition is met, and the target task vector and intermediate decoder corresponding to the first candidate recommendation strategy are obtained.

[0197] The initial task vector is a set of learnable parameter vectors randomly initialized for the current candidate recommendation policy before training begins. During training, the initial task vector is optimized along with the decoder parameters, eventually converging to the target task vector corresponding to that policy. For example, the initial task vector can be a 64-dimensional vector randomly generated following a normal distribution; alternatively, it can be a vector sampled from a uniform distribution.

[0198] The target task vector is a vector representation obtained after training and convergence of the initial task vector, and is bound to the first candidate recommendation strategy. The target task vector is used to identify the recommendation strategy during the inference phase, enabling the decoder to recognize and execute the corresponding recommendation logic. For example, after training the activity enhancement strategy, a fixed target task vector is obtained and stored in a strategy vector mapping table; for example, different candidate recommendation strategies correspond to different target task vectors, and strategy switching is achieved during inference by switching the target task vector.

[0199] The sample interest representation sequence is a sequence of interest representation vectors obtained by encoding the sample interaction content and interaction type by an encoder, and is used as input for decoder training. For example, the sample interest representation sequence can be a vector sequence output by the encoder after encoding the triplet type identifier of the sample interaction content and the interaction behavior type.

[0200] The sample task sequence is a sequence obtained by concatenating the initial task vector with the sample interest representation sequence, and is used as input to the decoder to be trained. For example, the sample task sequence can be a sequence formed by concatenating the initial task vector to the beginning of the sample interest representation sequence.

[0201] Obtain the initial task vector; specifically, this can be achieved by randomly initializing a vector with the same dimension as the target task vector. Determine the sample interest representation sequence based on the sample interaction content and type in the first recommendation sample set; specifically, this can be obtained through encoding by a pre-trained encoder. Concatenate the sample interest representation sequence with the initial task vector, and then encode it through a pre-trained encoder to obtain the sample task sequence; specifically, this can be achieved by concatenating the initial task vector to the beginning of the sample interest representation sequence. Input the sample task sequence into the decoder to be trained to generate initial recommendation content information. Based on the loss between this and the predicted sample content information, update the decoder parameters and the initial task vector using gradients. Repeat the training until the stopping condition is met to obtain the target task vector and intermediate decoder corresponding to this strategy.

[0202] In one implementation process described in this specification, the candidate recommendation strategy includes three strategies: increasing user activity, increasing consumption time, and increasing interaction rate, which are referred to as the activity task, time task, and interaction task, respectively.

[0203] For each task, a fine-tuning dataset is constructed: The input for the activity task is a sequence of 300 notes recently clicked by inactive users on the homepage, and the goal is to generate the 4 notes that users will click on first after logging into the application in the next day; The input for the duration task is a sequence of 300 notes with high duration consumption on the homepage by users in the past 3 months, of which 150 are text and image notes with high duration, and video notes with high duration in each duration range, and the goal is to generate the note with the highest consumption time in each type for the user in the next day, which must be higher than the user's historical average consumption time for that type; The input for the interaction task is 300 notes with high interaction consumption on the homepage by users in the past 3 months, and the goal is to generate the 5 notes with high interaction for the user in the next day.

[0204] Each task is assigned a randomly initialized cue embedding vector as the initial task vector. The activity task is initially selected as the first candidate recommendation strategy. A batch of samples is taken from the fine-tuned dataset for this task. The historical interaction content and interaction type of 300 notes in the samples are encoded by a pre-trained encoder to obtain a sample interest representation sequence. The initial task vector corresponding to the activity task is concatenated to the beginning of this sequence to form a sample task sequence. This sequence is then input into the decoder to be trained to generate the initial recommendation content information, i.e., the predicted type identifiers of the four notes.

[0205] The cross-entropy loss between the predicted type identifier and the type identifiers of the four notes actually clicked by the user in the sample is calculated. Backpropagation is then used to update the decoder parameters and the task vector corresponding to the activity task. Iterative training continues until the validation set loss does not decrease for three consecutive rounds. The decoder at this point is saved as an intermediate decoder, and the task vector of the activity task converges to the target task vector corresponding to this strategy. The intermediate decoder is used as the decoder to be trained, and the duration task is selected as the first candidate recommendation strategy for the next round. Training continues using the fine-tuned dataset of the duration task to obtain a new intermediate decoder and the target task vector corresponding to the duration task. This new intermediate decoder is then used as the decoder to be trained again, and the interaction task is selected for further training. After three rounds of training, a multi-task decoder and the target task vectors corresponding to each of the three strategies are obtained.

[0206] The pre-trained encoder and multi-task decoder are combined to form a trained target recommendation model. The target task vectors of each policy are stored in a policy vector mapping table for use in the inference stage.

[0207] By simultaneously optimizing task vectors and decoder parameters during training, task vectors automatically learn the semantic representation of the corresponding policy, eliminating the need for manual design of policy features. Meanwhile, the decoder establishes a mapping relationship between task vectors and recommendation generation logic during training, allowing switching of recommendation policies to be achieved by switching task vectors during inference.

[0208] Through sequential training, the decoder gradually learns the generation logic of different strategies. The knowledge of each strategy is accumulated through parameter passing, ultimately enabling a single decoder to respond to multiple recommendation strategies.

[0209] The following is in conjunction with the appendix Figure 3 This paper takes the application of the content recommendation method provided in this manual to an external dual-column content sharing platform as an example to further explain the content recommendation method. Specifically, Figure 3 The diagram illustrates a visualization of a content recommendation method according to an embodiment of this specification. As shown, by acquiring the historical interaction content and corresponding interaction types of target user A, the encoder of the target recommendation model encodes the historical interaction content and corresponding interaction types to generate an interest representation sequence for the target user. The target recommendation strategy is then obtained as an interaction task recommendation strategy. The interest representation sequence and the target recommendation strategy are input into the multi-task decoder of the target recommendation model to generate information on content to be recommended. Based on this information, twenty target recommended content items for the target user are determined, and... Figure 3 The external double-column interface shown displays four of them, and the remaining target recommended content will be displayed in sequence when the user performs a swipe-down operation on the client.

[0210] Corresponding to the above method embodiments, this specification also provides embodiments of a content recommendation device. Figure 4 A schematic diagram of a content recommendation device according to one embodiment of this specification is shown. Figure 4 As shown, the device includes: The first acquisition module 402 is configured to acquire the target user's historical interaction content and the corresponding interaction type; The encoding module 404 is configured to encode historical interaction content and corresponding interaction types through the encoder of the target recommendation model to generate an interest representation sequence of the target user. The target recommendation model also includes a multi-task decoder. Decoding module 406 is configured to obtain the target recommendation strategy, input the interest representation sequence and the target recommendation strategy into the multi-task decoder, generate the content information to be recommended, the multi-task decoder is trained based on multiple candidate recommendation strategies, and the target recommendation strategy is at least one of the multiple candidate recommendation strategies; The first determining module 408 is configured to determine the target recommended content for the target user based on the information of the content to be recommended.

[0211] Optionally, the content recommendation device further includes a second acquisition module, configured to acquire historical content type identifiers corresponding to historical interaction content, wherein the historical content type identifiers consist of multiple sub-type identifiers with hierarchical relationships, used to characterize the content type of historical interaction content; correspondingly, the encoding module is further configured to encode the historical interaction content type identifiers and the interaction types corresponding to the historical interaction content through the encoder of the target recommendation model, to generate an interest representation sequence of the target user.

[0212] Optionally, the content recommendation device further includes a second determining module, configured to construct an initial content vector for each content based on the content ID of each content in the full content pool, wherein the content ID is used to uniquely represent the information of the corresponding content, and the full content pool contains historical interaction content; perform hierarchical clustering on each initial content vector based on a preset hierarchical clustering algorithm to determine the multi-level content types of each content; and determine the content type identifier of each content based on the multi-level content types.

[0213] Optionally, the target recommendation model further includes a type identifier mapping layer and a feature fusion layer, wherein the feature fusion layer includes a fully connected network layer; the content recommendation device further includes a feature extraction module, configured to extract features from the type identifier of historical interaction content and the interaction type corresponding to the historical interaction content based on the embedding matrix of the type identifier mapping layer, to obtain the content type vector corresponding to the historical interaction content and the behavior vector corresponding to the interaction type; concatenate the content type vector of the first historical interaction content and the behavior vector of the interaction behavior corresponding to the first historical interaction content to obtain the initial behavior representation vector of the first historical interaction content, wherein the first historical interaction content is any historical interaction content; and extract features from the initial behavior representation vector based on the fully connected network layer of the feature fusion layer to obtain the target behavior representation vector corresponding to the first historical interaction content; Accordingly, the encoding module is further configured to encode the target behavior representation vector to generate a sequence of interest representations of the target user.

[0214] Optionally, the encoding module is further configured to obtain target behavior representation vectors corresponding to each historical interaction content, wherein the target behavior representation vectors are used to characterize the content types of multiple levels of historical interaction content and the behavior types corresponding to the historical interaction content; construct a behavior representation sequence based on each target behavior representation vector; input the behavior representation sequence into the encoder, and for each target behavior representation vector in the behavior representation sequence, fuse the information of the other target behavior representation vectors in the behavior representation sequence to obtain an interest representation vector; and obtain the interest representation sequence of the target user based on each interest representation vector.

[0215] Optionally, the decoding module is further configured to obtain the target task vector corresponding to the target recommendation strategy, concatenate the target task vector with the interest representation sequence to obtain the target task sequence, and input the target task sequence into the multi-task decoder to generate the content information to be recommended.

[0216] Optionally, the decoding module is further configured to decode the target task sequence based on a multi-task decoder, and generate a probability distribution of the sub-content types of the content to be recommended layer by layer; based on the probability distribution of each layer, a preset threshold sub-content type identifier is determined from each layer through a preset search algorithm; based on each sub-content type identifier, a target content type identifier is constructed, wherein the target content type identifier is used to characterize the content type of the content to be recommended.

[0217] Optionally, the first determining module is further configured to search for candidate recommended content from the full content pool based on the target content identifier; and to filter the target recommended content for the target user from the candidate recommended content based on a preset arrangement order, wherein the preset arrangement order is determined based on the behavioral similarity between historical users of the first candidate recommended content, where historical users are users who have interacted with the first candidate recommended content, and the first candidate recommended content is any one of the candidate recommended content.

[0218] Optionally, the content recommendation device further includes a sorting module, configured to: determine an initial set of users who interact with candidate recommended content; construct initial user pairs based on each user in the initial user set, wherein each initial user pair includes any two users in the initial user set; determine the association weight of the first initial user pair based on the behavioral similarity of the users in the first initial user pair, wherein the user behavioral similarity is determined based on the number of content that each user has interacted with, the first initial user pair is any one of the initial user pairs, and the association weight is negatively correlated with the number of content that has been interacted with; determine target user pairs composed of the user set that interacts with the first candidate recommended content, and obtain the association weight corresponding to each target user pair, determine the target weight of the first candidate recommended content based on each association weight; and determine the preset arrangement order of the candidate recommended content based on each target weight.

[0219] The content recommendation device provided in this application encodes historical interaction content and interaction types through the encoder of the target recommendation model to generate an interest representation sequence of the target user. This interest representation sequence enables the model to distinguish the degree of user interest reflected by different interaction behaviors, providing a more accurate user representation for subsequent generation. The device then acquires the target recommendation strategy and inputs the interest representation sequence and the target recommendation strategy together into a multi-task decoder to generate content information to be recommended. The multi-task decoder is trained from multiple candidate recommendation strategies, with the target recommendation strategy being one of them. This allows a single decoder to have the ability to generate multiple recommendation strategies. Switching the input target recommendation strategy at the input end allows the same decoder to execute different recommendation logics, eliminating the need to train and deploy independent recommendation models for each strategy. This solves the problems of high resource consumption and low recommendation efficiency in multi-model solutions.

[0220] The above is an illustrative scheme of a content recommendation device according to this embodiment. It should be noted that the technical solution of this content recommendation device and the technical solution of the content recommendation method described above belong to the same concept. For details not described in detail in the technical solution of the content recommendation device, please refer to the description of the technical solution of the content recommendation method described above.

[0221] Corresponding to the above method embodiments, this specification also provides embodiments of a training device for a target recommendation model. Figure 5 A schematic diagram of a training apparatus for a target recommendation model according to one embodiment of this specification is shown. Figure 5 As shown, the device includes: The third acquisition module 502 is configured to acquire candidate recommendation models, which include a pre-trained encoder and a decoder to be trained. The construction module 504 is configured to construct a corresponding recommendation sample set for each candidate recommendation strategy. The recommendation sample set includes sample interaction content under the corresponding candidate recommendation strategy, the interaction type corresponding to the sample interaction content, and sample prediction content information. The first training module 506 is configured to perform multi-task training on the decoder to be trained based on the recommendation sample set corresponding to each candidate recommendation strategy, to obtain a multi-task decoder, and to use the encoder and the multi-task decoder as the target recommendation model after training to execute the content recommendation method of claims 1-10 above.

[0222] Optionally, the first training module is further configured to determine a first candidate recommendation strategy from candidate recommendation strategies that have never been trained; train the decoder to be trained based on the first recommendation sample set corresponding to the first candidate recommendation strategy to obtain an intermediate decoder; determine the intermediate decoder as the decoder to be trained, and repeat the operation of determining the first candidate recommendation strategy from candidate recommendation strategies that have never been trained until all candidate recommendation strategies have been trained to obtain a multi-task decoder.

[0223] Optionally, the first training module is further configured to: obtain an initial task vector, wherein the initial task vector is a vector obtained by random initialization; determine a sample interest representation sequence based on the sample interaction content and the corresponding interaction type in the first recommendation sample set; concatenate the sample interest representation sequence and the initial task vector, and obtain a sample task sequence through a pre-trained encoder; input the sample task sequence into the decoder to be trained to generate initial recommendation content information; adjust the decoder to be trained and the initial task vector based on the initial recommendation content information and the sample prediction content information, and repeatedly execute the operation of determining the sample interest representation sequence based on the sample interaction content and the corresponding interaction type until the preset training stopping condition is met, thereby obtaining the target task vector and intermediate decoder corresponding to the first candidate recommendation strategy.

[0224] Optionally, the third acquisition module is further configured to acquire a sample dataset, wherein the sample dataset includes initial sample interaction content, the interaction type corresponding to the initial sample interaction content, and initial sample prediction content; input the initial sample interaction content and the interaction type corresponding to the initial sample interaction content into the target recommendation model, and train the encoder and decoder of the target recommendation model with general interest representation based on the initial sample prediction content, and obtain a candidate recommendation model when a preset stopping condition is reached. The general interest representation training is used to learn the interest representation relationship between the multi-level types of content and the user's interaction behavior with the content.

[0225] The above is an illustrative scheme of a training device for a target recommendation model according to this embodiment. It should be noted that the technical solution of this content recommendation device and the technical solution of the content recommendation method described above belong to the same concept. Details not described in detail in the technical solution of the content recommendation device can be found in the description of the technical solution of the content recommendation method described above.

[0226] Figure 6 A structural block diagram of a computing device according to one embodiment of this specification is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.

[0227] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0228] In one embodiment of this specification, the above-described components of the computing device 600 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0229] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 600 can also be a mobile or stationary server.

[0230] The processor 620 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned content recommendation method and the training method of the target recommendation model.

[0231] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solutions of the content recommendation method and the target recommendation model training method described above. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the content recommendation method and the target recommendation model training method described above.

[0232] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described content recommendation method and the training method of the target recommendation model.

[0233] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the content recommendation method and the training method of the target recommendation model described above. Details not described in detail in the technical solution of the storage medium can be found in the descriptions of the technical solutions of the content recommendation method and the training method of the target recommendation model described above.

[0234] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described content recommendation method and the training method of the target recommendation model.

[0235] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program belongs to the same concept as the technical solutions of the content recommendation method and the target recommendation model training method described above. Details not described in detail in the computer program's technical solution can be found in the descriptions of the technical solutions of the content recommendation method and the target recommendation model training method described above.

[0236] 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.

[0237] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0238] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0239] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0240] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to specific implementations. Clearly, many modifications and variations can be made based on the embodiments described in this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A content recommendation method, characterized in that, include: Obtain the target user's historical interaction content and corresponding interaction types; The encoder of the target recommendation model encodes the historical interaction content and the corresponding interaction type to generate the interest representation sequence of the target user. The target recommendation model also includes a multi-task decoder. A target recommendation strategy is obtained, and the interest representation sequence and the target recommendation strategy are input into the multi-task decoder to generate content information to be recommended. The multi-task decoder is trained based on multiple candidate recommendation strategies, and the target recommendation strategy is at least one of the multiple candidate recommendation strategies. Based on the information of the content to be recommended, the target recommended content for the target user is determined.

2. The method according to claim 1, characterized in that, After obtaining the target user's historical interaction content and corresponding interaction types, the method further includes: Obtain the historical content type identifier corresponding to the historical interaction content, wherein the historical content type identifier is composed of multiple sub-type identifiers with a hierarchical relationship, and is used to characterize the content type of the historical interaction content; The step of encoding the historical interaction content and corresponding interaction types through the encoder of the target recommendation model to generate the interest representation sequence of the target user includes: The encoder of the target recommendation model encodes the historical interaction content type identifier and the interaction type corresponding to the historical interaction content to generate the target user's interest representation sequence.

3. The method according to claim 2, characterized in that, Before obtaining the historical content type identifier corresponding to the historical interaction content, the method further includes: Based on the content IDs of each content in the full content pool, an initial content vector is constructed for each content, wherein the content ID is used to uniquely represent the information of the corresponding content, and the full content pool contains the historical interaction content. Based on a pre-defined hierarchical clustering algorithm, hierarchical clustering is performed on each initial content vector to determine the multi-level content types of each content. Based on the aforementioned multi-level content types, determine the content type identifier for each content.

4. The method according to claim 2, characterized in that, The target recommendation model further includes a type identifier mapping layer and a feature fusion layer, wherein the feature fusion layer includes a fully connected network layer; before encoding the type identifier of the historical interaction content and the interaction type corresponding to the historical interaction content to generate the interest representation sequence of the target user, the model further includes: Based on the embedding matrix of the type identifier mapping layer, feature extraction is performed on the historical interaction content type identifier and the interaction type corresponding to the historical interaction content to obtain the content type vector corresponding to the historical interaction content and the behavior vector corresponding to the interaction type. The content type vector of the first historical interaction content and the behavior vector of the interaction behavior corresponding to the first historical interaction content are concatenated to obtain the initial behavior representation vector of the first historical interaction content, wherein the first historical interaction content is any historical interaction content; Based on the fully connected network layer of the feature fusion layer, feature extraction is performed on the initial behavior representation vector to obtain the target behavior representation vector corresponding to the first historical interaction content; The step of encoding the historical interaction content type identifier and the corresponding interaction type through the encoder of the target recommendation model to generate the target user's interest representation sequence includes: The encoder of the target recommendation model encodes the target behavior representation vector to generate the interest representation sequence of the target user.

5. The method according to claim 1, characterized in that, The step of encoding the historical interaction content and corresponding interaction types through the encoder of the target recommendation model to generate the interest representation sequence of the target user includes: Obtain the target behavior representation vector corresponding to each historical interaction content, wherein the target behavior representation vector is used to characterize the content types of multiple levels of the historical interaction content and the behavior types corresponding to the historical interaction content; Construct a sequence of behavior representations based on the behavior representation vectors of each target; The behavior representation sequence is input into the encoder, and for each target behavior representation vector in the behavior representation sequence, the information of the other target behavior representation vectors in the behavior representation sequence is fused to obtain the interest representation vector; Based on each of the interest representation vectors, the interest representation sequence of the target user is obtained.

6. The method according to claim 1, characterized in that, The step of inputting the interest representation sequence and the target recommendation strategy into the multi-task decoder to generate content information to be recommended includes: Obtain the target task vector corresponding to the target recommendation strategy, and concatenate the target task vector with the interest representation sequence to obtain the target task sequence; The target task sequence is input into the multi-task decoder to generate the content information to be recommended.

7. The method according to claim 6, characterized in that, The step of inputting the target task sequence into the multi-task decoder to generate the content information to be recommended includes: Based on the multi-task decoder, the target task sequence is decoded, and the probability distribution of the sub-content types of the content to be recommended is generated layer by layer. Based on the probability distribution of each level, a preset threshold sub-content type identifier is determined from each level using a preset search algorithm. Based on the sub-content type identifiers, a target content type identifier is constructed, wherein the target content type identifier is used to characterize the content type of the content to be recommended.

8. The method according to claim 1, characterized in that, The content to be recommended is a target content type identifier, which consists of multiple sub-content type identifiers with a hierarchical relationship, used to characterize the type of the content to be recommended. Determining the target recommended content for the target user based on the content to be recommended includes: Based on the target content type identifier, candidate recommended content is searched from the full content pool; Based on a preset arrangement order, target recommended content for the target user is obtained by filtering from the candidate recommended content. The preset arrangement order is determined based on the behavioral similarity between historical users of the first candidate recommended content. The historical users are users who have interacted with the first candidate recommended content, and the first candidate recommended content is any one of the candidate recommended content.

9. The method according to claim 8, characterized in that, Before the step of filtering the candidate recommended content from the candidate recommended content based on a preset arrangement order to obtain the target recommended content for the target user, the method further includes: Determine the initial set of users who will interact with the candidate recommended content; Based on each user in the initial user set, an initial user pair is constructed, wherein the initial user pair includes a combination of any two users in the initial user set; Based on the behavioral similarity of users in the first initial user pair, the association weight of the first initial user pair is determined, wherein the behavioral similarity of users is determined based on the amount of content that each user has interacted with in common, the first initial user pair is any one of the initial user pairs, and the association weight is negatively correlated with the amount of content that has been interacted with in common; The target user pairs consisting of the set of users who have interacted with the first candidate recommended content are identified, and the association weights corresponding to each target user pair are obtained. The target weight of the first candidate recommended content is determined based on each association weight. Based on the weights of each objective, the preset arrangement order of the candidate recommended content is determined.

10. A training method for a target recommendation model, characterized in that, include: Obtain candidate recommendation models, which include a pre-trained encoder and a decoder to be trained; For each candidate recommendation strategy, a corresponding recommendation sample set is constructed, wherein the recommendation sample set includes sample interaction content under the corresponding candidate recommendation strategy, the interaction type corresponding to the sample interaction content, and sample prediction content information; Based on the recommendation sample set corresponding to each candidate recommendation strategy, the decoder to be trained is trained using a multi-task method to obtain a multi-task decoder. The encoder and the multi-task decoder are used as the trained target recommendation model to execute the content recommendation method described in claims 1-9.

11. The method according to claim 10, characterized in that, The process of training the decoder to be trained using a multi-task method based on the recommendation sample set corresponding to each candidate recommendation strategy to obtain a multi-task decoder includes: The first candidate recommendation strategy is determined from the candidate recommendation strategies that have never been trained; Based on the first recommendation sample set corresponding to the first candidate recommendation strategy, the decoder to be trained is trained to obtain an intermediate decoder; The intermediate decoder is determined as the decoder to be trained, and the operation of determining the first candidate recommendation strategy from the candidate recommendation strategies that have never been trained is repeated until all candidate recommendation strategies have been trained, thereby obtaining the multi-task decoder.

12. The method according to claim 11, characterized in that, The step of training the decoder to be trained based on the candidate recommendation dataset corresponding to the first candidate recommendation strategy to obtain an intermediate decoder includes: Obtain an initial task vector, wherein the initial task vector is a vector obtained through random initialization; Based on the sample interaction content in the first recommended sample set and the interaction type corresponding to the sample interaction content, a sample interest representation sequence is determined. The sample task sequence is obtained by concatenating the sample interest representation sequence and the initial task vector and passing it through the pre-trained encoder. The sample task sequence is input into the decoder to be trained to generate initial recommendation content information; Based on the initial recommendation content information and the sample prediction content information, the decoder to be trained and the initial task vector are adjusted, and the operation of determining the sample interest representation sequence based on the sample interaction content and the interaction type corresponding to the sample interaction content is repeatedly executed until the preset training stopping condition is met, so as to obtain the target task vector corresponding to the first candidate recommendation strategy and the intermediate decoder.

13. The method according to claim 10, characterized in that, The process of obtaining candidate recommendation models includes: Obtain a sample dataset, wherein the sample dataset includes initial sample interaction content, the interaction type corresponding to the initial sample interaction content, and initial sample prediction content; The initial sample interaction content and the corresponding interaction type are input into the target recommendation model. Based on the initial sample prediction content, the encoder and decoder of the target recommendation model are trained with a general interest representation. When a preset stopping condition is reached, the candidate recommendation model is obtained. The general interest representation training is used to learn the interest representation relationship between the multi-level types of content and the user's interaction behavior with the content.

14. A content recommendation device, characterized in that, include: The first acquisition module is configured to acquire the target user's historical interaction content and the corresponding interaction type; The encoding module is configured to encode the historical interaction content and the corresponding interaction type through the encoder of the target recommendation model to generate the interest representation sequence of the target user. The target recommendation model also includes a multi-task decoder. The decoding module is configured to acquire the target recommendation strategy, input the interest representation sequence and the target recommendation strategy into the multi-task decoder, and generate content information to be recommended. The multi-task decoder is trained based on multiple candidate recommendation strategies, and the target recommendation strategy is at least one of the multiple candidate recommendation strategies. The determination module is configured to determine the target recommended content for the target user based on the information of the content to be recommended.

15. A training device for a target recommendation model, characterized in that, include: The third acquisition module is configured to acquire candidate recommendation models, which include a pre-trained encoder and a decoder to be trained. The construction module is configured to construct a corresponding recommendation sample set for each candidate recommendation strategy. The recommendation sample set includes sample interaction content under the corresponding candidate recommendation strategy, the interaction type corresponding to the sample interaction content, and sample prediction content information. The first training module is configured to perform multi-task training on the decoder to be trained based on the recommendation sample set corresponding to each candidate recommendation strategy, to obtain a multi-task decoder, and to use the encoder and the multi-task decoder as the target recommendation model after training to execute the content recommendation method described in claims 1-10.

16. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the content recommendation method according to any one of claims 1-10 and the training method of the target recommendation model according to any one of claims 11-13.

17. A computer-readable storage medium, characterized in that, It stores computer-executable instructions, which, when executed by a processor, implement the steps of the content recommendation method according to any one of claims 1-10 and the training method of the target recommendation model according to any one of claims 11-13.

18. A computer program product, characterized in that, It includes a computer program / instruction that, when executed by a processor, implements the steps of the content recommendation method according to any one of claims 1-10 and the training method of the target recommendation model according to any one of claims 11-13.