Commodity recommendation method and system based on graph neural network and large language model

By adopting product recommendation methods based on graph neural network and large language model on e-commerce platforms, the confidence relationship of user social networks is constructed and graph neural network encoding is carried out, which solves the problem of lack of social network relationships among users and achieves more accurate and efficient product recommendations.

CN119741087APending Publication Date: 2025-04-01MOUTAI INST +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411825143.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

On e-commerce platforms, the lack of social network relationship data between users leads to incomplete user profiles and making it difficult to achieve accurate and efficient product recommendations.

Method used

The product recommendation method based on graph neural network and large language model is adopted. By constructing the confidence relationship of the user's social network, the large language model is used to predict the user's social network, generating pseudo-data and fusing the original training data, and using graph neural network for final encoding and recommendation.

Benefits of technology

Overcoming the limitations of user portraits lacking social network relationships, achieving more accurate and efficient product recommendations, and improving user experience and platform competitiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741087A_ABST
    Figure CN119741087A_ABST
Patent Text Reader

Abstract

The invention discloses a commodity recommendation method and system based on a graph neural network and a large language model. The method comprises the following steps: constructing a fine-tuning training data set to perform fine-tuning training on the large language model; obtaining a historical interaction data set of the user and the article, dividing the historical interaction data set into a training set and a test set, and inputting the training set into the fine-tuned large language model to obtain a confidence relationship of the user social network; combining the cleaned confidence relationship with the original training set to obtain combined data; constructing a generalization matrix based on the merged data; user and commodity embedding vectors are trained based on the enhanced generalization matrix, representation aggregation is carried out through a graph neural network, and back propagation is carried out on an obtained result to update parameters; and calculating the cosine similarity to obtain interaction scores of the user and different commodities, and recommending the commodities to the user according to the scores. The problem that the user portrait lacks social network relation support can be solved, and a better recommendation effect is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of product recommendation technology, specifically to a product recommendation method and system based on graph neural networks and large language models. Background Technology

[0002] With the rapid development of computer technology and the internet, massive amounts of data are generated online every day, especially text-based data, exhibiting significant big data characteristics. Simultaneously, advancements in artificial intelligence have spurred the booming development of content generation, making data creation more efficient and rapid. This has exacerbated information overload for users, making it increasingly difficult to obtain high-quality, valuable information. Therefore, accurately and quickly identifying content that truly interests each user from massive amounts of data has become a crucial driving force for the research and development of recommender systems.

[0003] Recommendation systems provide personalized recommendations based on user behavior data and product information. By analyzing users' historical behavioral data and product characteristics, and using advanced algorithmic models, they delve into users' interests and consumption preferences to predict products they might like and recommend them to them. This technology not only improves the efficiency of information retrieval for users but also greatly enhances the user experience.

[0004] However, the relationship structure between users differs significantly in e-commerce recommendation scenarios compared to traditional social network scenarios. In social networks, user connections are often very close. Through interactions such as following, liking, commenting, and sharing, users form complex and rich relationship graphs. This social interaction allows platforms to more accurately understand users' interests and social circles, thus enabling personalized recommendations. But the situation is quite different on e-commerce platforms. Due to the inherent privacy of shopping, most users primarily browse and purchase products, rarely actively communicating or interacting with other users. Even when interactions occur, such as product reviews and Q&A, they are often anonymous or limited to the product itself, rather than involving social interaction between users. This lack of direct contact and interaction leads to data centralization in e-commerce scenarios, severely lacking social network relationships between users.

[0005] This lack of user relationship data poses a significant challenge to building complete user profiles. In social networks, analyzing user interactions can uncover social circles, shared interests, and community attributes, enriching the dimensions of user profiles. However, in e-commerce scenarios, recommendation systems rely solely on one-dimensional data such as purchase history, browsing behavior, and search keywords, making it difficult to extract more diverse information. This single-dimensional data results in incomplete user profiles, lacking the support of social network relationships. This leads to greater uncertainty in understanding potential user interests, predicting user needs, and making personalized recommendations. Therefore, there is an urgent need for a technology that can overcome the lack of social network relationship support in user profiles, thereby achieving accurate and efficient product recommendation. Summary of the Invention

[0006] To overcome the shortcomings and deficiencies of existing technologies, this invention provides a product recommendation method and system based on graph neural networks and large language models. This invention can overcome the problem of user profiles lacking social network relationship support, thereby achieving better recommendation results.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] This invention provides a product recommendation method based on graph neural networks and large language models, comprising the following steps:

[0009] Construct a fine-tuning training dataset, fine-tune the large language model, and obtain the fine-tuned large language model.

[0010] Obtain the historical interaction dataset between users and items, and divide the dataset into training and test sets. Input the training set into the fine-tuned large language model to obtain the confidence relationship of the user's social network.

[0011] The confidence relationships of users' social networks are cleaned to obtain cleaned confidence relationships. The cleaned confidence relationships are then merged with the original training set to obtain merged data.

[0012] Construct a generalized matrix based on merged data;

[0013] User and product embedding vectors are trained based on the enhanced generalization matrix, and the representations are aggregated through a graph neural network. The results are then backpropagated to update the parameters.

[0014] The interaction ratings between users and different products are obtained by calculating cosine similarity, and products are recommended to users according to the rating.

[0015] As a preferred technical solution, the construction of the fine-tuning training dataset includes each data point in the fine-tuning training dataset, which includes task instructions, task inputs, and task outputs.

[0016] The task input consists of content data, interaction data, and user social relationships. The content data is some of the user's attributes, the interaction data is the user's historical interaction data with products, and the user social relationships are the interaction relationships between users.

[0017] As a preferred technical solution, the fine-tuning training of the large language model is specifically carried out by fine-tuning the large language model through the inverse Fourier transform of the frequency domain parameter matrix;

[0018] Let P be the original parameters of the large language model. O The frequency domain parameter matrix after training is P. l The original parameter P O The parameters are combined with the inverse Fourier transform of the Fourier Fourier transform of the frequency domain parameter matrix. The overall parameters of the large language model after merging are P. u , represented as:

[0019] P u =P o +IDFT(P l )

[0020] Wherein, IDFT is the inverse Fourier transform;

[0021] The optimization objective of fine-tuning the training is:

[0022]

[0023] Where x represents the given task, y t y represents the output of a large language model. <t Indicates the output y t The previous output content, Z represents the content of all input corpora.

[0024] As a preferred technical solution, the step of inputting the training set into the fine-tuned large language model to obtain the confidence relationship of the user's social network is specifically expressed as follows:

[0025] v i,j =L t (F i F j Prompt)

[0026] T i,j =v i,j

[0027] Among them, L t For the parameters of the large language model, F i For the original characteristics of user i, F j For the original characteristics of user j, v i,jT represents the probability that there is a relationship between user i and user j. i,j Let T represent the value of the element in the i-th row and j-th column of T, and Prompt represents the large language model hint.

[0028] As a preferred technical solution, a generalized matrix is ​​constructed based on the merged data, specifically including:

[0029] Based on the merged data, obtain the interaction matrix R. If user i and product j have an interaction record in the merged data, set the element in the i-th row and j-th column of the interaction matrix R to 1, and obtain the adjacency matrix as follows:

[0030]

[0031] Where S represents the confidence relationship after cleaning;

[0032] The generalization matrix is ​​constructed as follows:

[0033]

[0034] Where D is the degree matrix of A, This represents the generalization matrix.

[0035] As a preferred technical solution, user and product embedding vectors are trained based on an enhanced generalization matrix, representation aggregation is performed through a graph neural network, and the results are backpropagated to update parameters, specifically including:

[0036] During the process of acquiring interaction records, the embedding vectors of N user nodes and M product nodes are constructed into the input graph neural network, represented as follows:

[0037] E = {u1, u2, ..., u} N i1, i2, ..., i M}

[0038] in, O is the embedding vector dimension for each node, u x Let i be the embedding vector of user x. y Let be the embedding vector of product y, and E be the embedding vector matrix;

[0039] Information aggregation of nodes based on the generalization matrix is ​​represented as follows:

[0040]

[0041] in, Represents the generalization matrix;

[0042] The final embedding vector extracted by the multilayer perceptron is:

[0043] E″=MLP(E′)

[0044] Where E″ represents the final embedding vector and MLP represents a multilayer perceptron.

[0045] As a preferred technical solution, the interaction rating between users and different products is obtained by calculating cosine similarity. The calculation of cosine similarity is specifically expressed as follows:

[0046]

[0047] Where A represents the user embedding vector, B represents the product embedding vector, and A i B represents the i-th dimension of the user embedding vector in the final embedding vector E″, where n represents the dimension of the embedding vector. i Let represent the i-th dimension of the product embedding vector in the final embedding vector E″.

[0048] As a preferred technical solution, the obtained results are backpropagated to update the parameters. Specifically, the Bayesian personalized loss function is used as the recommendation task loss function to backpropagate and update the embedding vector.

[0049] This invention also provides a product recommendation system based on graph neural networks and a large language model, comprising: a fine-tuning training dataset construction module, a large language model fine-tuning training module, a historical interaction dataset acquisition module, a dataset partitioning module, a confidence relation output module, a confidence relation cleaning module, a data merging module, a generalization matrix construction module, an embedding vector training module, an interaction rating calculation module, and a product recommendation result output module;

[0050] The fine-tuning training dataset construction module is used to construct the fine-tuning training dataset;

[0051] The large language model fine-tuning training module is used to fine-tune the large language model to obtain the fine-tuned large language model.

[0052] The historical interaction dataset acquisition module is used to acquire the historical interaction dataset between users and items;

[0053] The dataset partitioning module is used to partition the historical interaction dataset into a training set and a test set.

[0054] The confidence relation output module is used to input the training set into the large language model to obtain the confidence relation of the user's social network;

[0055] The confidence relationship cleaning module is used to clean the confidence relationships of the user's social network to obtain cleaned confidence relationships.

[0056] The data merging module is used to merge the cleaned confidence relationships with the original training set to obtain merged data;

[0057] The generalization matrix construction module is used to construct a generalization matrix based on the merged data;

[0058] The embedding vector training module is used to train user and product embedding vectors based on the enhanced generalization matrix, aggregate the representations through a graph neural network, and backpropagate the results to update the parameters.

[0059] The interaction rating calculation module is used to obtain the interaction rating between the user and different products by calculating the cosine similarity.

[0060] The product recommendation result output module is used to recommend products to users based on their ratings.

[0061] The present invention also provides a computer device, including a processor and a memory for storing processor-executable programs, wherein when the processor executes the program stored in the memory, it implements the above-described product recommendation method based on graph neural networks and large language models.

[0062] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0063] (1) Existing technologies are dedicated to encoding feature information such as user attributes and product attributes through large language models. Essentially, this involves the large language model directly intervening in the synthesis of the final representation. However, this invention uses a large language model to predict the social network relationships of users, producing only pseudo data rather than representations. Ultimately, the data produced by this large language model is fused with the original training data, and then a graph neural network suitable for processing graph data is used for the final encoding, rather than allowing the large model to directly intervene in the final encoding. By introducing a graph neural network model, this invention solves the limitations of traditional product recommendation methods, thereby achieving more accurate and efficient product recommendations, improving user experience and platform competitiveness.

[0064] (2) This invention solves the limitation of the lack of user social network relationship graph in traditional product recommendation methods by introducing a large language model, so as to achieve a more accurate user profile and bring users a more comprehensive and in-depth product recommendation experience.

[0065] (3) This invention uses FourierFT to fine-tune the large language model. Compared with the traditional LoRA fine-tuning, it achieves a similar or even better effect to LoRA fine-tuning while significantly reducing the number of fine-tuning training parameters, thus combining training speed and performance. Attached Figure Description

[0066] Figure 1 This is a flowchart illustrating the product recommendation method based on graph neural networks and large language models of the present invention.

[0067] Figure 2This is a flowchart illustrating the fine-tuning training process of the large language model of this invention;

[0068] Figure 3 This is a schematic diagram of the graph neural network architecture of the present invention;

[0069] Figure 4 This is a schematic diagram of the implementation architecture of the multilayer perceptron of the present invention. Detailed Implementation

[0070] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0071] Example 1

[0072] like Figure 1 As shown, this embodiment provides a product recommendation method based on graph neural networks and large language models, including the following steps:

[0073] S1: Construct a fine-tuning training dataset, fine-tune the large language model, and obtain the fine-tuned large language model;

[0074] In this embodiment, each piece of data in the fine-tuning training dataset includes a task instruction, a task input, and a task output. The task instruction describes the specific task that the large language model needs to complete in natural language form. The task input provides relevant information that the large language model can process, while the task output is the expected output information that the large language model needs to fit. When generating the output, the large language model needs to be as close as possible to the given task output in terms of format and content to facilitate subsequent processing and application. By effectively combining these components, a high-quality fine-tuning training dataset is constructed, thereby improving the performance and adaptability of the large language model on specific tasks.

[0075] Specifically, the task input consists of content data, interaction data, and a small amount of user social relationships. Content data includes some user attributes such as age and gender, while interaction data refers to the user's historical interaction data with products. User social relationships represent the interaction relationships between users. For example, user A has purchased products 1, 3, and 5, and user B has purchased products 2, 4, and 6. User A and user B have an interaction relationship. This information allows the large language model to recognize what kind of user historical behavior will generate interaction relationships between users. This data inspires the large model to determine whether there are interaction relationships between other users when providing them with their historical behavior data, thus obtaining a user social network to make up for the lack of this part of the data on the e-commerce platform.

[0076] In this embodiment, the large language model can be either a paid model or an open-source model. Paid models can be trained via API calls, such as OpenAI's ChatGPT model and Anthropic's Claude model. In contrast, open-source models can be deployed and inferred locally, significantly reducing overhead. This embodiment selects Alibaba Cloud's open-source Qwen2.5-7B model as the original pre-trained model and labels it L. O This choice aims to fully leverage the advantages of open-source models, combined with the need for fine-tuning large language models, to achieve efficient and economical model training and application.

[0077] like Figure 2 As shown, a training method using a frequency domain parameter matrix is ​​introduced to fine-tune the large language model. This fine-tuning process faces the challenge of some users having a large number of purchase records, i.e., extremely long historical sequences. To accelerate model fine-tuning, this embodiment introduces a training method using a frequency domain parameter matrix, specifically FourierFT (Parameter-Efficient Fine-Tuning with Discrete Fourier Transform), which performs an inverse Fourier transform of the frequency domain parameter matrix. This enables the large language model to activate its recommendation capabilities, understand the recommendation task, and standardize its output format. Based on a limited amount of existing user social network data, to inspire the relevant capabilities of the large language model, iterative training and optimization are continuously performed. In each iteration, the large language model evaluates and judges the quality of the input data through semi-supervised learning, selecting data that meets the set requirements for the next round of training, until the loss function value decreases to a pre-set threshold range. This ensures that the fine-tuned large language model reaches the ideal performance level, ultimately generating a target large language model capable of efficiently handling specific tasks.

[0078] In this embodiment, the inverse Fourier transform of the Fourier Fourier Transform (IFT) frequency domain parameter matrix treats the large language model parameters as Fourier transformable spatial domain parameters. Utilizing the differentiability of the IFT, it achieves the effect of approximating all originally trained parameters with fewer trained parameters. Compared to the classic LoRA low-rank matrix, it leverages the differentiability of the Fourier transform to perform large model fine-tuning with fewer frequency domain parameters. The Fourier transform converts a time-domain signal into a frequency-domain signal, revealing significant frequency-domain factors that greatly influence the function. Similarly, Fourier Fourier treats the large language model parameters as time-domain signals and uses the differentiability of the Fourier transform to adjust parameters with strong influence in the model. This process significantly reduces the number of time-domain parameters compared to its IFT approach. Simultaneously, it inversely transforms the parameters back to the time domain for parameter integration, completing the large language model fine-tuning training.

[0079] In this embodiment, the original parameters of the large language model are denoted as P. O The frequency domain parameter matrix after training is P. l The original parameter P O The parameters are merged with the inverse Fourier transform of the Fourier Fourier transform of the frequency domain parameter matrix. The overall parameter representation of the large language model after merging is P. u It can be expressed by the following formula:

[0080] P u =P o +IDFT(P l )

[0081] Wherein, IDFT is the inverse Fourier transform;

[0082] The overall task is to make the trained large language model L t The output y t To be able to perform the given task x and output y as much as possible t Previous output content y <t It can maximize the output of y t That is, to obtain the output y with the highest probability. t In this embodiment, the optimization objective of model fine-tuning training is as follows:

[0083]

[0084] Among them, P u This represents the overall parameters of the large language after merging, where x represents the given task, and y represents the parameters of the large language. t y represents the output of a large language model. <t Indicates the output y t The previous output content, Z represents the content of all input corpora.

[0085] S2: Obtain the historical interaction dataset between users and items, and divide the dataset into training set and test set. Input the training set into the fine-tuned large language model to obtain the model output, that is, obtain the confidence relationship T of the user's social network.

[0086] In this embodiment, 20% of the data is selected as the test set for evaluating model performance, while the remaining 80% is used to construct the training set. This division ensures a reasonable allocation between the training and test sets, thereby enabling effective evaluation of the generalization ability and practical application performance of the large language model during the training process.

[0087] In this embodiment, to supplement the user's social network relationships, the features are made as rich as possible when constructing the user embedding vector. Specifically, a prompt is designed based on the content information in the training set to obtain more features. Taking Taobao as an example, for a user, their original feature information includes gender, age, and historical interaction records, which are represented as F. By supplementing the user's social network relationship graph with the original features of different users, a large language model prompt is constructed as follows:

[0088] "Your task is to determine whether there is a correlation between two different users based on their original features. User i's original features are [original features], and user j's original features are [original features]. Please determine the correlation between them. The correlation value is in the range (0,1). The output format is [the desired output format]."

[0089] The content in brackets [] above is filled in based on user characteristics from different datasets. Then, the model output is obtained by querying and fine-tuning the large language model, which yields the confidence relationship T of the user's social network. This process can be represented by the following formula:

[0090] v i,j =L t (F i F j Prompt)

[0091] T i,j =v i,j .

[0092] Among them, L t For the parameters of the large language model, F i For user i's original characteristics (including historical interaction records), F j For user j's original characteristics (including historical interaction records), v i,j The probability that there is a connection between user i and user j can be represented by a probability value, T. i,j This represents the value of the element in the i-th row and j-th column of T.

[0093] S3: Clean the confidence relationships T of the user's social network to obtain the cleaned confidence relationships S. Merge the cleaned confidence relationships S with the original training set to obtain the merged data, thus completing the data augmentation of the training set. Specifically, this is represented as follows:

[0094] D u =Merge(f clean (T), D o )

[0095] Among them, D uThis indicates merging data; Merge represents the merge function; f clean D represents the cleaning and filtering function. O This represents the original training set.

[0096] In this embodiment, data with low confidence after prediction are deleted using methods such as numerical truncation. Specifically, 0.5 can be preferred as the confidence threshold, with data below 0.5 being regarded as 0 and data above 0.5 being retained as 1.

[0097] In this embodiment, the confidence score is output by the fine-tuned large language model to obtain the social network relationship graph between users, thereby enhancing the density of the user-item generalization matrix and the representation ability of the graph structure.

[0098] S4: Based on merged data D u Construct a generalization matrix using the confidence relationship S after cleaning, specifically including:

[0099] Based on merged data D u Obtain the interaction matrix, denoted as . Merged data D u If user i and product j have an interaction record, the element in the i-th row and j-th column of the interaction matrix R can be set to 1. Then, the adjacency matrix A can be obtained, as shown in the following formula:

[0100]

[0101] Its generalization matrix It can be calculated using the following formula:

[0102]

[0103] Where D is the degree matrix of A.

[0104] S5: As Figure 3 As shown, embedding vectors are trained based on an enhanced generalization matrix, and representation aggregation is performed using a graph neural network. The results are then backpropagated through a loss function to update parameters. Specifically, this includes:

[0105] During the process of acquiring interaction records, the embedding vectors of N user nodes and M product nodes are constructed into the input graph neural network, as follows:

[0106] E = {u1, u2, ..., u} N i1, i2, ..., i M},

[0107] in, O is the embedding vector dimension for each node, u x Let i be the embedding vector of user x. y Let y be the embedding vector of product y, and E be the embedding vector matrix.

[0108] Information aggregation of nodes based on the generalization matrix is ​​represented as follows:

[0109]

[0110] like Figure 4 As shown, the final embedding vector extracted by the multilayer perceptron is:

[0111] E″=MLP(E′)

[0112] Where E″ represents the final embedding vector, and MLP represents a multilayer perceptron;

[0113] In this embodiment, the embedding vectors of users and products are obtained. After a set epoch, the embedding vectors are updated through the graph neural network information propagation mechanism and the recommendation task loss function. Then, a nonlinear relationship is assigned through a multilayer perceptron. The final embedding vectors are the final embedding vectors of users and products. Specifically, the Bayesian personalized loss function is used as the recommendation task loss function to perform backpropagation to update the embedding vectors, thus completing the training of the embedding vectors.

[0114] In this embodiment, the embedding vector obtained by the graph neural network contains information about higher-order neighbors in the graph, but the nonlinear relationships are not rich. The result of the graph neural network is further extracted by the multilayer perceptron (MLP) to obtain the final embedding vectors of users and products.

[0115] S6: Calculate the user's interaction rating with different products and recommend products to the user according to the rating;

[0116] In this embodiment, during the process of obtaining interaction ratings, based on the final embedding vector E″, the cosine similarity is calculated to obtain the user's interaction ratings with different products. The calculation of cosine similarity is specifically expressed as follows:

[0117]

[0118] Where A represents the user embedding vector, B represents the product embedding vector, and A i B represents the i-th dimension of the user embedding vector in the final embedding vector E″, where n represents the dimension of the embedding vector. i Let represent the i-th dimension of the product embedding vector in the final embedding vector E″.

[0119] This invention supplements the user social network relationship graph in e-commerce scenarios by introducing a large language model, solving the problems of insufficient user relationships and inaccurate user profiles in previous e-commerce recommendation methods. At the same time, by introducing a graph neural network model, it overcomes the limitations of traditional product recommendation methods to achieve more accurate and efficient product recommendations. Furthermore, this invention uses the Fourier inverse transform frequency domain parameter matrix as a supplement to the large model fine-tuning parameters. Compared with the classic LoRA low-rank matrix, it utilizes the differentiability of the Fourier transform to perform large model fine-tuning with fewer frequency domain parameters while ensuring model fine-tuning performance.

[0120] Example 2

[0121] This embodiment provides a product recommendation system based on graph neural networks and a large language model. The system includes: a fine-tuning training dataset construction module, a large language model fine-tuning training module, a historical interaction dataset acquisition module, a dataset partitioning module, a confidence relation output module, a confidence relation cleaning module, a data merging module, a generalization matrix construction module, an embedding vector training module, an interaction rating calculation module, and a product recommendation result output module.

[0122] In this embodiment, the fine-tuning training dataset construction module is used to construct the fine-tuning training dataset;

[0123] In this embodiment, the large language model fine-tuning training module is used to fine-tune the large language model to obtain the fine-tuned large language model.

[0124] In this embodiment, the historical interaction dataset acquisition module is used to acquire the historical interaction dataset between the user and the item;

[0125] In this embodiment, the dataset partitioning module is used to partition the historical interaction dataset into a training set and a test set;

[0126] In this embodiment, the confidence relation output module is used to input the training set into a large language model to obtain the confidence relation of the user's social network;

[0127] In this embodiment, the confidence relationship cleaning module is used to clean the confidence relationships of the user's social network to obtain cleaned confidence relationships;

[0128] In this embodiment, the data merging module is used to merge the cleaned confidence relationships with the original training set to obtain merged data;

[0129] In this embodiment, the generalization matrix construction module is used to construct a generalization matrix based on the merged data;

[0130] In this embodiment, the embedding vector training module is used to train user and product embedding vectors based on the enhanced generalization matrix, perform representation aggregation through a graph neural network, and backpropagate the obtained results to update parameters.

[0131] In this embodiment, the interaction rating calculation module is used to obtain the interaction rating between the user and different products by calculating the cosine similarity.

[0132] In this embodiment, the product recommendation result output module is used to recommend products to users according to their ratings.

[0133] Example 3

[0134] This embodiment provides a computing device, which may be a desktop computer, laptop computer, smartphone, PDA handheld terminal, tablet computer or other terminal device with display function. The computing device includes a processor and a memory. The memory stores one or more programs. When the processor executes the program stored in the memory, it implements the product recommendation method based on graph neural network and large language model of Embodiment 1.

[0135] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A product recommendation method based on graph neural network and large language model, characterized in that: The steps include: Construct a fine-tuning training dataset, perform fine-tuning training on the large language model, and obtain a fine-tuned large language model; Obtain the historical interaction dataset between users and items, and divide the dataset into training set and test set. Input the training set into the fine-tuned large language model to obtain the confidence relationship of the user's social network. Cleaning the confidence relationship of the user's social network to obtain cleaned confidence relationship, and merging the cleaned confidence relationship with the original training set to obtain merged data; Construct a generalization matrix based on the merged data; Train user and product embedding vectors based on the enhanced generalization matrix, perform representation aggregation through graph neural networks, and back-propagate the results to update parameters; By calculating the cosine similarity, we can get the interaction scores between users and different products, and recommend products to users based on the scores.

2. The commodity recommendation method based on graph neural network and large language model according to claim 1, characterized in that: The fine-tuning training data set is constructed, wherein each piece of data in the fine-tuning training data set includes a task instruction, a task input, and a task output; The task input is composed of content data, interaction data and user social relationships. The content data is part of the user's attributes, the interaction data is the historical interaction data between the user and the product, and the user social relationships are the interaction relationships between users.

3. The commodity recommendation method based on graph neural network and large language model according to claim 1, characterized in that: The fine-tuning training of the large language model is specifically performed by fine-tuning the large language model through an inverse Fourier transform of a frequency domain parameter matrix; The original parameters of the large language model are recorded as P O , the frequency domain parameter matrix after frequency domain parameter matrix training is P l , the original parameter P O Combined with the Fourier inverse transform of the FourierFT frequency domain parameter matrix, the overall parameter of the large language model after the merger is P u , expressed as: P u =P o +IDFT(P l ) Among them, IDFT is the inverse Fourier transform; The optimization goal of fine-tuning training is: Among them, x represents the given task, y t Represents the output of the large language model, y <t Indicates the output y t The previous output content, Z represents all the input corpus content.

4. The commodity recommendation method based on graph neural network and large language model according to claim 1, characterized in that: The training set is input into the fine-tuned large language model to obtain the confidence relationship of the user's social network, which is specifically expressed as: v i,j =L t (F i ,F j ,Prompt) T i,j =v i,j Among them, L t is the parameter of the large language model, F i is the original feature of user i, F j is the original feature of user j, v i , j represents the possibility of association between user i and user j, T i , j Represents the value of the element in the i-th row and j-th column of T, and Prompt represents the large language model prompt.

5. The commodity recommendation method based on graph neural network and large language model according to claim 1, characterized in that: Construct a generalization matrix based on the merged data, including: Based on the merged data, the interaction matrix R is obtained. If there is an interaction record between user i and product j in the merged data, the element in the i-th row and j-th column of the interaction matrix R is set to 1, and the adjacency matrix is ​​obtained as follows: Among them, S represents the confidence relationship after cleaning; Construct the generalization matrix as: Where D is the degree matrix of A, represents the generalization matrix.

6. The commodity recommendation method based on graph neural network and large language model according to claim 1, characterized in that: Based on the enhanced generalization matrix, the user and product embedding vectors are trained, and the representation aggregation is performed through the graph neural network. The obtained results are back-propagated to update the parameters, including: In the process of obtaining interaction records, the embedding vectors of N user nodes and M product nodes of the input graph neural network are constructed, which can be expressed as: E={u1,u2,…,u N ,i1,i2,…,i M } in, O is the embedding vector dimension of each node, u x is the embedding vector of user x, i y is the embedding vector of product y, and E is the embedding vector matrix; According to the generalization matrix, the information of nodes is aggregated, which is expressed as: in, represents the generalization matrix; The final embedding vector extracted by the multi-layer perceptron is: E″=MLP(E′) Among them, E″ represents the final embedding vector, and MLP represents a multi-layer perceptron.

7. The commodity recommendation method based on graph neural network and large language model according to claim 6, characterized in that: The interaction scores between users and different products are obtained by calculating the cosine similarity. The calculation of cosine similarity is specifically expressed as: Among them, A represents the user embedding vector, B represents the product embedding vector, and A i represents the i-th dimension of the user embedding vector in the final embedding vector E″, n represents the dimension of the embedding vector, and B i Represents the i-th dimension of the product embedding vector in the final embedding vector E″.

8. The commodity recommendation method based on graph neural network and large language model according to claim 1, characterized in that: The obtained results are back-propagated to update parameters, and specifically, a Bayesian personalized loss function is used as the recommendation task loss function to back-propagate and update the embedding vector.

9. A product recommendation system based on graph neural network and large language model, characterized in that: include: Fine-tuning training dataset construction module, large language model fine-tuning training module, historical interaction dataset acquisition module, dataset partitioning module, confidence relationship output module, confidence relationship cleaning module, data merging module, generalization matrix construction module, embedding vector training module, interaction score calculation module, product recommendation result output module; The fine-tuning training data set construction module is used to construct a fine-tuning training data set; The large language model fine-tuning training module is used to perform fine-tuning training on the large language model to obtain a fine-tuned large language model; The historical interaction data set acquisition module is used to acquire the historical interaction data set between the user and the item; The data set partitioning module is used to partition the historical interaction data set into a training set and a test set; The confidence relationship output module is used to input the training set into the large language model to obtain the confidence relationship of the user's social network; The confidence relationship cleaning module is used to clean the confidence relationship of the user's social network to obtain the cleaned confidence relationship; The data merging module is used to merge the cleaned confidence relationship with the original training set to obtain merged data; The generalization matrix construction module is used to construct a generalization matrix based on the merged data; The embedding vector training module is used to train user and product embedding vectors based on the enhanced generalization matrix, perform representation aggregation through the graph neural network, and back-propagate the obtained results to update parameters; The interaction score calculation module is used to obtain the interaction scores between the user and different commodities by calculating the cosine similarity; The product recommendation result output module is used to recommend products to users according to their ratings.

10. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the product recommendation method based on the graph neural network and the large language model as described in any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Multi-signal fusion social recommendation method based on large language model

    CN121256153A