Model training and item recommendation method and device, electronic equipment, storage medium and computer program product

By capturing the nonlinear interaction between users and items through quantum model training, and combining quantum neural networks and matrix factorization techniques, the problem of insufficient recommendation accuracy in existing recommendation schemes is solved, achieving higher accuracy and personalized recommendations.

CN120744246BActive Publication Date: 2025-11-11CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511256086.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-11-11
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

Existing recommendation schemes cannot fully consider the complex nonlinear interactions between users and items in highly personalized scenarios, resulting in insufficient recommendation accuracy.

Method used

By acquiring sample data on users' preferences for latent features and the correlation between items and latent features, a quantum model is used for training to capture the nonlinear interaction between users and items. Combined with quantum neural networks and matrix factorization techniques, data processing capabilities are optimized.

Benefits of technology

It improves the accuracy and personalization of item recommendations, and enhances the applicability and scalability of the quantum model in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120744246B_ABST
    Figure CN120744246B_ABST
Patent Text Reader

Abstract

This application discloses a model training and item recommendation method, apparatus, electronic device, storage medium, and computer program product, comprising: acquiring first sample data and second sample data, wherein the first sample data represents the degree of preference of one or more users for latent features, and the second sample data represents the degree of association between one or more items and the latent features, wherein the latent features include classification features associated with user behavior; training a first quantum model using the first sample data and the second sample data, wherein the first quantum model is at least able to capture the nonlinear interaction relationship between users and items, and the first quantum model is used to recommend items to users to be recommended. The solution provided in this application, during the training process, leverages the data mining capabilities of the quantum model to effectively capture the nonlinear interaction relationship between users and items, thereby improving the accuracy of subsequent item recommendations using the quantum model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of quantum computing, and more particularly to a method, apparatus, electronic device, storage medium, and computer program product for model training and item recommendation. Background Technology

[0002] Recommendation technology is an information filtering technology that analyzes factors such as users' historical behavior, interests, and social relationships to better understand their needs and provide personalized lists of recommended items. In this context, recommendation technology not only helps users quickly find content of interest from massive amounts of data but also helps merchants and platforms understand user needs, thereby driving business growth.

[0003] However, the relevant recommendation schemes suffer from low accuracy. Summary of the Invention

[0004] To address the related technical issues, embodiments of this application provide a model training and item recommendation method, apparatus, electronic device, storage medium, and computer program product.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a model training method, including:

[0007] Acquire first sample data and second sample data, wherein the first sample data represents the degree of preference of one or more users for latent features, and the second sample data represents the degree of association between one or more items and the latent features, wherein the latent features include classification features associated with user behavior;

[0008] Using the first sample data and the second sample data, a first quantum model is trained. The first quantum model is able to capture at least the nonlinear interaction relationship between users and items. The first quantum model is used to recommend items to users to be recommended.

[0009] This application provides a method for recommending items, including:

[0010] Obtain first data, which contains multiple candidate items associated with the user to be recommended;

[0011] Using the first data and the first quantum model, one or more items are recommended to the user to be recommended, wherein the first quantum model is obtained according to any of the above model training methods.

[0012] This application embodiment also provides a model training apparatus, including:

[0013] The first acquisition unit is used to acquire first sample data and second sample data. The first sample data represents the degree of preference of one or more users for implicit features, and the second sample data represents the degree of association between one or more items and the implicit features. The implicit features include classification features associated with user behavior.

[0014] The training unit is used to train a first quantum model using the first sample data and the second sample data. The first quantum model is at least able to capture the nonlinear interaction relationship between users and items. The first quantum model is used to recommend items to users to be recommended.

[0015] This application embodiment also provides an item recommendation device, including:

[0016] The second acquisition unit is used to acquire first data, which includes multiple candidate items associated with the user to be recommended;

[0017] The recommendation unit is used to recommend one or more items to the user to be recommended using the first data and the first quantum model, wherein the first quantum model is obtained according to any of the above model training methods.

[0018] This application also provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor.

[0019] When the processor runs the computer program, it executes the steps of implementing any of the above-mentioned model training methods or the steps of implementing any of the above-mentioned item recommendation methods.

[0020] This application embodiment also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the above-described model training methods, or the steps of any of the above-described item recommendation methods.

[0021] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described model training methods or the steps of any of the above-described item recommendation methods.

[0022] The model training and item recommendation method, apparatus, electronic device, storage medium, and computer program product provided in this application embodiment include the following: The model training method includes: acquiring first sample data and second sample data, where the first sample data represents the preference level of one or more users for latent features, and the second sample data represents the correlation between one or more items and the latent features, wherein the latent features include classification features associated with user behavior; training a first quantum model using the first sample data and the second sample data, wherein the first quantum model is at least able to capture the nonlinear interaction relationship between users and items, and the first quantum model is used to recommend items to users. The technical solution provided in this application embodiment, through the data mining capabilities of the quantum model, captures the complex interaction relationship between users and items, enabling the quantum model to better learn the deep-level interaction patterns of user preferences and item associations, thus effectively improving the accuracy of item recommendation using the quantum model. Attached Figure Description

[0023] Figure 1 This is a schematic flowchart of a model training method according to an embodiment of this application;

[0024] Figure 2 This is a schematic diagram of a matrix decomposition structure according to an embodiment of this application;

[0025] Figure 3 This is a schematic diagram of the structure of a quantum circuit according to an embodiment of this application;

[0026] Figure 4 This is a flowchart illustrating an item recommendation method according to an embodiment of this application;

[0027] Figure 5 This is a schematic diagram illustrating the training process of the first model used in this application example;

[0028] Figure 6 This is a schematic diagram illustrating the training process of the second model used in this application example;

[0029] Figure 7 This is a flowchart illustrating a model reasoning method as an application example of this application;

[0030] Figure 8 This is a schematic diagram of the structure of the model training device according to an embodiment of this application;

[0031] Figure 9 This is a schematic diagram of the article recommendation device according to an embodiment of this application;

[0032] Figure 10 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0033] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.

[0034] In related technologies, one recommendation scheme is based on matrix factorization, analyzing users' potential interests and item characteristics. However, this approach relies on the assumption of a linear interaction between users and items, failing to adequately consider the complex nonlinear interactions commonly found between them. Therefore, in recommendation scenarios with complex users, this scheme still has room for improvement in recommendation accuracy. Another recommendation scheme utilizes quantum parallelism to accelerate singular value decomposition, thereby recommending items to users. However, this approach is also essentially based on the assumption of a linear interaction between users and items, neglecting the complex nonlinear interactions between them.

[0035] In conclusion, in highly personalized scenarios, the relevant recommendation schemes cannot provide users with accurate item recommendations.

[0036] Based on this, in various embodiments of this application, during model training, the quantum model can capture data patterns between the implicit semantic data of items and users based on data mining capabilities, thereby mining the deep-seated interaction relationships between users and items. In this way, the accuracy and personalization level of item recommendation using the quantum model can be greatly improved.

[0037] This application provides a model training method applicable to electronic devices, such as... Figure 1 As shown, the method includes:

[0038] Step 101: Obtain first sample data and second sample data. The first sample data represents the degree of preference of one or more users for the latent feature, and the second sample data represents the degree of association between one or more items and the latent feature. The latent feature includes classification features associated with user behavior.

[0039] Step 102: Using the first sample data and the second sample data, train the first quantum model. The first quantum model is at least able to capture the nonlinear interaction relationship between users and items. The first quantum model is used to recommend items to users to be recommended.

[0040] In practical applications, the electronic device may include a device capable of performing steps 101 to 102, such as a server, laptop, tablet, or desktop computer. This application embodiment does not limit the type of electronic device, as long as its function is implemented. Furthermore, the first quantum model may include a model based on a quantum neural network. This first quantum model can encode and mine data in the quantum feature space based on the superposition and entanglement properties in quantum mechanics, thereby capturing the interaction relationships or data patterns between data. This application embodiment does not limit the type of the first quantum model, as long as its function is implemented.

[0041] In practical applications, sample data associated with user interactions and items (such as videos, audio, application software, or goods; this application embodiment does not limit the type of item) may have data sparsity issues. Therefore, the electronic device can combine the inherent advantages of matrix factorization technology to split the sample data to obtain the first sample data and the second sample data.

[0042] Specifically, in one embodiment, obtaining the first sample data and the second sample data includes:

[0043] Obtain a seventh sample data point, which represents the true degree of preference of the one or more users for the one or more items;

[0044] The seventh sample data is subjected to matrix decomposition to obtain the first sample data and the second sample data.

[0045] In practical applications, the seventh sample data may include a true rating matrix of one or more users for one or more items. The rating matrix can reflect whether users like one or more items, that is, the degree of user preference for the items.

[0046] In practical applications, for the seventh sample data, the electronic device can obtain historical interaction data between users and items from the network, and obtain the seventh sample data based on the obtained historical interaction data.

[0047] For example, the electronic device can collect historical rating data of movies from the network, with ratings ranging from 1 to 5. In this case, the electronic device can mark data with a rating greater than 3 as 1 to indicate that the user likes the movie, mark data with a rating less than or equal to 3 as 0 to indicate that the user dislikes the movie, and mark the remaining data (such as unrated data) as -1 to indicate that the user's preference for the movie is unknown. In this way, a seventh sample data matrix of size m*n can be obtained, where m represents the number of users and n represents the number of items.

[0048] Next, based on matrix factorization, the electronic device can split the seventh sample data into the first sample data and the second sample data. The seventh sample data can be represented as the product of the first and second sample data. The first sample data may contain a user latent semantic matrix, which may contain user latent semantic vectors corresponding to multiple users. The second sample data may contain an item latent semantic matrix, which may contain item latent semantic vectors corresponding to multiple items. This application embodiment does not limit the types of the first and second sample data, as long as their functions are implemented. Furthermore, the latent features can be understood as potential classification features learned or mined based on user behavior reflected in the seventh sample data during the matrix factorization process, such as music classification or directorial style.

[0049] For example, such as Figure 2 As shown, when the seventh sample data contains a rating matrix of size m*n, the electronic device can approximate the rating matrix as the product of two low-rank matrices (or low-dimensional matrices) based on a pre-set parameter k (k can be represented as the rank of the matrix factorization); this can be expressed by the following formula:

[0050] (1)

[0051] in, This is represented as a scoring matrix, i.e., the seventh sample data; This is represented as a user latent semantic matrix of size k*m, i.e., the first sample data; This is represented as a latent semantic matrix of size k*n, which is the second sample data; the value of k is usually much smaller than the number of users m or the number of items n, and can be set according to the data distribution in the recommendation scenario, for example, set to 8; It is represented as an approximate rating matrix.

[0052] In practical applications, it can be seen from formula (1) that, for one or more users... u , for items i Rating vector It can be represented as:

[0053] (2)

[0054] in, It can be represented as user u The degree of preference for implicit features (which can also be understood as the user's preference) u (implicit semantic vectors) It can be represented as an item iThe degree of association between the item and its implicit features (which can also be understood as the item itself) i (implicit semantic vector).

[0055] Understandably, matrix factorization can decompose the historical interaction data between users and items (i.e., the seventh sample data) into lower-dimensional user-related data (i.e., the first sample data) and item-related data (i.e., the second sample data), thereby effectively revealing users' potential interests and preferences and item characteristics, so that the subsequent quantum model can learn the interaction relationship between interests and preferences and item characteristics.

[0056] In practical applications, after obtaining the first sample data and the second sample data in step 102, the electronic device can combine quantum neural network technology to deeply explore the interaction relationship between the first sample data and the second sample data in order to train the model.

[0057] Specifically, in one embodiment, the first quantum model includes quantum circuitry, and training the first quantum model using the first sample data and the second sample data includes:

[0058] The first sample data and the second sample data are encoded to obtain the third sample data, which contains a quantum state of N qubits, where N is an integer greater than or equal to 1.

[0059] The third sample data is input into the quantum circuit to obtain the fourth sample data, which represents the nonlinear interaction relationship between the one or more users and the one or more items.

[0060] Using the fourth sample data, the parameters of the quantum circuit are adjusted so that the loss function of the quantum circuit converges.

[0061] In practical applications, the third sample data can be understood as quantum initial data (also called quantum initial state) in the quantum feature space. Furthermore, the first quantum model can include the quantum circuitry (also called quantum circuit), meaning that the electronic device can construct the first quantum model using the quantum circuitry.

[0062] Here, the electronic device can transform the first and second sample data (also known as classical data) in the non-quantum feature space into the third sample data in the quantum feature space based on relevant encoding techniques (such as amplitude encoding or angle encoding).

[0063] Specifically, in one embodiment, the encoding process of the first sample data and the second sample data to obtain the third sample data includes:

[0064] The first sample data and the second sample data are concatenated to obtain the fifth sample data.

[0065] Based on amplitude coding technology, the fifth sample data is encoded to obtain the third sample data. The value of N is determined based on the dimension of the fifth sample data.

[0066] The fifth sample data can be understood as sample data obtained after concatenation, and the dimension of the fifth sample data can be determined based on the dimension of the first sample data and the dimension of the second sample data. For example, assume that the first sample data contains user... u The corresponding latent semantic vector size is 8*1, and the items in the second sample data i The corresponding latent semantic vector has a size of 8*1, so the size of the latent semantic vector after concatenation in the fifth sample data is 16*1, that is, the dimension of the latent semantic vector after concatenation is 16.

[0067] In practical applications, for the fifth sample data, the electronic device can use amplitude coding technology to sequentially encode the concatenated latent semantic vector into N quantum bit states, thereby obtaining the third sample data; wherein, when the dimension of the concatenated latent semantic vector is Q, the value of N can be expressed as: Furthermore, the quantum states of N qubits It can be represented as: , Let x be a set of computational bases in the Hilbert space, and let x be the latent semantic vector after concatenation.

[0068] It should be noted that before amplitude encoding the concatenated latent semantic vector, since the concatenated latent semantic vector constitutes the amplitude of a quantum state, the electronic device can first normalize the concatenated latent semantic vector to ensure that it satisfies the normalization condition; wherein the normalization condition can be: .

[0069] For example, suppose x is represented as The electronic device can encode a 2-bit quantum state based on amplitude coding technology. (Right now ).

[0070] In practical applications, when the first quantum model is constructed through the quantum circuit, the electronic device can evolve the third sample data through the quantum circuit. In this way, the computational advantages of quantum computing in high-dimensional feature spaces can be effectively utilized for data mining.

[0071] Here, the electronic device needs to construct the quantum circuit before evolving the third sample data.

[0072] Based on this, in one embodiment, before inputting the third sample data into the quantum circuit to obtain the fourth sample data, the method may further include:

[0073] The number of qubits is determined using the third sample data;

[0074] The quantum circuit is constructed using the number of qubits and the types of logic gates, wherein the types of logic gates include at least rotation gates and controlled NOT gates.

[0075] The logic gates may include rotating gates, controlled NOT gates, etc. The rotating gates are used for the rotation of qubits, and the controlled NOT gates are used to realize quantum entanglement between users and objects. This application does not limit the specific types of logic gates.

[0076] In practical applications, the electronic device can determine the number of qubits, i.e., the value of N, using the third sample data; then, it can construct the quantum circuit using the number of qubits and the preset type of logic gate.

[0077] For example, suppose the number of qubits is 4, such as Figure 3 As shown, the electronic device can construct the quantum circuit; wherein, RZ can be understood as a rotating gate, capable of rotating the qubit along the Z-axis. Angle, RZ, can be expressed as: RY can be understood as a rotating gate that can rotate qubits along the Y-axis. Angle, RY, can be represented as: CX can be understood as a control NOT gate, and CX can be represented as: .

[0078] In practical applications, after constructing the quantum circuit, the electronic device can input the third sample data into the quantum circuit for data evolution. During the evolution process, due to quantum entanglement and quantum superposition, the electronic device can obtain the fourth sample data output by the quantum circuit. The fourth sample data can be understood as the evolved quantum output data (also called quantum output state) in the quantum feature space, which can reflect the data pattern between the user and the object. The dimension of the fourth sample data is the same as the dimension of the third sample data.

[0079] For example, for users u Latent semantic vectors and items iThe latent semantic vector, the electronic device obtains an N-bit quantum state (which can be represented as) based on amplitude coding technology. After that, through the quantum circuit (which can be represented as) Evolution of the quantum state of N bits yields the user's... u and items i Non-linear interaction relationships between users; among them, users u and items i Nonlinear interaction relationship between It can be determined using the following formula:

[0080] (3)

[0081] In practical applications, the electronic device can convert the fourth sample data into a predicted preference level between the user and the item, so as to use the converted predicted preference level to iterate the parameters of the quantum circuit.

[0082] Specifically, in one embodiment, adjusting the parameters of the quantum circuit using the fourth sample data includes:

[0083] The fourth sample data is sequentially measured and post-processed to obtain the sixth sample data, which represents the predicted preference of the one or more users for the one or more items.

[0084] Using the sixth and seventh sample data, the parameters of the quantum circuit are adjusted, wherein the seventh sample data characterizes the true degree of preference of the one or more users for the one or more items.

[0085] The sixth sample data can be understood as the quantum circuit's prediction of the degree of preference between users and items, such as the user's predicted rating of the item (or the predicted probability). If the user's predicted rating of the item is greater than or equal to a preset threshold, it indicates that the user's predicted preference for the item is higher; if the user's predicted rating of the item is less than the preset threshold, it indicates that the user's predicted preference for the item is lower.

[0086] In practical applications, during the measurement and processing, the electronic device can measure Pauli... Z The expected value of the operator for any qubit in the N qubits. Since entanglement is established among the N qubits in the quantum circuit, the electronic device can obtain the overall measurement result by measuring one qubit. The measurement result can be in the range [-1, 1]; the measurement result can be determined by the following formula:

[0087] (4)

[0088] in, For Pauli Z Operator, It can be represented as: ; It is the identity matrix. It can be represented as .

[0089] In practical applications, after obtaining the measurement results, the electronic device can post-process the measurement results to map the range of the measurement results to [0, 1], thereby obtaining the sixth sample data; wherein, the sixth sample data can be obtained by the following formula:

[0090] (5)

[0091] in, This is represented as the sixth sample data. The value is .

[0092] Here, in order to train the first quantum model, the electronic device can construct a loss function based on the sixth sample data (which can also be understood as the predicted label) and the seventh sample data (which can also be understood as the true label), so as to iteratively optimize the parameters of the quantum circuit based on the loss function; wherein, the loss function can be expressed as:

[0093] (6)

[0094] in, This represents users with known true preference levels in the seventh sample data. u and items i A set of pairs; This is represented as the seventh sample data.

[0095] Understandably, during the iteration process, the electronic device can use formula (6) to calculate the squared difference loss value corresponding to the loss function based on the difference between the sixth and seventh sample data. Then, based on gradient optimization technology, the electronic device can adjust the parameters of the quantum circuit and the first and second sample data to minimize the loss function. In this way, the first quantum model can be trained, enabling the first quantum model to fully learn the nonlinear interaction pattern between the user and the object.

[0096] In addition, by introducing gradient optimization technology, the parameters of the quantum circuit can be dynamically adjusted, providing a more flexible model tuning capability. In this way, the first quantum model can be compatible with other models based on machine learning technology, enabling the first quantum model to better adapt to different recommendation scenarios and have wider applicability and scalability.

[0097] This application also provides an item recommendation method, applied to electronic devices, such as... Figure 4 As shown, it includes the following steps:

[0098] Step 401: Obtain first data, which contains multiple candidate items associated with the user to be recommended;

[0099] Step 402: Using the first data and the first quantum model, recommend one or more items to the user to be recommended, wherein the first quantum model is obtained according to the model training method provided in the embodiments of this application.

[0100] In practical applications, the electronic device may also include a device capable of performing steps 401 to 402.

[0101] In practical applications, the electronic device can obtain the first data from the network or receive the first data manually input. This application embodiment does not limit the method of obtaining the first data.

[0102] Here, the electronic device inputs the first data into the first quantum model, enabling the first quantum model to predict the user's preference for the plurality of candidate items; then, the electronic device can sort the plurality of candidate items from high to low based on the preference level, and select one or more items from the plurality of candidate items (the number of items can be set as needed, and this application embodiment does not limit this) to recommend items to the user.

[0103] For example, for users to be recommended u 1. If the first data contains 5 candidate items, they are respectively represented as: i 1, i 2, i 3, i 4 and i 5. Then, the electronic device can obtain the user's data by inputting the first data into the first quantum model. u 1. Assess the preference level for each of the five items; then, based on the preference level, select three items from the five items and recommend them to the user to be recommended.

[0104] The model training and item recommendation method provided in this application includes the following steps: First, acquiring first sample data and second sample data. The first sample data represents the preference level of one or more users for latent features, and the second sample data represents the correlation between one or more items and the latent features. The latent features include classification features related to user behavior. Second, training a first quantum model using the first and second sample data. The first quantum model is capable of capturing at least the nonlinear interaction relationship between users and items. The first quantum model is used to recommend items to users. The technical solution provided in this application, through the data mining capabilities of the quantum model, captures the complex interaction relationship between users and items, enabling the quantum model to better learn the deep-level interaction patterns between user preferences and item associations. This effectively improves the accuracy of item recommendation using the quantum model.

[0105] The following section provides a more detailed description of this application with reference to application examples.

[0106] In the application examples of this application, a personalized recommendation scheme based on quantum neural networks is proposed. Specifically, during the training process, deep interaction patterns between users and items are mined based on quantum neural networks to provide better recommendations for users in subsequent reasoning processes.

[0107] Specifically, such as Figure 5 As shown, the training process based on a quantum neural network includes the following steps:

[0108] Step 501: Collect historical interaction information of users and items, and generate user and item rating matrix (i.e., the seventh sample data mentioned above).

[0109] Step 502: Initialize the user latent semantic matrix (i.e., the first sample data mentioned above), the item latent semantic matrix (i.e., the second sample data mentioned above), and the parameterized quantum circuit (i.e., the quantum circuit mentioned above) parameters;

[0110] Among them, quantum neural networks are implemented through parameterized quantum circuits.

[0111] Step 503: Map user and item indices to the corresponding latent semantic matrices to decompose and obtain latent semantic vectors for users and items;

[0112] Here, with a user latent semantic matrix of size k*m, one-hot encoding is performed on m users to represent the user... u Mapping onto the user latent semantic matrix yields the user u The latent semantic vectors; given an item latent semantic matrix of size k*n, one-hot encoding is performed on n items to represent the items. iMapping onto the latent semantic matrix of items yields the items. i The implicit semantic vector.

[0113] Step 504: Concatenate the latent semantic vectors of users and items (i.e., the fifth sample data mentioned above), and use amplitude encoding to generate the quantum initial state (i.e., the third sample data mentioned above).

[0114] Step 505: Evolve the initial quantum state through parameterized quantum circuits to obtain the quantum output state (i.e., the fourth sample data mentioned above).

[0115] Step 506: Measure the quantum output state and obtain the prediction result (i.e., the sixth sample data mentioned above) after post-processing.

[0116] Step 507: Construct a loss function based on the prediction results and the true labels, and optimize it using gradient descent.

[0117] It is understandable that, such as Figure 6 As shown, during the training process, after constructing user latent semantic vectors and item latent semantic vectors based on user and item rating matrices in the embedding layer, the user latent semantic vectors and item latent semantic vectors are input into the parameterized quantum circuit in the quantum neural network after amplitude encoding. This allows the parameterized quantum circuit to capture the data patterns between the two vectors based on the superposition and entanglement properties in quantum mechanics, thereby uncovering the deep-level interaction relationship between users and items.

[0118] Step 508: Save the trained quantum model (i.e., the first quantum model mentioned above).

[0119] Among them, the quantum model includes a model based on quantum neural networks, which is used to make personalized item recommendations to users.

[0120] Specifically, such as Figure 7 As shown, the reasoning process based on quantum neural networks includes the following steps:

[0121] Step 701: Enter the list of users and items (i.e., the first data mentioned above);

[0122] The user and item list includes users u 1 corresponds to multiple candidate item identifiers (such as identification codes (IDs)), for example, i 1. i 2nd grade.

[0123] Step 702: Predict user preference for items using a quantum model;

[0124] Step 703: Sort the items in the item list from largest to smallest according to preference;

[0125] Step 704: Select the first P items to recommend to the user, where P is an integer greater than or equal to 1, and the value of P can be set as needed.

[0126] In the application example of this application, firstly, by using quantum neural network technology, the implicit semantic features of users and items are encoded into quantum circuits, which can effectively capture and utilize the nonlinear interaction information between the implicit semantic features of users and items, thereby significantly improving the quantum model's understanding of complex user preferences and item associations, and thus improving the accuracy of item recommendation using the quantum model.

[0127] Secondly, by combining quantum neural networks and matrix factorization, the ability to process sparse data is optimized, thereby enhancing the robustness of the quantum model, expanding its application scope, and enabling the quantum model to better adapt to diverse recommendation scenarios, such as e-commerce, social media, and content recommendation.

[0128] Third, by introducing gradient optimization techniques, the parameters of parameterized quantum circuits can be dynamically adjusted, providing more flexible model tuning capabilities. This ensures that quantum models can be seamlessly integrated with other machine learning-based models, providing broader applicability and scalability.

[0129] To implement the model training method of this application embodiment, this application embodiment also provides a model training device, which is installed on an electronic device, such as... Figure 8 As shown, the device includes:

[0130] The first acquisition unit 801 is used to acquire first sample data and second sample data. The first sample data represents the degree of preference of one or more users for implicit features, and the second sample data represents the degree of association between one or more items and the implicit features. The implicit features include classification features associated with user behavior.

[0131] Training unit 802 is used to train a first quantum model using the first sample data and the second sample data. The first quantum model is at least able to capture the nonlinear interaction relationship between users and items. The first quantum model is used to recommend items to users to be recommended.

[0132] In one embodiment, the first quantum model includes a quantum circuit, and the training unit 802 is used to encode the first sample data and the second sample data to obtain third sample data, the third sample data containing a quantum state of N qubits, where N is an integer greater than or equal to 1; inputting the third sample data into the quantum circuit to obtain fourth sample data, the fourth sample data representing the nonlinear interaction relationship between the one or more users and the one or more items; and using the fourth sample data to adjust the parameters of the quantum circuit so that the loss function of the quantum circuit converges.

[0133] In one embodiment, the training unit 802 is used to concatenate the first sample data and the second sample data to obtain the fifth sample data; and to encode the fifth sample data based on amplitude coding technology to obtain the third sample data, wherein the value of N is determined based on the dimension of the fifth sample data.

[0134] In one embodiment, the training unit 802 is used to sequentially perform measurement processing and post-processing on the fourth sample data to obtain sixth sample data, the sixth sample data representing the predicted preference degree of the one or more users for the one or more items; using the sixth sample data and the seventh sample data, the parameters of the quantum circuit are adjusted, the seventh sample data representing the actual preference degree of the one or more users for the one or more items.

[0135] In one embodiment, before inputting the third sample data into the quantum circuit to obtain the fourth sample data, the training unit 802 is further configured to use the third sample data to determine the number of qubits; and to construct the quantum circuit using the number of qubits and the type of logic gates, wherein the type of logic gates includes at least rotation gates and controlled NOT gates.

[0136] In one embodiment, the first acquisition unit 801 is used to acquire seventh sample data, which represents the true preference of the one or more users for the one or more items; and to perform matrix decomposition processing on the seventh sample data to obtain the first sample data and the second sample data respectively.

[0137] In practical applications, the first acquisition unit 801 can be implemented by a communication interface in the model training device combined with a processor, and the training unit 802 can be implemented by a processor in the model training device.

[0138] It should be noted that the model training device provided in the above embodiments is only illustrated by the division of the above-described program units during model training. In practical applications, the above processing can be assigned to different program units as needed, that is, the internal structure of the device can be divided into different program units to complete all or part of the processing described above. In addition, the model training device and the model training method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0139] To implement the item recommendation method of this application embodiment, this application embodiment also provides an item recommendation device, which is installed on an electronic device, such as... Figure 9 As shown, the device includes:

[0140] The second acquisition unit 901 is used to acquire first data, the first data containing multiple candidate items associated with the user to be recommended;

[0141] The recommendation unit 902 is used to recommend one or more items to the user to be recommended using the first data and the first quantum model, wherein the first quantum model is obtained based on the model training method provided in the embodiments of this application.

[0142] In practical applications, the second acquisition unit 901 can be implemented by the communication interface in the item recommendation device; the recommendation unit 902 can be implemented by the processor in the item recommendation device.

[0143] It should be noted that the item recommendation device provided in the above embodiments is only illustrated by the division of the above-described program units. In practical applications, the above processing can be assigned to different program units as needed, that is, the internal structure of the device can be divided into different program units to complete all or part of the processing described above. In addition, the item recommendation device and the item recommendation method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0144] Based on the hardware implementation of the above program modules, and in order to implement the model training and item recommendation methods of the embodiments of this application, the embodiments of this application also provide an electronic device, such as... Figure 10 As shown, the electronic device 1000 includes:

[0145] Communication interface 1001 enables interaction with other devices;

[0146] The processor 1002 is connected to the communication interface 1001 to enable interaction with other devices and to execute the methods provided by one or more of the above-mentioned technical solutions when running a computer program;

[0147] The computer program is stored in memory 1003.

[0148] Specifically, in the model training method provided in this application embodiment, the processor 1002 is used to acquire first sample data and second sample data through the communication interface 1001. The first sample data represents the degree of preference of one or more users for latent features, and the second sample data represents the degree of association between one or more items and the latent features. The latent features include classification features associated with user behavior. The first quantum model is trained using the first sample data and the second sample data. The first quantum model is at least able to capture the nonlinear interaction relationship between users and items. The first quantum model is used to recommend items to users to be recommended.

[0149] In one embodiment, the first quantum model includes a quantum circuit, and the processor 1002 is configured to encode the first sample data and the second sample data to obtain third sample data, the third sample data containing a quantum state of N qubits, where N is an integer greater than or equal to 1; input the third sample data into the quantum circuit to obtain fourth sample data, the fourth sample data representing the nonlinear interaction relationship between the one or more users and the one or more items; and use the fourth sample data to adjust the parameters of the quantum circuit so that the loss function of the quantum circuit converges.

[0150] In one embodiment, the processor 1002 is configured to concatenate the first sample data and the second sample data to obtain the fifth sample data; and to encode the fifth sample data based on amplitude coding technology to obtain the third sample data, wherein the value of N is determined based on the dimension of the fifth sample data.

[0151] In one embodiment, the processor 1002 is configured to sequentially perform measurement processing and post-processing on the fourth sample data to obtain sixth sample data, the sixth sample data representing the predicted preference degree of the one or more users for the one or more items; and to adjust the parameters of the quantum circuit using the sixth sample data and the seventh sample data, the seventh sample data representing the actual preference degree of the one or more users for the one or more items.

[0152] In one embodiment, before inputting the third sample data into the quantum circuit to obtain the fourth sample data, the processor 1002 is further configured to use the third sample data to determine the number of qubits; and to construct the quantum circuit using the number of qubits and the type of logic gates, wherein the type of logic gates includes at least rotation gates and controlled NOT gates.

[0153] In one embodiment, the processor 1002 is further configured to acquire seventh sample data through the communication interface 1001, the seventh sample data representing the true preference of the one or more users for the one or more items; and to perform matrix decomposition processing on the seventh sample data to obtain the first sample data and the second sample data respectively.

[0154] In the item recommendation method provided in this application embodiment, the processor 1002 is used to obtain first data through the communication interface, the first data containing multiple candidate items associated with the user to be recommended; using the first data and a first quantum model, one or more items are recommended to the user to be recommended, the first quantum model being obtained based on the model training method provided in this application embodiment.

[0155] It should be noted that the specific processing procedures of the communication interface 1001 and the processor 1002 can be understood with reference to the above method.

[0156] Of course, in practical applications, the various components in electronic device 1000 are coupled together through bus system 1004. It can be understood that bus system 1004 is used to realize the connection and communication between these components. In addition to a data bus, bus system 1004 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 10 The general labeled all buses as Bus System 1004.

[0157] The memory 1003 in this embodiment is used to store various types of data to support the operation of the electronic device 1000. Examples of such data include any computer program used to operate on the electronic device 1000.

[0158] The methods disclosed in the embodiments of this application can be applied to the processor 1002, or implemented by the processor 1002. The processor 1002 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 1002 or by instructions in the form of software. The processor 1002 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 1002 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in the memory 1003. The processor 1002 reads the information in the memory 1003 and completes the steps of the aforementioned method in combination with its hardware.

[0159] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0160] It is understood that the memory (memory 1003) in the embodiments of this application can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.

[0161] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 1003 storing a computer program. This computer program can be executed by the processor 1002 of the electronic device 1000 to complete the steps of the aforementioned model training method or the steps of the aforementioned item recommendation method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0162] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by the processor 1002 of an electronic device 1000 to complete the steps of the aforementioned model training method or the steps of the aforementioned item recommendation method.

[0163] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0164] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0165] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.

Claims

1. A model training method, characterized in that, The method includes: Acquire first sample data and second sample data, wherein the first sample data represents the degree of preference of one or more users for latent features, and the second sample data represents the degree of association between one or more items and the latent features, wherein the latent features include classification features associated with user behavior; Using the first sample data and the second sample data, a first quantum model is trained. This first quantum model is capable of capturing at least the non-linear interaction between users and items. The first quantum model is used to recommend items to the user to be recommended. The acquisition of the first sample data and the second sample data includes: Obtain a seventh sample data point, which represents the true degree of preference of the one or more users for the one or more items; The seventh sample data is subjected to matrix decomposition to obtain the first sample data and the second sample data; The first quantum model includes quantum circuitry, and the step of training the first quantum model using the first sample data and the second sample data includes: The first sample data and the second sample data are encoded to obtain the third sample data, which contains a quantum state of N qubits, where N is an integer greater than or equal to 1. The third sample data is input into the quantum circuit to obtain the fourth sample data, which represents the nonlinear interaction relationship between the one or more users and the one or more items. Using the fourth sample data, the parameters of the quantum circuit are adjusted so that the loss function of the quantum circuit converges.

2. The method according to claim 1, characterized in that, The encoding process of the first sample data and the second sample data to obtain the third sample data includes: The first sample data and the second sample data are concatenated to obtain the fifth sample data. Based on amplitude coding technology, the fifth sample data is encoded to obtain the third sample data. The value of N is determined based on the dimension of the fifth sample data.

3. The method according to claim 1, characterized in that, The step of adjusting the parameters of the quantum circuit using the fourth sample data includes: The fourth sample data is sequentially measured and post-processed to obtain the sixth sample data, which represents the predicted preference of the one or more users for the one or more items. Using the sixth and seventh sample data, the parameters of the quantum circuit are adjusted, wherein the seventh sample data characterizes the true degree of preference of the one or more users for the one or more items.

4. The method according to claim 1, characterized in that, Before inputting the third sample data into the quantum circuit to obtain the fourth sample data, the method further includes: The number of qubits is determined using the third sample data; The quantum circuit is constructed using the number of qubits and the types of logic gates, wherein the types of logic gates include at least rotation gates and controlled NOT gates.

5. A method for recommending items, characterized in that, The method includes: Obtain first data, which contains multiple candidate items associated with the user to be recommended; Using the first data and the first quantum model, one or more items are recommended to the user to be recommended, wherein the first quantum model is obtained by the method according to any one of claims 1 to 4.

6. A model training device, characterized in that, The device includes: The first acquisition unit is used to acquire first sample data and second sample data. The first sample data represents the degree of preference of one or more users for implicit features, and the second sample data represents the degree of association between one or more items and the implicit features. The implicit features include classification features associated with user behavior. A training unit is used to train a first quantum model using the first sample data and the second sample data. The first quantum model is capable of capturing at least the non-linear interaction relationship between users and items. The first quantum model is used to recommend items to the user to be recommended. The first acquisition unit is configured to acquire seventh sample data, which represents the true preference of the one or more users for the one or more items; and to perform matrix decomposition processing on the seventh sample data to obtain the first sample data and the second sample data respectively. The first quantum model includes a quantum circuit. The training unit is used to encode the first sample data and the second sample data to obtain third sample data, which contains a quantum state of N qubits, where N is an integer greater than or equal to 1. The third sample data is input into the quantum circuit to obtain fourth sample data, which represents the nonlinear interaction relationship between the one or more users and the one or more items. The parameters of the quantum circuit are adjusted using the fourth sample data to make the loss function of the quantum circuit converge.

7. An item recommendation device, characterized in that, The device includes: The second acquisition unit is used to acquire first data, which includes multiple candidate items associated with the user to be recommended; A recommendation unit is configured to recommend one or more items to the user to be recommended using the first data and the first quantum model, wherein the first quantum model is obtained by the method according to any one of claims 1 to 4.

8. An electronic device, characterized in that, include: The processor and the memory used to store computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 4, or implements the steps of the method according to claim 5.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4, or the steps of the method according to claim 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4, or the steps of the method according to claim 5.

Citation Information

Patent Citations

  • Quantum recommendation method, device and system based on parallel quantum intrinsic solver

    CN113988303A

  • Article recommendation model training method and device, electronic equipment and storage medium

    CN115841366A