Recommendation method and device based on sorting target, computer equipment and storage medium

By using the optimization objectives and graph Transformer architecture based on AUC indicators in the recommended model, the problem of the incompatibility of the existing recommended model optimization objectives and the recommended scenario objectives are solved, and the sorting effect of the recommended model is improved.

CN119537677AActive Publication Date: 2025-02-28HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY +1

Patent Information

Application Number
CN202411348299.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-02-28
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

The existing recommendation model optimization goals based on graph neural networks are not suitable for the goals of the recommended scenarios, resulting in poor results in the recommended model.

Method used

By obtaining the historical interaction data between users and items, the optimization goal of the initial recommendation model is constructed based on the AUC indicators in the recommendation scenario, the user and item representation is encoded using the graph Transformer architecture and the Rankformer layer to train the item recommendation model.

Benefits of technology

This makes the optimization goals of the recommended model more uniform and adaptable to the sorting goals of the recommended scenarios, thereby improving the sorting effect of the recommended model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537677A_ABST
    Figure CN119537677A_ABST
Patent Text Reader

Abstract

The invention relates to a recommendation method and device based on a sorting target, computer equipment and a storage medium, and the method comprises the steps: obtaining a training sample; the training sample comprises historical interaction data of a plurality of sample users and corresponding articles; based on the AUC indexes in the recommendation scene, constructing an optimization target of the initial recommendation model; based on the optimization target, the training sample and a preset loss function, training the initial recommendation model to obtain an article recommendation model; and according to the user characterization and the article characterization output by the article recommendation model, predicting the interest score of the user and the recommended article, so as to obtain a recommendation sorting result of the recommended article according to the interest score. Through the method and the device, the optimization target of the initial recommendation model can be constructed based on the AUC index in the recommendation scene, so that the optimization target and the sorting target in the recommendation scene are more uniform and adaptive, and the sorting effect of the recommendation model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a recommendation method, apparatus, computer device and storage medium based on a sorting target. Background Art

[0002] With the development of Internet technology, more and more users conduct various activities through online platforms such as e-commerce, streaming media, and social networks. The recommendation system aims to provide personalized recommendations to users and plays a core role in online platforms.

[0003] The existing recommendation model based on graph neural network models users and items as nodes in the graph and models interactions as edges. The graph structure can fully utilize the collaborative information in the recommendation system. However, the optimization goal of the current graph neural network is essentially to make the features between nodes connected by edges as smooth as possible, that is, to make adjacent nodes have similar representations, while the ultimate goal of the recommendation scenario is to provide a sorted sequence of items. The optimization goals of the existing recommendation model and the goals of the recommendation scenario are not compatible, resulting in poor results of the recommendation model.

[0004] There is currently no effective solution to the problem that the optimization objectives of existing recommendation models and the objectives of recommendation scenarios are incompatible in related technologies. Summary of the invention

[0005] Based on this, it is necessary to provide a recommendation method, device, computer equipment and storage medium based on sorting objectives that can adapt to recommendation scenarios in response to the above technical problems.

[0006] In a first aspect, a recommendation method based on a ranking target is provided in this embodiment, including:

[0007] Acquire training samples; the training samples include historical interaction data between multiple sample users and corresponding items;

[0008] Based on the AUC indicator in the recommendation scenario, the optimization target of the initial recommendation model is constructed;

[0009] Based on the optimization objective, the training samples and the preset loss function, the initial recommendation model is trained to obtain an item recommendation model;

[0010] According to the user representation and the item representation output by the item recommendation model, the interest scores of the user and the recommended item are predicted, so as to obtain the recommendation ranking results of the recommended items according to the interest scores.

[0011] In some of the embodiments, the optimization goal of constructing the initial recommendation model based on the AUC indicator in the recommendation scenario includes:

[0012] Based on the graph Transformer architecture, construct the initial recommendation model;

[0013] In the initial recommendation model, maximizing the AUC index is the optimization goal.

[0014] In some embodiments, the optimization goal is:

[0015] argmax z E(Z;δ)

[0016]

[0017] Among them, u represents the user, Represents a user set; a triple set Each element (u,i,j) in indicates that user u has interacted with item i but not item j. Represents the set of items that interact with user u; and They represent the predicted interest scores of user u and item i and item j respectively; δ(·) represents the activation function; Z is the representation, which includes user representation and item representation; express expectations; is the regularization term, and λ is the regularization coefficient.

[0018] In some embodiments, the training of the initial recommendation model to obtain the item recommendation model based on the optimization target, the training sample and the preset loss function includes:

[0019] In the iterative Rankformer layer in the initial recommendation model, the user initial representation and the item initial representation are encoded with the optimization objective to obtain the predicted representation output by the initial recommendation model;

[0020] Determining a predicted interest score of the initial recommendation model according to the predicted representation;

[0021] Based on the preset loss function, the recommendation loss between the predicted interest score and the real interest score in the training sample is calculated to obtain the item recommendation model through training according to the recommendation loss.

[0022] In some of these embodiments, the calculation of each of the Rankformer layers is as follows:

[0023]

[0024] Among them, Z (l) and Z (l-1)Represents the prediction representation of each layer output by the current layer l and the previous layer (l-1) respectively; τ represents the temperature coefficient of the Rankformer layer; Represents the target weight of the current layer l, which is composed of weight and After normalization calculation, we get:

[0025]

[0026] Among them, u represents the user, Represents a user set; for each user The set of items that have been observed to interact with user u is d u Represents a collection of items The size of m represents the set of items. size; for each item The set of users who have been observed to interact with item i is and represents the attention weight; and They represent the weight of user u to item i, and the weight of item i to user u respectively; j represents the item that user u has not interacted with.

[0027] In some of the embodiments, it also includes:

[0028] In the calculation of each Rankformer layer, the user representation and the item representation are linearly expanded and calculated.

[0029] In some embodiments, predicting the interest scores of the user and the recommended items according to the user representation and the item representation output by the item recommendation model, so as to obtain the recommendation ranking results of the recommended items according to the interest scores, includes:

[0030] Based on the item recommendation model, a predicted user representation and item representation are obtained;

[0031] Determining the interest score according to the user representation and the item representation;

[0032] The recommended items are sorted according to the interest scores to obtain the recommendation sorting result.

[0033] In a second aspect, a recommendation device based on a ranking target is provided in this embodiment, including:

[0034] A sample acquisition module, used to acquire training samples; the training samples include historical interaction data between multiple sample users and corresponding items;

[0035] The model building module is used to build the optimization target of the initial recommendation model based on the AUC indicator in the recommendation scenario;

[0036] A model training module, used to train the initial recommendation model to obtain an item recommendation model based on the optimization target, the training samples and a preset loss function;

[0037] The item recommendation module is used to predict the interest scores of the user and the recommended items according to the user representation and the item representation output by the item recommendation model, so as to obtain the recommendation ranking results of the recommended items according to the interest scores.

[0038] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the recommendation method based on the sorting target described in the first aspect is implemented.

[0039] In a fourth aspect, in this embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the recommendation method based on the ranking target described in the first aspect is implemented.

[0040] Compared with the related art, the recommendation method, apparatus, computer device and storage medium based on the ranking target provided in this embodiment obtain training samples; the training samples include historical interaction data between multiple sample users and corresponding items;

[0041] Based on the AUC indicator in the recommendation scenario, an optimization target of the initial recommendation model is constructed; based on the optimization target, the training samples and the preset loss function, the initial recommendation model is trained to obtain an item recommendation model; based on the user representation and item representation output by the item recommendation model, the interest scores of the user and the recommended item are predicted to obtain the recommendation ranking results of the recommended item according to the interest scores. Through this embodiment, the optimization target of the initial recommendation model can be constructed based on the AUC indicator in the recommendation scenario, so that the optimization target and the ranking target in the recommendation scenario are more unified and adapted, thereby improving the ranking effect of the recommendation model.

[0042] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0044] Figure 1 is a hardware structure block diagram of a terminal of a recommendation method based on a ranking target in an embodiment;

[0045] Figure 2 is a flowchart of a recommendation method based on a ranking target in an embodiment;

[0046] Figure 3 is a schematic diagram of a Rankformer layer encoding process in one embodiment;

[0047] Figure 4 is a flowchart of a recommendation method based on a ranking target in an embodiment;

[0048] Figure 5 The structure block diagram of a recommendation device based on a ranking target in an embodiment.

[0049] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, sample acquisition module; 20, model building module; 30, model training module; 40, item recommendation module. DETAILED DESCRIPTION

[0050] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0051] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0052] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 4 is a hardware structure diagram of a terminal of the recommendation method based on the sorting target of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0053] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the recommendation method based on the sorting target in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0054] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0055] With the development of Internet technology, more and more users conduct various activities through online platforms such as e-commerce, streaming media, and social networks. The recommendation system aims to provide personalized recommendations to users and plays a core role in online platforms.

[0056] The existing recommendation model based on graph neural network models users and items as nodes in the graph and models interactions as edges. The graph structure can fully utilize the collaborative information in the recommendation system. However, graph neural network has some defects:

[0057] (1) The multi-layer message passing mechanism of graph neural networks can easily lead to the problem of over-smoothing. The representations of nodes can easily become similar or indistinguishable.

[0058] (2) The optimization goal of graph neural networks is essentially to make the features between nodes connected by edges as smooth as possible, that is, to encourage adjacent nodes to have similar representations. This optimization goal is highly aligned with tasks such as node classification, but it is not consistent with the goals of recommendation scenarios. However, the optimization goal of current graph neural networks is essentially to make the features between nodes connected by edges as smooth as possible, that is, to encourage adjacent nodes to have similar representations. This optimization goal is highly aligned with tasks such as node classification, but it is not consistent with the goals of recommendation scenarios.

[0059] The ultimate goal of the recommendation scenario is to provide users with a sorted sequence of items. The optimization goals of existing recommendation models are not compatible with the goals of recommendation scenarios. Graph neural networks only optimize the similarity of neighbors, which may not necessarily improve the sorting effect. It will also reduce the gap between the interest scores of different items, causing the so-called over-smoothing problem, resulting in poor performance of the recommendation model.

[0060] In this embodiment, a method is provided. Figure 2 is a flow chart of the recommendation method based on the sorting target in this embodiment, such as Figure 2 As shown, the method comprises the following steps:

[0061] Step S210, obtaining training samples; the training samples include historical interaction data between multiple sample users and corresponding items.

[0062] Specifically, in this embodiment, historical interaction data between sample users and recommended items in the item recommendation scenario is obtained as training samples. Sample users can be users of Internet application platforms. For example, if the application platform is an e-commerce shopping platform, sample users can be users who use the e-commerce shopping platform to shop, and the recommended items are commodities; for example, if the application platform is a social platform, sample users can be users of the social platform, and the recommended items are content posted on the social platform.

[0063] Historical interaction data can be the usage data of sample users on the application platform, in the form of data pairs of users and recommended items, indicating that users have interacted with recommended items. For example, historical interaction data between sample users and recommended items on e-commerce shopping platforms, including but not limited to clicks, browsing, favorites, orders, consultations, etc.; for example, historical interaction data between sample users and recommended items on social platforms, including but not limited to clicks, browsing, favorites, comments, etc. In addition, training samples can also include basic information such as age and gender of sample users, as well as attributes, tags, and other information of recommended items.

[0064] Use the historical interaction data collected in a real production environment to obtain training samples for collaborative filtering. Specifically, let the user set be The size is n; the item set is The size is m. For each user The set of items that have been observed to interact with user u is The size is d u ; For each item The set of users who have been observed to interact with item i is

[0065] Step S220, constructing an optimization target of the initial recommendation model based on the AUC indicator in the recommendation scenario.

[0066] Specifically, the AUC (Area under curve) indicator in the recommended scenario refers to the area under the ROC (Receiver Operating Characteristic Curve) curve. AUC evaluates model performance by calculating the area under the ROC curve. The horizontal axis of the ROC curve is the false positive rate (False Positive Rate, FPR), which indicates the proportion of samples that are incorrectly predicted as positive examples among all samples that are actually negative examples; the vertical axis is the true positive rate (True Positive Rate, TPR), which indicates the proportion of samples that are correctly predicted as positive examples among all samples that are actually positive examples. The AUC value is between 0 and 1. The larger the AUC value, the better the classification performance of the model.

[0067] The optimization goal of the initial recommendation model is constructed based on the AUC indicator, that is, the AUC indicator is derived to maximize the AUC area as the optimization goal. Among them, the initial recommendation model is pre-constructed, and the initial recommendation model can be based on the recommendation model of the graph neural network, etc. Furthermore, due to the multi-layer message passing mechanism of the graph neural network, it is easy to cause the problem of over-smoothing, making the representation of nodes easy to become similar or indistinguishable. In this embodiment, a graph Transformer architecture can also be used, which can alleviate the overfitting problem of traditional graph neural networks to a certain extent.

[0068] Step S230: Based on the optimization objective, training samples and a preset loss function, the initial recommendation model is trained to obtain an item recommendation model.

[0069] Specifically, the initial recommendation model using the graph Transformer architecture has multiple Rankformer layers, Rankformer is the abbreviation of the recommendation method based on the ranking objective proposed in this embodiment, and the network structure is called the Rankformer layer. According to the optimization goal, the initial representation is encoded in each Rankformer layer of the iteration, and finally the prediction representation of the initial recommendation model is obtained. Among them, the initial representation includes the user initial representation and the item initial representation; the prediction representation includes the user prediction representation and the item prediction representation.

[0070] According to the user prediction representation and the item prediction representation, the user's predicted interest score for each item can be obtained. Based on the preset loss function and training samples, the recommendation loss of each predicted interest score is calculated, and the initial recommendation model is trained until the preset loss function converges or the maximum number of training rounds is reached to obtain the item recommendation model. Among them, the preset loss function includes but is not limited to the BPR (Bayesian Personalized Ranking Loss Operator) loss function, the Softmax loss function (SL-Loss), etc.

[0071] Optionally, during the training process of the item recommendation model, the Adam optimizer is used to update the model parameters to adaptively learn the learning rate of each model parameter and accelerate the optimization process, which includes setting the temperature coefficient hyperparameters of the Adam optimizer, such as the learning rate and the L2 regularization coefficient (weight decay).

[0072] Step S240 , predicting the interest scores of the user and the recommended items based on the user representation and the item representation output by the item recommendation model, so as to obtain a recommendation ranking result of the recommended items based on the interest scores.

[0073] Specifically, the trained item recommendation model is used to output predicted user representations and item representations to achieve personalized item recommendations for users. For each user, the final interest scores of the user and the recommended items are predicted, and the recommended items are sorted according to the final interest scores to obtain the recommendation sorting results.

[0074] Through the above steps, based on the AUC indicator in the recommendation scenario, the optimization target of the initial recommendation model can be derived and constructed, and finally the item recommendation model can be trained to make the item recommendation model more adapted to the recommendation scenario and the target more unified, thereby improving the ranking effect of the recommendation model.

[0075] In some embodiments, in step S210, constructing an optimization target of the initial recommendation model based on the AUC indicator in the recommendation scenario includes the following steps:

[0076] Based on the graph Transformer architecture, an initial recommendation model is constructed. In the initial recommendation model, maximizing the AUC indicator is used as the optimization goal.

[0077] Specifically, a graph Transformer architecture with a full-graph attention mechanism is used to construct an initial recommendation model, which includes designing a Rankformer layer and a preset loss function. Optionally, the preset loss function can be a BPR loss function, which is specifically calculated as follows:

[0078]

[0079] in, and denotes the interest scores of user u for item i and item j respectively; j is a randomly sampled item that user u has not interacted with; σ(·) is the activation function. For example, the specific calculation is as follows:

[0080]

[0081] in, represents the user representation output by the last Rankformer layer L; represents the item representation output by the last Rankformer layer L. Similarly, we can get the interest score of user u for item j

[0082] The Graph Transformer architecture is a deep learning architecture that combines the advantages of the Graph Neural Network (GNN) and the Transformer model. In the recommendation scenario, it can be used to capture the complex relationship between users and items and generate personalized recommendation lists, which can alleviate the overfitting problem of traditional graph neural networks to a certain extent. The full-graph attention mechanism is an extension of the self-attention mechanism in the Transformer model on graph-structured data. In traditional Transformers, the self-attention mechanism mainly processes sequence data and captures the dependencies between elements by calculating the attention scores between each element in the sequence and other elements. In the Graph Transformer, the full-graph attention mechanism allows the model to compare and interact with each node in the graph with all other nodes when processing graph-structured data, thereby capturing the global information of the graph.

[0083] In the initial recommendation model, each encoding through a Rankformer layer is equivalent to a gradient ascent of the AUC target in the recommendation scenario ranking task. Therefore, in the recommendation scenario, the optimization target is constructed by maximizing the AUC indicator (area).

[0084] In some of the embodiments, the optimization goal is:

[0085] argmax z E(Z;δ)

[0086]

[0087] Among them, u represents the user, Represents a user set; a triple set Each element (u,i,j) in indicates that user u has interacted with item i but not item j. Represents the set of items that interact with user u; and denote the predicted interest scores of user u and item i and item j respectively; δ(·) denotes the activation function; Z is the representation, which includes user representation and item representation; express expectations; is the regularization term, and λ is the regularization coefficient.

[0088] Specifically, E(Z; δ) is the content to be maximized in the optimization objective. The optimization objective indicates that among the interacted items i and the uninteracted items j, user u prefers item i. Therefore, in the optimization objective, It represents maximizing the interest score of item i relative to item j for user u, where δ(·) is a monotonically non-decreasing activation function.

[0089] Further transform the above formula to get the following formula:

[0090]

[0091] Among them, u represents the user, Represents a user set; for each user The set of items that have been observed to interact with user u is d u Represents a collection of interactive items The size of m represents the set of items. The size of z u represents user representation; z i and z j Represents an item.

[0092] Further approximating the activation function with a second-order Taylor expansion, the optimization of the above formula is equivalent to optimizing the following:

[0093]

[0094] Among them, the attention weight α is an adjustable parameter.

[0095] Optimize and maximize the AUC index by gradient ascent. Calculate the gradient of the above formula:

[0096]

[0097] Among them, the target weight Ω is composed of the weight and After normalization calculation, we get:

[0098]

[0099] in, and Respectively represent the weight of user u to item i, and the weight of item i to user u; and represents the attention weight.

[0100] Each Rankformer layer performs a gradient ascent on the above formula with a step size ∈ to simulate the maximum AUC, that is:

[0101] Z (l) =(1-∈τ)Z (l-1) +∈Ω (l) Z (l-1)

[0102] Among them, Z (l) and Z (l-1) They represent the prediction representation of each layer output by the current layer l and the previous layer (l-1) respectively; τ represents the temperature coefficient of the Rankformer layer.

[0103] Finally, in order to maintain numerical stability, normalization is introduced and hyperparameters are combined to simplify the above formula to obtain the following formula:

[0104]

[0105] in ||·||1 denotes the L1 norm.

[0106] By using the graph Transformer architecture to build the initial recommendation model in this embodiment, problems such as over-smoothing in traditional graph neural network recommendation methods can be avoided. In addition, an optimization target is constructed based on the AUC indicator in the recommendation scenario, and the encoding process of each Rankformer layer in the initial recommendation model is derived, so that the optimization target can be encoded at each layer in the subsequent steps, making the optimization target of the model more suitable for the recommendation scenario.

[0107] In some embodiments, in step S230, based on the optimization objective, the training samples and the preset loss function, the initial recommendation model is trained to obtain the item recommendation model, including the following steps:

[0108] Step S231, in the iterative Rankformer layer in the initial recommendation model, the user initial representation and the item initial representation are encoded with the optimization goal to obtain the predicted representation output by the initial recommendation model.

[0109] Specifically, a d-dimensional vector is randomly generated for each user and item as the initial representation Z (0) :

[0110]

[0111] in, represents the initial representation of user u; Represents the initial representation of item i.

[0112] According to the derivation in the above embodiment, the calculation of each Rankformer layer is as follows:

[0113]

[0114] Among them, Z (l) and Z (l-1) Represents the prediction representation of each layer output by the current layer l and the previous layer (l-1) respectively; τ represents the temperature coefficient of the Rankformer layer; Represents the target weight of the current layer l, which is composed of weight and After normalization calculation, we get:

[0115]

[0116] Among them, u represents the user, Represents a user set; for each user The set of items that have been observed to interact with user u is d u Represents a collection of items The size of m represents the set of items. size; for each item The set of users who have been observed to interact with item i is and represents the attention weight; and Respectively represent the weight of user u to item i, and item i to user u; j represents the item that user u has not interacted with; attention weight The calculation is as follows:

[0117]

[0118] Among them, α is an adjustable parameter; ||·||2 represents the L2 norm. Similarly, the attention weight can be obtained The calculation method of .

[0119] Finally, we get the prediction representation Z of the initial recommendation model output (L) :

[0120]

[0121] Among them, Z (L)is the predicted representation of the output of the last Rankformer layer; The user u representation output by the model represents the user preference predicted by the model; The representation of item i, which represents the output of the model, represents the characteristics of the item predicted by the model.

[0122] Figure 3 is a schematic diagram of the Rankformer layer encoding process in this embodiment, such as Figure 3 As shown, taking the current layer l as an example, Z (0) is the initial representation of the first Rankformer layer, Z (L) is the predicted representation output by the last Rankformer layer. In each Rankformer layer, the predicted representation Z of the output of the previous layer (l-1) is (l-1) After normalization, further Calculating attention weights Calculate the target weight Ω of the Rankformer layer based on the attention weight (l) , and normalized to get Finally, according to the normalized target weight and the predicted representation Z output by the previous layer (l-1) (l-1) , merge to get the prediction representation Z of the current layer l (l) , and finally get the prediction representation Z output by the last Rankformer layer (L) .

[0123] Step S232: Determine the predicted interest score of the initial recommendation model based on the predicted representation.

[0124] Specifically, according to the above prediction representation, the predicted interest score is determined according to the user representation and the item representation therein.

[0125]

[0126] Among them, the predicted interest score Indicates the interest of user u in item i.

[0127] Step S233, based on a preset loss function, calculate the recommendation loss between the predicted interest score and the actual interest score in the training sample, so as to obtain an item recommendation model through training according to the recommendation loss.

[0128] Specifically, the BPR loss function is selected as the preset loss function, and the recommendation loss between the predicted interest score obtained each time and the true score in the historical interaction data in the training sample is calculated. The initial recommendation model is trained until the preset loss function converges or the maximum number of training rounds is reached to obtain the item recommendation model.

[0129] Optionally, during the training process of the item recommendation model, the Adam optimizer is used to update the model parameters to adaptively learn the learning rate of each model parameter and accelerate the optimization process, which includes setting the temperature coefficient hyperparameters of the Adam optimizer, such as the learning rate and the L2 regularization coefficient (weight decay).

[0130] In this embodiment, the Rankformer layer in the initial recommendation model is used to perform encoding calculations with an optimization goal, and model training is performed based on a preset loss function and the predicted interest score of the initial recommendation model, so that an item recommendation model adapted to the recommendation scenario can be obtained.

[0131] In some of the embodiments, the method further includes: in the calculation of each Rankformer layer, performing linear expansion calculation on the user representation and the item representation.

[0132] Specifically, the above user representation and object representation Perform linear expansion, and the specific calculation is as follows:

[0133]

[0134] Among them, C is the normalization coefficient:

[0135]

[0136]

[0137] Among them, Ω + and Ω - Can be written as:

[0138]

[0139] in, The superscripts “+” and “-” indicate positive and negative directions, respectively.

[0140] After linear expansion, the above formula can be expressed as O(Nd 2 +Ed) complexity calculation. Where N represents the total number of users and items, that is, N = n + m; E is the number of sample pairs that have interacted, that is

[0141] By linearly expanding the user representation and the item representation in this embodiment, the computational efficiency can be improved and the complexity can be reduced in each layer of Rankformer encoding calculation, thereby avoiding the efficiency disadvantage of the general graph Transformer method.

[0142] In some embodiments, the above step S240 predicts the interest scores of the user and the recommended item according to the user representation and the item representation output by the item recommendation model, so as to obtain the recommendation ranking result of the recommended item according to the interest score, including the following steps:

[0143] Step S241: obtaining predicted user representation and item representation based on the item recommendation model.

[0144] Step S242: determining an interest score based on the user representation and the item representation.

[0145] Step S243, sorting the recommended items according to the interest scores to obtain a recommendation sorting result.

[0146] Specifically, when a user logs in or accesses the application platform, the application platform responds to the user's access request, predicts the user representation and the item representation of the recommended items on the application platform based on the item recommendation model, and calculates the interest score between the user representation and all item representations. The interest score can reflect the user's interest in each recommended item.

[0147] Sort the recommended items from high to low according to the interest score, return the recommended ranking results from all the recommended items, and display them to the user on the page of the application platform. Optionally, select a certain number of items from all the recommended items as the recommended ranking results to display to the user, and make personalized item recommendations for the user. For example, if the application platform is an e-commerce shopping platform, the recommended items are commodities, and the recommended ranking results finally displayed to the user are commodities with a high degree of interest to the user; for example, if the application platform is a social platform, the recommended items are the content posted on the social platform, and the recommended ranking results finally displayed to the user are media content, tweets, etc. with a high degree of interest to the user.

[0148] By applying the above-mentioned item recommendation model to the personalized recommendation scenario in this embodiment, the accuracy and effect of personalized recommendation can be improved, more content of interest to users can be provided, and the user experience can be improved.

[0149] The present embodiment is described and illustrated below through preferred embodiments.

[0150] Figure 4 is a flow chart of the recommendation method based on the sorting target in this embodiment, such as Figure 4 As shown, the method comprises the following steps:

[0151] Step S410, obtaining training samples; the training samples include historical interaction data between multiple sample users and corresponding items.

[0152] The historical interaction data collected in a real production environment is used to obtain training samples for collaborative filtering. Specifically, let the user set be The size is n; the item set is The size is m. For each user The set of items that have been observed to interact with user u is The size is d u ; For each item The set of users who have been observed to interact with item i is

[0153] Step S420: randomly generate a d-dimensional vector for each user and item as an initial representation.

[0154] in,

[0155]

[0156] ; represents the initial representation of user u; Represents the initial representation of item i.

[0157] Step S430, in the iterative Rankformer layer in the initial recommendation model, the user initial representation and the item initial representation are encoded with the optimization goal to obtain the predicted representation output by the initial recommendation model.

[0158] Among them, the initial recommendation model is built based on the graph Transformer architecture, with maximizing the AUC area as the optimization goal. The calculation of each Rankformer layer is as follows:

[0159]

[0160] Among them, Z (l) and Z (l-1) Represents the prediction representation of each layer output by the current layer l and the previous layer (l-1) respectively; τ represents the temperature coefficient of the Rankformer layer; Represents the target weight of the current layer l, which is composed of weight and After normalization calculation, we get:

[0161]

[0162] Among them, u represents the user, Represents a user set; for each user The set of items that have been observed to interact with user u is d u Represents a collection of items The size of m represents the set of items. size; for each item The set of users who have been observed to interact with item i is and represents the attention weight; and Respectively represent the weight of user u to item i, and item i to user u; j represents the item that user u has not interacted with; attention weight The calculation is as follows:

[0163]

[0164] Among them, α is an adjustable parameter; ||·||2 represents the L2 norm. Similarly, the attention weight can be obtained The calculation method of .

[0165] Finally, we get the prediction representation Z of the initial recommendation model output (L) :

[0166]

[0167] Among them, Z (L) is the predicted representation of the output of the last Rankformer layer; The user u representation output by the model represents the user preference predicted by the model; The representation of item i, which represents the output of the model, represents the characteristics of the item predicted by the model.

[0168] Step S440: According to the Bayesian personalized ranking loss function, the training samples and the prediction representation, the initial recommendation model is trained to obtain an item recommendation model.

[0169] Among them, the Bayesian personalized ranking loss function is specifically calculated as follows:

[0170]

[0171] in, and denote the interest scores of user u for item i and item j respectively; j is a randomly sampled item that user u has not interacted with; σ(·) is the activation function. Taking the interest score of user u for item i as an example, the specific calculation is as follows:

[0172]

[0173] in, represents the user representation output by the last Rankformer layer L; represents the item representation output by the last Rankformer layer L. Similarly, we can get the interest score of user u for item j

[0174] Step S450: In the calculation of each Rankformer layer, linear expansion calculation is performed on the user representation and the item representation.

[0175] Among them, the user is represented and object representation Perform linear expansion, and the specific calculation is as follows:

[0176]

[0177] Among them, the weight is normalized, and C is the normalization coefficient:

[0178]

[0179] Among them, Ω + and Ω - Can be written as:

[0180]

[0181] in,

[0182] Step S460, predicting the interest scores of the user and the recommended items according to the user representation and the item representation output by the item recommendation model, so as to obtain the recommendation ranking results of the recommended items according to the interest scores.

[0183] On multiple open source datasets (including shopping platform display advertisement click-through rate estimation datasets Ali_Display_Ad_Click, Amazon-kindle, and Amazon-cds), the recommendation method in this embodiment (Rankformer in Table 1) is tested relative to current graph recommendation models (including: LightGCN (lightweight graph convolutional neural network), XSimGCL (extremely simple graph contrast learning method), GFormer, MGFormer) and graph Transformer models (including: Nodeformer (a graph representation model architecture), DIFFormer (a diffusion process-inspired Transformer), SGFormer (a self-guided Transformer)), and the recommendation indicator performance improvement on ndcg@20 (normalized discounted cumulative gain) and recall@20 (recall rate) is shown in Table 1 below.

[0184] Table 1:

[0185]

[0186] It can be seen from Table 1 that the recommendation index performance of the recommendation method (Rankformer) in this embodiment on multiple data sets is greatly improved.

[0187] By deriving and approximating the AUC index of the recommendation scenario in this embodiment, a recommendation method based on ranking objectives (i.e., Rankformer) is proposed to achieve good recommendation performance. On the one hand, the ultimate goal of the recommendation scenario is to recommend a ranked sequence of items for each user. This embodiment is derived from the AUC index, which can make the item recommendation model highly aligned with the ranking task of the recommendation scenario, and solve the problems of over-smoothing in the traditional graph neural network recommendation method; on the other hand, linear expansion is performed in the model calculation, and through clever matrix operation design, the efficiency disadvantages of the general graph Transformer method are avoided, and a recommendation method of the graph Transformer with a full-graph attention mechanism is realized.

[0188] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0189] In this embodiment, a recommendation device based on a ranking target is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0190] Figure 5 is a structural block diagram of the recommendation device based on the ranking target of this embodiment, such as Figure 5 As shown, the device comprises:

[0191] The sample acquisition module 10 is used to acquire training samples; the training samples include historical interaction data between multiple sample users and corresponding items;

[0192] A model building module 20 is used to build an optimization target of an initial recommendation model based on the AUC indicator in the recommendation scenario;

[0193] A model training module 30 is used to train the initial recommendation model to obtain an item recommendation model based on the optimization target, training samples and a preset loss function;

[0194] The item recommendation module 40 is used to predict the interest scores of the user and the recommended items according to the user representation and the item representation output by the item recommendation model, so as to obtain the recommendation ranking results of the recommended items according to the interest scores.

[0195] Through the device provided in this embodiment, it is possible to derive the optimization target of constructing the initial recommendation model based on the AUC indicator in the recommendation scenario, and finally train the item recommendation model to make the item recommendation model more adapted to the recommendation scenario and the target more unified, thereby improving the sorting effect of the recommendation model.

[0196] In some of the embodiments, the model building module 20 is further configured to:

[0197] Based on the graph Transformer architecture, an initial recommendation model is constructed. In the initial recommendation model, maximizing the AUC indicator is used as the optimization goal.

[0198] In some of the embodiments, the optimization objective in the model building module 20 is:

[0199] argmax z E(Z;δ)

[0200]

[0201] Among them, u represents the user, Represents a user set; a triple set Each element (u,i,j) in indicates that user u has interacted with item i but not item j. Represents the set of items that interact with user u; and denote the predicted interest scores of user u and item i and item j respectively; δ(·) denotes the activation function; Z is the representation, which includes user representation and item representation; express expectations; is the regularization term, and λ is the regularization coefficient.

[0202] In some of the embodiments, the model training module 30 is further used to:

[0203] In the iterative Rankformer layer of the initial recommendation model, the initial representation of the user and the initial representation of the item are encoded with the optimization goal to obtain the predicted representation output by the initial recommendation model;

[0204] Determine a predicted interest score of an initial recommendation model based on the predicted representation;

[0205] Based on the preset loss function, the recommendation loss between the predicted interest score and the actual interest score in the training sample is calculated to obtain the item recommendation model based on the recommendation loss training.

[0206] In some of the embodiments, the calculation of each Rankformer layer in the model training module 30 is as follows:

[0207]

[0208] Among them, Z (l) and Z (l-1) Represents the prediction representation of each layer output by the current layer l and the previous layer (l-1) respectively; τ represents the temperature coefficient of the Rankformer layer; Represents the target weight of the current layer l, which is composed of weight and After normalization calculation, we get:

[0209]

[0210] Among them, u represents the user, Represents a user set; for each user The set of items that have been observed to interact with user u is d u Represents a collection of items The size of m represents the set of items. size; for each item The set of users who have been observed to interact with item i is and represents the attention weight; and They represent the weight of user u to item i, and the weight of item i to user u respectively; j represents the item that user u has not interacted with.

[0211] In some of the embodiments, the model training module 30 is further used to perform linear expansion calculations on user representations and item representations in the calculations of each Rankformer layer.

[0212] In some of the embodiments, the item recommendation module 40 is further configured to:

[0213] Based on the item recommendation model, the predicted user representation and item representation are obtained;

[0214] Determine an interest score based on the user representation and the item representation;

[0215] The recommended items are sorted according to the interest scores to obtain the recommended sorting results.

[0216] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0217] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0218] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0219] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0220] In addition, in combination with the recommendation method based on ranking target provided in the above embodiments, a storage medium may be provided in this embodiment to implement the recommendation method based on ranking target. The storage medium stores a computer program, and when the computer program is executed by a processor, any one of the recommendation methods based on ranking target in the above embodiments is implemented.

[0221] 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 this application are all information and data authorized by the user or fully authorized by all parties.

[0222] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0223] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0224] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0225] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A recommendation method based on ranking objectives, characterized in that: include: Get training samples; The training samples include historical interaction data between multiple sample users and corresponding items; Based on the AUC indicator in the recommendation scenario, the optimization target of the initial recommendation model is constructed; Based on the optimization objective, the training samples and the preset loss function, the initial recommendation model is trained to obtain an item recommendation model; According to the user representation and the item representation output by the item recommendation model, the interest scores of the user and the recommended item are predicted, so as to obtain the recommendation ranking results of the recommended items according to the interest scores.

2. The recommendation method based on ranking target according to claim 1, characterized in that: The optimization goal of constructing the initial recommendation model based on the AUC indicator in the recommendation scenario includes: Based on the graph Transformer architecture, construct the initial recommendation model; In the initial recommendation model, maximizing the AUC index is the optimization goal.

3. The recommendation method based on ranking target according to claim 2, characterized in that: The optimization goal is: argmax z E(Z;δ) Among them, u represents the user, Represents a user set; a triple set Each element (u,i,j) in indicates that user u has interacted with item i but not item j. Represents the set of items that interact with user u; and denote the predicted interest scores of user u and item i and item j respectively; δ(·) denotes the activation function; Z is the representation, which includes user representation and item representation; express expectations; is the regularization term, and λ is the regularization coefficient.

4. The recommendation method based on ranking target according to claim 1, characterized in that: The step of training the initial recommendation model based on the optimization objective, the training sample, and the preset loss function to obtain an item recommendation model includes: In the iterative Rankformer layer in the initial recommendation model, the user initial representation and the item initial representation are encoded with the optimization objective to obtain the predicted representation output by the initial recommendation model; Determining a predicted interest score of the initial recommendation model according to the predicted representation; Based on the preset loss function, the recommendation loss between the predicted interest score and the real interest score in the training sample is calculated to obtain the item recommendation model through training according to the recommendation loss.

5. The recommendation method based on ranking target according to claim 4, characterized in that: The calculation of each Rankformer layer is as follows: Among them, Z (l) and Z (l-1) Represents the prediction representation of each layer output by the current layer l and the previous layer (l-1) respectively; τ represents the temperature coefficient of the Rankformer layer; Represents the target weight of the current layer l, which is composed of weight and After normalization calculation, we get: Among them, u represents the user, Represents a user set; for each user The set of items that have been observed to interact with user u is d u Represents a collection of items The size of m represents the set of items. size; for each item The set of users who have been observed to interact with item i is and represents the attention weight; and They represent the weight of user u to item i, and the weight of item i to user u respectively; j represents the item that user u has not interacted with.

6. The recommendation method based on ranking target according to claim 4, characterized in that: Also includes: In the calculation of each Rankformer layer, the user representation and the item representation are linearly expanded and calculated.

7. The recommendation method based on ranking target according to claim 1, characterized in that: The predicting the interest scores of the user and the recommended item according to the user representation and the item representation output by the item recommendation model, so as to obtain the recommendation ranking results of the recommended items according to the interest scores, includes: Based on the item recommendation model, a predicted user representation and item representation are obtained; Determining the interest score according to the user representation and the item representation; The recommended items are sorted according to the interest scores to obtain the recommendation sorting result.

8. A recommendation device based on a ranking target, characterized in that: include: A sample acquisition module is used to acquire training samples; The training samples include historical interaction data between multiple sample users and corresponding items; The model building module is used to build the optimization target of the initial recommendation model based on the AUC indicator in the recommendation scenario; A model training module, used to train the initial recommendation model to obtain an item recommendation model based on the optimization target, the training samples and a preset loss function; The item recommendation module is used to predict the interest scores of the user and the recommended items according to the user representation and the item representation output by the item recommendation model, so as to obtain the recommendation ranking results of the recommended items according to the interest scores.

9. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the recommendation method based on ranking objectives according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the recommendation method based on ranking objectives described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Commodity recommendation method based on meta-learning and knowledge graph

    CN114708064A

  • Multi-interest recommendation method based on self-attention routing and Transform

    CN114741590A

  • Article recommendation method and device and storage medium

    CN116010684A

  • Graph contrast learning recommendation method, system and device based on global collaboration and medium

    CN117350803A

  • Image ordered classification model training method and device, electronic equipment and storage medium

    CN117437464A

Cited By

  • Recommendation method, device and equipment

    CN121233855A