Training method, recommendation method, device, equipment, storage medium and program product
By introducing quantum kernel matrices and quantum kernel functions into the recommender system, the problem that existing matrix factorization cannot capture nonlinear interaction relationships is solved, thereby improving the accuracy and personalized recommendation effect of the recommender system.
Patent Information
- Application Number
- CN202511762359.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-02-27
AI Technical Summary
Existing matrix factorization-based recommendation systems lack accuracy in recommending items when dealing with highly personalized scenarios, and cannot effectively capture the non-linear interaction between users and items.
A quantum kernel matrix is introduced, which maps the latent semantic features of users and items to the quantum feature space through a quantum kernel function to generate a quantum kernel matrix. The user and item weight parameters are then updated using gradient descent to optimize the recommendation model.
It improves the accuracy of item recommendations, better capturing the complex non-linear relationship between users and items, and providing more accurate personalized recommendations.
Smart Images

Figure CN121581963A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a training method, a recommendation method, a device, equipment, a storage medium and a program product. BACKGROUND
[0002] Matrix factorization (MF) is one of the core technologies of the recommendation system. By decomposing the user-item interaction matrix into lower-dimensional user factor and item factor matrices, it effectively reveals the user's potential interest preferences and item characteristics, and thus realizes accurate recommendation.
[0003] Based on matrix factorization, it is assumed that the preferences between users and items can be described by a low-rank linear model. Therefore, when dealing with highly personalized scenarios, the accuracy of item recommendation is insufficient. SUMMARY
[0004] To solve some defects in the background art, the embodiments of the present application provide a training method, a recommendation method, a device, equipment, a storage medium and a program product.
[0005] In a first aspect, the embodiments of the present application provide a training method, comprising: obtaining rating data between users and items; obtaining an initialized user weight parameter, an item weight parameter and a feature parameter set; determining quantum kernel values between each feature vector in the feature parameter set and generating a quantum kernel matrix; determining a predicted rating between users and items according to the user weight parameter, the item weight parameter and the quantum kernel matrix; updating the user weight parameter and the item weight parameter based on the rating data and the predicted rating.
[0006] In an embodiment of the first aspect, the rating data comprises a rating matrix, the user weight parameter comprises a user weight matrix, the item weight parameter comprises an item weight matrix, and the feature parameter set comprises a feature matrix.
[0007] In an embodiment of the first aspect, the determination of the quantum kernel values between each feature vector in the feature parameter set comprises: combining each feature vector in the feature parameter set in pairs, and determining the quantum kernel values corresponding to each feature vector combination based on quantum kernel mapping.
[0008] In an embodiment of the first aspect, the quantum kernel values are determined based on the quantum state inner product of the feature vectors in the quantum feature space.
[0009] In a second aspect, embodiments of the present application provide a recommendation method, the method comprising: obtaining a quantum kernel matrix, obtaining a user weight corresponding to a target user from a user weight parameter, and obtaining an item weight corresponding to a candidate item from an item weight parameter; determining a predicted score between the target user and the candidate item according to the quantum kernel matrix, the user weight, and the item weight; generating a recommendation result according to the predicted score.
[0010] In an embodiment of the second aspect, the quantum kernel matrix is generated by the training method of the first aspect, and the user weight parameter and the item weight parameter are updated by the training method of the first aspect.
[0011] In a third aspect, embodiments of the present application provide a training device, comprising: a first obtaining module configured to obtain rating data between users and items; a second obtaining module configured to obtain an initialized user weight parameter, an initialized item weight parameter, and a feature parameter set; a generating module configured to determine quantum kernel values between feature vectors in the feature parameter set and generate a quantum kernel matrix; a determining module configured to determine predicted scores between users and items according to the user weight parameter, the item weight parameter, and the quantum kernel matrix; an updating module configured to update the user weight parameter and the item weight parameter based on the rating data and the predicted scores.
[0012] In a fourth aspect, embodiments of the present application provide a recommendation device, comprising: a data obtaining module configured to obtain a quantum kernel matrix, obtain a user weight corresponding to a target user from a user weight parameter, and obtain an item weight corresponding to a candidate item from an item weight parameter; a scoring module configured to determine a predicted score between the target user and the candidate item according to the quantum kernel matrix, the user weight, and the item weight; a recommendation module configured to generate a recommendation result according to the predicted score.
[0013] In a fifth aspect, a computing device comprises a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the steps of the method of any one of the first aspect or the second aspect.
[0014] In a sixth aspect, a computer readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method of any one of the first aspect or the second aspect. In a seventh aspect, a computer program product comprises a computer program, which, when executed by a processor, implements the steps of the method of any one of the first aspect or the second aspect.
[0015] According to the training method, the recommendation method, the device, the equipment, the storage medium and the program product provided in the embodiments of the present application, the quantum kernel values between the feature vectors in the feature parameter set are determined and the quantum kernel matrix is generated through the initialized user weight parameter, the item weight parameter and the feature parameter set; the predicted scores between the users and the items are determined according to the user weight parameter, the item weight parameter and the quantum kernel matrix; and the user weight parameter and the item weight parameter are updated based on the score data and the predicted scores. The above-mentioned method introduces the quantum kernel matrix in the training, so as to represent the similarity between the feature vectors and provide additional feature correlation representation capability. Meanwhile, the user weight parameter and the item weight parameter are iteratively updated, so that the item recommendation can gradually fit the evaluation data used for training, thereby improving the accuracy of the score prediction. BRIEF DESCRIPTION OF DRAWINGS
[0016] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which:
[0017] Figure 1 is a flowchart of a training method provided by an embodiment of the present application.
[0018] Figure 2 is a schematic diagram of quantum kernel mapping in a training method provided by an embodiment of the present application.
[0019] Figure 3 is a schematic diagram of loading parameters to a quantum kernel matrix in a training method provided by an embodiment of the present application.
[0020] Figure 4 is a flowchart of a recommendation method provided by an embodiment of the present application.
[0021] Figure 5 is a block diagram of a training device provided by an embodiment of the present application.
[0022] Figure 6 is a block diagram of a recommendation device provided by an embodiment of the present application.
[0023] Figure 7 is a schematic diagram of a computer program product provided by an embodiment of the present application.
[0024] Figure 8 is a hardware block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of the present application more apparent, the following will describe example embodiments according to the present application in detail with reference to the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the example embodiments described herein.
[0026] The solutions of the present disclosure are described below with reference to the accompanying drawings.
[0027] Referring to Figure 1 A training method comprises: S101, obtaining rating data between users and items.
[0028] In the training method of the embodiments of the present application, the quantum kernel matrix, the user weight parameter and the item weight parameter are used to generate a predicted rating of an item by a user, so as to recommend the item to the user based on the predicted rating.
[0029] In the embodiments of the present application, the "item" is a general concept for representing a recommendation object, without limiting specific business types and data forms. The item can be any object that can be interacted by a user, including but not limited to: a commodity, a service, a video, an image, an audio, an application program, a document, an advertisement content or other digital content. The present application does not limit the specific type or form of the item.
[0030] In the embodiments of the present application, the rating data between the users and the items is used to represent the preference degree of the users to the items. The users and the items corresponding to the rating data are generally multiple, and can be represented in the form of a rating matrix. For example, the rating data comprises a rating matrix, wherein the rows of the rating matrix correspond to the users, the columns correspond to the items, and the rating values in the matrix are used to represent the preference degree of the corresponding user to the corresponding item.
[0031] S102, obtaining initialized user weight parameters, item weight parameters and a set of feature parameters.
[0032] In the embodiments of the present application, the "user weight parameter" is used to represent the weight of a user in each feature dimension of the feature parameter set, and is used to represent the representation of the user in the latent semantic space. The user weight parameter can be represented by a matrix or other structure capable of representing the weight of the user's features, which is not limited in the present application. In an exemplary implementation, the user weight parameter can be in the form of a user weight matrix, wherein each row of the matrix corresponds to a weight vector of a user.
[0033] In the embodiments of the present application, the "item weight parameter" is used to represent the weight of an item in each feature dimension of the feature parameter set, and is used to represent the representation of the item in the latent semantic space. The item weight parameter can be represented by a matrix or other structure capable of representing the weight of the item's features, which is not limited in the present application. In an exemplary implementation, the item weight parameter can be in the form of an item weight matrix, wherein each row of the matrix corresponds to a weight vector of an item.
[0034] In the embodiments of the present application, the "feature parameter set" is used to represent the set of feature bases required to construct the quantum kernel matrix. The feature parameter set can include multiple feature vectors and can be represented by a feature matrix or other set form, which is not limited in the embodiments of the present application; in an exemplary implementation, the feature parameter set can be represented by a feature matrix, wherein the vectors in the feature matrix are used to map to corresponding quantum states to calculate the quantum kernel value.
[0035] In the embodiments of the present application, "initialization" is used to represent the process of assigning initial values to various parameters. The user weight parameter, item weight parameter and feature parameter set obtained in this step are initialized, and the subsequent parameter optimization update provides an initial state. In an exemplary implementation, the user weight parameter, item weight parameter and feature parameter set can be initialized in a random manner, for example, initial weight values can be generated in a uniform distribution, normal distribution or other random distribution; other methods capable of providing initial parameters can also be used.
[0036] In the embodiments of the present application, the rating data, user weight, item weight and feature parameter can be in the form of a matrix structure, which enables the entire quantum kernel matrix decomposition model to be implemented in a matrix operation manner, thereby significantly improving the calculation efficiency, training stability, quantum kernel compatibility and overall system scalability.
[0037] S103, determine the quantum kernel value between each feature vector in the feature parameter set, and generate a quantum kernel matrix.
[0038] In the embodiments of the present application, the quantum kernel value is used to represent the similarity of two feature vectors in the quantum feature space. Specifically, the feature vectors can be mapped into corresponding quantum states by quantum kernel mapping, and the quantum kernel value between two feature vectors can be determined based on the inner product or correlation measurement between their corresponding quantum states.
[0039] In an exemplary implementation, the feature vectors in the feature parameter set can be combined in pairs, and the quantum kernel values corresponding to each feature vector combination can be determined based on quantum kernel mapping. The quantum kernel matrix is constructed by the quantum kernel values of all feature vector combinations, and each element in the quantum kernel matrix is used to represent the quantum kernel value of the corresponding feature vector in the quantum feature space. The calculation method of the quantum kernel value in the embodiments of the present application is not limited, which can be obtained by quantum kernel circuit, classical simulation of quantum kernel circuit or other methods capable of measuring the similarity of quantum states.
[0040] In S104, the predicted score between the user and the item is determined according to the user weight parameter, the item weight parameter and the quantum kernel matrix.
[0041] In the embodiments of the present application, the user weight parameter is used to represent the weight information of the user in each feature dimension of the feature parameter set, and the item weight parameter is used to represent the weight information of the item in each feature dimension. The quantum kernel matrix reflects the similarity of each feature vector in the feature parameter set in the quantum feature space. Based on the above parameters, the interaction relationship between the user and the item can be modeled to determine the predicted score of the user for the item.
[0042] In an exemplary implementation, the user weight vector and the item weight vector can be obtained, and the user weight vector and the item weight vector can be combined by weighting based on the quantum kernel matrix to obtain the corresponding predicted score. The score calculation method in the embodiments of the present application is not limited, and the predicted score can be obtained by inner product operation, matrix operation or other calculation methods capable of constructing a nonlinear interaction relationship by using the user weight, the item weight and the quantum kernel matrix.
[0043] In S105, the user weight parameter and the item weight parameter are updated based on the score data and the predicted score.
[0044] In the embodiments of the present application, the loss function can be constructed based on the difference between the score data and the predicted score to measure the deviation of the predicted score from the real score.
[0045] Specifically, a gradient descent method or other gradient-based parameter optimization method can be adopted to iteratively update the weight values in the user weight parameters and the item weight parameters according to the loss function. In an exemplary implementation, when the user weight parameters and the item weight parameters are represented in the form of a user weight matrix and an item weight matrix respectively, the updating process can be implemented by iteratively adjusting the corresponding weight elements in the user weight matrix and the item weight matrix.
[0046] The embodiments of the present application do not limit the form of the loss function, and the difference can be a squared error, a cross-entropy error or other measurement method capable of measuring the difference between the predicted score and the corresponding score in the score data. The embodiments of the present application also do not limit the optimization updating method, as long as the score error can be used to optimize and update the parameters, the purpose of the present step can be achieved.
[0047] According to a training method of the embodiments of the present application, the quantum kernel values between each feature vector in the feature parameter set are determined and the quantum kernel matrix is generated by the initialized user weight parameters, item weight parameters and feature parameter set; the predicted score between the user and the item is determined according to the user weight parameters, item weight parameters and quantum kernel matrix; and the user weight parameters and item weight parameters are updated based on the score data and the predicted score. The above-mentioned method introduces the quantum kernel matrix in the training to represent the similarity between the feature vectors, provides additional feature association representation capability, and captures the nonlinear interaction structure that cannot be represented by traditional matrix decomposition; at the same time, the user weight parameters and the item weight parameters are iteratively updated, so that the item recommendation can gradually fit the evaluation data used for training, thereby improving the accuracy of score prediction and further improving the effect of item recommendation.
[0048] In the embodiments of the present application, the user weight parameters, item weight parameters and quantum kernel matrix obtained through the above training steps can jointly constitute a recommendation model. The model can perform score prediction based on the user weight and the item weight in the nonlinear structure provided by the quantum kernel matrix, so as to determine the preference degree of the user to the item in the reasoning stage.
[0049] The technical principle of the embodiments of the present application will be introduced below taking the score matrix as the score data, the feature matrix as the feature parameter set, the user weight matrix as the user weight parameter and the item weight matrix as the item weight parameter: For the score matrix , the basic idea of matrix decomposition is to approximate the observed score matrix to the product of two low-rank matrices, which can be expressed as formula 1: (1) Wherein, is the predicted score matrix, is the user latent semantic matrix, whose size is ; is the item latent semantic matrix, whose size is ; denotes the rank of matrix decomposition. Wherein, the rating of user u to item i can be expressed as formula 2: (2) Wherein, is the latent semantic vector representation of user u, is the latent semantic vector representation of item i. By minimizing the loss function , learning from the rating matrix , it can be expressed as formula 3: (3) Wherein, is the set of known ratings of user-item pairs in the rating matrix , is the true rating of user u to item i, is the predicted rating of user u to item i.
[0050] Matrix decomposition assumes that the interaction relationship between users and items is linear, ignoring the complex nonlinear interaction patterns between users and items. As shown in Figure 2 , the embodiment of the application proposes quantum kernel matrix decomposition, which maps the user latent semantic matrix and the item latent semantic matrix of the original space 201 to the quantum feature space through the quantum kernel function (Quantum Kernel Function, referred to as: QKF). Specifically, the user latent semantic matrix and the item latent semantic matrix of the original space 201 can be mapped to the quantum feature space 203 by using the quantum kernel circuit 202. Based on the superposition and entanglement properties in quantum mechanics, data patterns that cannot be identified by any classical method are captured, so as to mine the deep interaction relationship between users and items and provide more accurate recommendation results for users.
[0051] It is assumed that in the original space 201, there is a feature matrix . The feature matrix has a size of and is composed of k feature vectors with a dimension of h . There is a quantum kernel mapping , which maps the feature matrix to the quantum feature space 203 to obtain the feature matrix , and the matrix has a size of The latent semantic vector of user u , mapped to the quantum feature space 203, is given by and can be expressed as equation 3.1: (3.1) where is the weight vector of user u on the feature matrix , subscript j denotes the dimension, and is the jth feature vector. The weight matrix of the user set on the feature matrix is
[0052] Similarly, the latent semantic vector of item i , mapped to the quantum feature space 203, is given by and can be expressed as equation 3.2: (3.2) where is the weight vector of item i on the feature matrix , subscript j denotes the dimension, and is the kth feature vector. The weight matrix of the item set on the feature matrix is
[0053] The rating of user u on item i can be expressed as equation 3.3: (3.3) where is the weight vector of user u on the feature matrix , is the quantum kernel matrix, has a size of , and is the weight vector of item i on the feature matrix .
[0054] The calculation method of the quantum kernel matrix is given below. As shown in FIG. 2, the quantum kernel circuit 202 is composed of circuits Figure 2 and wherein the circuit is the inverse circuit of , that is, the conjugate transpose circuit. For the circuit , equation 3.4 is: (3.4) indicates that the quantum kernel matrix is obtained by encoding the circuit The feature vector is encoded into a certain quantum state . Based on this, the quantum kernel function is defined as the feature vector The inner product in the quantum feature space can be expressed as formula 3.5: (3.5) where, () represents the quantum kernel mapping, represents the first eigenvector in the feature matrix, represents the first eigenvector in the feature matrix, represents the probability that the measurement result of b quantum bits is all 0 state. The quantum kernel matrix is expressed as formula 3.6: (3.6) where, represents the value of the e row f column of the quantum kernel matrix , , , () represents the quantum kernel mapping, represents the first eigenvector in the feature matrix, represents the first eigenvector in the feature matrix.
[0055] The loss function of the quantum kernelized matrix decomposition can be defined as formula 3.7: (3.7) where, represents the set of user-item pairs with known ratings in the rating matrix represents the rating of user u to item i, represents the predicted rating of user u to item i, represents the weight vector of user u on the feature matrix K represents the quantum kernel matrix, represents the weight vector of item i on the feature matrix .
[0056] After introducing the above technical principles, in order to facilitate understanding of the specific implementation mode of the embodiments of the present application, the implementation process of each step in the training method and the optional implementation mode thereof will be described in detail below in combination with the illustrations and the above steps.
[0057] In an embodiment, in step S101, the user's browsing, clicking, collecting, liking, playing, purchasing, commenting or other behavior records of the item can be obtained, and the above behaviors are mapped to the score value of the item according to the preset rules. Explicit scoring methods can also be used, such as user-initiated scoring records. Based on the above explicit scoring or implicit scoring inferred from user behavior, the scoring data between the user and the item can be constructed, and the corresponding scoring matrix is formed. For example, the historical interaction records of the user and the item are collected, and a scoring matrix of size is obtained. is the number of users, is the number of items, and the scoring matrix , wherein the value 1 indicates that the user likes the item, the value 0 indicates that the user does not like the item, and the missing value indicates that the user's preference for the item is unknown.
[0058] The above scoring matrix can include both real known scores and missing scores, which are used to represent that the user's preference for some items is unknown. The representation of the scoring value is not limited in the present application, and can be in the form of binary scoring, discrete grading scoring or continuous scoring.
[0059] For example, in the movie recommendation scenario, the user's scoring data set of the movie is collected, in which the user scores the movie, and the scoring range is 1-5. Marking greater than 3 as value 1 indicates that the user likes the item; marking not greater than 3 as value 0 indicates that the user does not like the item; and marking the rest as -1 indicates that the user's interest in the item is unknown. Under the above rules, the scoring matrix between the user and the item can be constructed. The scoring matrix has a size of , wherein represents the number of users, represents the number of items. The scoring matrix can include both explicit scoring and implicit scoring inferred from user behavior, which is not limited in the present application.
[0060] In an embodiment, in step S102, the user weight parameter can be represented in the form of a user weight matrix , wherein each row of the user weight matrix is used to represent the weight vector of a user in each feature dimension of the feature parameter set, and the dimension of the matrix can be set as needed. The item weight parameter is represented in the form of an item weight matrix , wherein each row is used to represent the weight vector of an item in each feature dimension of the feature parameter set, and the dimension of the matrix can be set as needed. The user weight matrix and the item weight matrix The initialization operations such as random initialization can be performed in an initial training stage, and the updates can be performed based on the score difference in the training process.
[0061] In an embodiment, the set of feature parameters can be represented in the form of a feature matrix The feature matrix may include a plurality of feature vectors, each of which is used to represent a feature basis for generating a quantum kernel matrix in the quantum kernel mapping stage. The embodiments of the present application do not limit the specific size of the feature matrix or the dimension of the feature vector, which can be set according to the specific scene and data size.
[0062] In an embodiment, the user weight parameter, the item weight parameter, and the set of feature parameters can be randomly initialized. Taking the user weight matrix , the item weight matrix , and the feature matrix as examples, the size of the user weight matrix is , the size of the item weight matrix is , and the size of the feature matrix is . k and h are hyperparameters, k can take the value 10, and h can take the value 5. The values of k and h are generally much smaller than the corresponding number of users m or the number of items n. The hyperparameters will be different depending on the data distribution of the recommendation scene, and the values of k and h can be adjusted by the user when using the method of the embodiments of the present application.
[0063] In an embodiment, in step S103, the quantum kernel function can be used to determine the quantum kernel values between the feature vectors in the set of feature parameters and generate a quantum kernel matrix. The feature vectors in the set of feature parameters can be combined in pairs, and the quantum kernel values corresponding to each feature vector combination can be determined based on quantum kernel mapping. Specifically, each feature vector combination can be loaded into a quantum kernel circuit, and the quantum kernel values corresponding to each feature vector combination can be determined by running the quantum kernel circuit. The quantum kernel values are determined based on the quantum state inner product of the feature vectors in the quantum feature space. By combining the feature vectors in pairs and calculating the quantum kernel values, a global similarity matrix in the quantum feature space can be constructed, thereby enhancing the nonlinear expression capability of the model, improving the score prediction accuracy, and reducing the computational cost of training and inference. Determining the quantum kernel values based on the quantum state inner product in the quantum feature space enables the system to obtain a high expression capability, stable and physically meaningful feature similarity measure, thereby enhancing the modeling capability of the model for complex nonlinear relationships, improving the score prediction accuracy and training stability.
[0064] Taking the representation of the set of feature parameters in the form of the feature matrix as an example, the feature matrix It contains eigenvectors, and for the feature matrix... eigenvectors in , According to formulas 3.5 and 3.6, take... Two row vectors in This is used as a parameter to load into the quantum nuclear circuit, see [link / reference]. Figure 3 , Figure 3 Due to layout reasons, it has been split into several sections for display, but the whole constitutes a continuous quantum nuclear circuit diagram. Running the quantum nuclear circuit on a quantum computer can yield a quantum nuclear matrix. The value of row e and column f The feature matrix By combining all eigenvectors pairwise and calculating them using the method described above, the quantum kernel matrix can be obtained. .
[0065] In one embodiment, in step 104, the predicted rating between the user and the item is determined based on the user weight parameters, the item weight parameters, and the quantum kernel matrix. Specifically, the predicted rating can be determined by multiplying the weights in the user weight parameters, the weights in the item weight parameters, and the corresponding quantum kernels in the quantum kernel matrix. For example, the predicted rating of user u for item i is calculated according to Formula 3.3.
[0066] In one embodiment, in step S105, the difference between the rating in the rating data and the predicted rating can be measured by a loss function. For example, a loss function based on known ratings can be constructed to quantify the error between the predicted rating and the true rating in the rating data. By minimizing the loss function, the user weight parameters and item weight parameters can be updated. In an exemplary implementation, gradient descent can be used to iteratively update the user weight parameters and item weight parameters according to the loss function; other optimization methods can also be used to iteratively update the user weight parameters and item weight parameters.
[0067] When the user weight parameters and item weight parameters are in the form of user weight matrices and item weight matrices, respectively, the above update process can be achieved by iteratively adjusting the corresponding weight values in the user weight matrices and item weight matrices. This application does not limit this approach, and other parameter optimization methods that can minimize scoring errors can also be used.
[0068] For example, gradient descent can be used to minimize the loss function (Equation 3.7) and update the user weight parameters and item weight parameters to optimize them. The user weight parameters are represented by the user weight matrix. The item weight parameters form the item weight matrix. At that time, for the user weight matrix and item weight matrix Parameter optimization is performed.
[0069] In this embodiment, the quantum kernel matrix The updated user weight parameters and the updated item weight parameters can be saved to a storage device for use when recommending items to users.
[0070] Referring to Figure 4 A recommendation method, the method comprising: S401, obtaining a quantum kernel matrix, obtaining user weights corresponding to a target user from user weight parameters, and obtaining item weights corresponding to candidate items from item weight parameters.
[0071] For example, a user with a user id of , and a list of item ids of candidate items .
[0072] The user weight parameters corresponding to the target user and the item weight parameters corresponding to the candidate items are obtained. For example, according to the user id of the target user, a corresponding user weight vector is obtained from the user weight matrix; according to the list of item ids of the candidate items, a corresponding item weight vector is obtained from the item weight matrix.
[0073] S402, determining a predicted score between the target user and the candidate items according to the quantum kernel matrix, the user weights, and the item weights.
[0074] According to the quantum kernel matrix, the user weight parameters, and the item weight parameters, the predicted score of each candidate item for the target user is determined using formula 3.3, which represents the degree of preference of the target user for the candidate item.
[0075] S403, generating a recommendation result according to the predicted score.
[0076] The items in the item list can be sorted from large to small according to the predicted score, i.e., the degree of preference, and the top N items from the sorted item list can be selected for recommendation to the user. The above recommendation process can be performed on a classical computer, and N can be set according to requirements, for example, any number between 1 and 10. When N is 1, the item with the highest predicted score is selected for recommendation to the user; when N is 2, the top 2 items with the highest predicted scores are selected for recommendation to the user; when N is 3, the top 3 items with the highest predicted scores are selected for recommendation to the user, and so on.
[0077] Recommendation systems play a crucial role in today's information explosion era. They not only help users quickly find interesting content in a vast amount of data, improving user experience, but also enable precise marketing for businesses and platforms, increasing conversion rates and user stickiness, thus driving business growth. The effectiveness of recommendation systems directly affects the competitiveness and profitability of e-commerce, social media, content platforms, and advertising industries, making them one of the key factors for business success in the digital age. Through quantum kernelization technology, the embodiments of the present application can capture complex nonlinear relationships between users and items in a quantum feature space, improving recommendation accuracy and providing users with a better personalized recommendation experience. In addition, the embodiments of the present application provide a case for the application of quantum computing technology in the business field, promoting the deep integration of quantum computing and artificial intelligence. This is conducive to attracting more investment into the quantum computing field, promoting the progress of quantum technology research and development, and accelerating the commercialization process of quantum computing technology.
[0078] The embodiments of the present application use quantum kernelization technology to map the latent semantic features of users and items to a quantum feature space through quantum kernel functions, effectively capturing and utilizing the nonlinear interaction information between them, significantly improving the depth of understanding of complex user preferences and item associations by the recommendation system, and improving recommendation accuracy.
[0079] The embodiments of the present application, in view of the fact that quantum computing resources are relatively scarce, limiting the widespread deployment and application of quantum true machines in the recommendation field, shift the application focus of quantum true machines from real-time inference process to offline training stage. In this way, the quantum kernelization process is performed on a quantum computer, while the actual recommendation generation is still performed on a classical computer. This not only leverages the advantages of quantum computing in handling highly complex pattern recognition, but also ensures the efficient deployment and widespread applicability of recommendation services.
[0080] The embodiments of the present application, in view of the challenge of data sparsity commonly existing in recommendation systems, optimize the processing capability for sparse data through the combination of matrix decomposition and quantum computing, ensuring that high-quality personalized recommendations can still be provided in the case of data sparsity, and are applicable to various recommendation fields.
[0081] Referring to Figure 5 The embodiments of the present application also provide a training device, comprising: The first acquisition module 501 is configured to acquire rating data between users and items; The second acquisition module 502 is configured to acquire initialized user weight parameters, item weight parameters, and a feature parameter set; The generation module 503 is configured to determine quantum kernel values between each feature vector in the feature parameter set and generate a quantum kernel matrix; The determining module 504 is configured to determine a predicted score between a user and an item according to the user weight parameter, the item weight parameter, and the quantum kernel matrix. The updating module 505 is configured to update the user weight parameter and the item weight parameter based on the score data and the predicted score.
[0082] In an embodiment, the score data comprises a score matrix, the user weight parameter comprises a user weight matrix, the item weight parameter comprises an item weight matrix, and the set of feature parameters comprises a feature matrix.
[0083] In an embodiment, the generating module 503 is configured to determine the quantum kernel value between each feature vector in the set of feature parameters, and specifically configured to: combine each feature vector in the set of feature parameters in pairs, and determine the quantum kernel value corresponding to each feature vector combination based on the quantum kernel mapping.
[0084] In an embodiment, the quantum kernel value is determined based on the quantum state inner product of the feature vectors in the quantum feature space.
[0085] The above modules can be implemented by hardware, software or a combination of hardware and software, and those skilled in the art can implement them according to the foregoing method embodiments, which will not be described here.
[0086] Referring to Figure 6 The embodiments of the present application also provide a recommendation device, comprising: The data acquisition module 601 is configured to acquire the quantum kernel matrix, acquire a user weight corresponding to a target user from the user weight parameter, and acquire an item weight corresponding to a candidate item from the item weight parameter. The score module 602 is configured to determine a predicted score between the target user and the candidate item according to the quantum kernel matrix, the user weight, and the item weight. The recommendation module 603 is configured to generate a recommendation result according to the predicted score.
[0087] The above modules can be implemented by hardware, software or a combination of hardware and software, and those skilled in the art can implement them according to the foregoing method embodiments, which will not be described here.
[0088] The exemplary embodiments of the present application also provide an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication. The memory stores a computer program capable of being executed by the at least one processor, and the computer program is used to make the electronic device execute the method according to the embodiments of the present application when executed by the at least one processor.
[0089] The exemplary embodiments of the present application further provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, causes the computer to perform the method according to the embodiments of the present application.
[0090] Referring to Figure 7 The exemplary embodiments of the present application further provide a computer program product 700 comprising a computer program 701, wherein the computer program, when executed by a processor of a computer, causes the computer to perform the method according to the embodiments of the present application.
[0091] Referring to Figure 8 A structural block diagram of an electronic device 800 that can be a server or a client of the present application, which is an example of a hardware device that can be applied to various aspects of the present application, will now be described. The electronic device is intended to represent a wide variety of digital electronic computer devices such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device can also represent a wide variety of mobile devices such as cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.
[0092] The electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for device operation can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0093] A plurality of components in the electronic device 800 are connected to the I / O interface 805, including an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 can be any type of device capable of inputting information to the electronic device 800, and can receive inputted digital or character information, and generate key signal inputs related to user settings and / or function controls of the electronic device. The output unit 807 can be any type of device capable of presenting information, and can include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 808 can include, but is not limited to, a magnetic disk, an optical disk. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0094] The computing unit 801 can be various general and / or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs various methods and processes described above. For example, in some embodiments, the methods of the present embodiments can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 800 via the ROM 802 and / or the communication unit 809. In some embodiments, the computing unit 801 can be configured to perform the methods of the present embodiments by any other appropriate means, such as by means of firmware.
[0095] The above generally describes only some embodiments of the present application, and the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, and all such changes or replacements should be encompassed within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A training method characterized by, The method comprises: obtaining rating data between users and items; obtaining initialized user weight parameters, item weight parameters and a feature parameter set; determining quantum kernel values between feature vectors in the feature parameter set and generating a quantum kernel matrix; determining predicted ratings between users and items according to the user weight parameters, the item weight parameters and the quantum kernel matrix; updating the user weight parameters and the item weight parameters based on the rating data and the predicted ratings.
2. The method of claim 1, wherein, The rating data comprises a rating matrix, the user weight parameters comprise a user weight matrix, the item weight parameters comprise an item weight matrix, and the feature parameter set comprises a feature matrix.
3. The method of claim 1, wherein, The determination of the quantum kernel values between the feature vectors in the feature parameter set comprises: combining the feature vectors in the feature parameter set two by two and determining quantum kernel values corresponding to each combination of the feature vectors based on quantum kernel mapping.
4. The method of claim 3, wherein, The quantum kernel values are determined based on quantum state inner products of the feature vectors in a quantum feature space.
5. A recommendation method characterized by comprising: The method comprises: obtaining a quantum kernel matrix, user weight corresponding to a target user from user weight parameters and item weight corresponding to a candidate item from item weight parameters; determining predicted ratings between the target user and the candidate item according to the quantum kernel matrix, the user weight and the item weight; generating a recommendation result according to the predicted ratings.
6. A training device, characterized by The method comprises: a first obtaining module for obtaining rating data between users and items; a second obtaining module for obtaining initialized user weight parameters, item weight parameters and a feature parameter set; a generating module for determining quantum kernel values between feature vectors in the feature parameter set and generating a quantum kernel matrix; a determining module for determining predicted ratings between users and items according to the user weight parameters, the item weight parameters and the quantum kernel matrix; an updating module for updating the user weight parameters and the item weight parameters based on the rating data and the predicted ratings.
7. A recommendation device characterized by comprising: The method comprises: a data obtaining module for obtaining a quantum kernel matrix, user weight corresponding to a target user from user weight parameters and item weight corresponding to a candidate item from item weight parameters; a rating module for determining predicted ratings between the target user and the candidate item according to the quantum kernel matrix, the user weight and the item weight; a recommendation module for generating a recommendation result according to the predicted ratings.
8. A computing device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program is configured to: The processor executes the computer program to implement the steps of the method of any one of claims 1-5.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.