Large language model recommendation system and method based on time sequence diagram information enhancement

By using a large language model recommendation system based on temporal graph information enhancement, and employing a two-stage training method and a self-attention mechanism, the problem of insufficient capture of user interest sequence evolution features in existing recommendation systems is solved, thus achieving more efficient and accurate personalized recommendations.

CN121919271APending Publication Date: 2026-04-24HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU DIANZI UNIV
Filing Date
2026-01-22
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing recommendation systems lack timeliness and diversity when processing the sequential evolution features of user interests, and struggle to effectively capture the complex, implicit, high-order relationships between users and items, resulting in insufficient accuracy of recommendation results.

Method used

A large language model recommendation system based on temporal graph information enhancement is adopted. Through a two-stage training method, the graph embedding is input into the language model in the form of token sequence. The self-attention mechanism of the language model is used to learn the sequence evolution pattern of user interests. Combined with graph neural network and domain alignment module, high-order relationships in user-item interaction graph are captured.

Benefits of technology

It significantly improves the accuracy, timeliness, and diversity of recommendations, more accurately reflects the user's current interest status, enhances the ability to uncover potential interests, and reduces the computational resources and time costs of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121919271A_ABST
    Figure CN121919271A_ABST
Patent Text Reader

Abstract

The invention discloses a large language model recommendation system and method based on time sequence diagram information enhancement, and belongs to the technical field of artificial intelligence and recommendation systems. According to the method, a two-stage training framework is provided, firstly, in a graph prompt fine tuning stage, parameters of a pre-training language model are frozen, a plurality of sequence interaction graphs are constructed based on user-article interaction historical data, a graph neural network model and a domain alignment module are trained, and graph embedding representation aligned with a semantic space of the language model is generated; and secondly, in a collaborative fine tuning stage, fixing parameters of a graph neural network and a domain alignment module, embedding a graph into an organization, fusing text features to form graph enhancement prompt information, and performing fine tuning on a language model by adopting a parameter efficient fine tuning technology. And finally, forming the recommendation system by the finely-adjusted modules. According to the method, the sequence diagram is embedded into the sequence to be input into the language model, the dynamic evolution of the interest of the user is captured by utilizing a self-attention mechanism, and the accuracy, timeliness, diversity and fairness of recommendation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and recommendation systems, specifically to a large language model recommendation system and method based on temporal graph information enhancement. Background Technology

[0002] With the explosive growth of internet information, recommender systems have become a key technology connecting users with information. Existing recommender systems mainly rely on collaborative filtering algorithms or large language models (LLM) based on semantic understanding.

[0003] Collaborative filtering methods (such as NCF and LightGCN) can effectively capture the interaction relationships between users and items, but they lack the ability to deeply understand the semantics of unstructured text and struggle to handle the cold start problem. On the other hand, while recommendation systems based on large language models possess powerful semantic modeling capabilities and can generate fluent user profiles, they also have significant drawbacks: First, these models tend to over-rely on users' historical interaction data, leading to "filter bubbles" and "bias reinforcement," resulting in homogenized recommendation results and insufficient diversity; second, LLMs struggle to effectively perceive and utilize the complex, implicit, high-order relationships between users and items, limiting their ability to uncover users' potential interests and items' potential audiences.

[0004] More importantly, existing graph information augmentation methods primarily focus on static graph structures, failing to effectively capture the sequential evolution of user interests. User preferences are not static but rather dynamic, evolving over time. For example, a user might be enthusiastic about sports and fitness products at one time, while shifting to home entertainment products at another. Traditional static graph methods treat interactions across different time periods equally, ignoring the evolutionary trajectory of user interests and the timeliness of recent behavior. This results in recommendations that fail to accurately reflect the user's current preference state, reducing recommendation accuracy and user satisfaction.

[0005] Therefore, there is an urgent need in this field for an innovative solution that can balance recommendation accuracy, timeliness, diversity, and model training efficiency. Summary of the Invention

[0006] The purpose of this invention is to provide a large language model recommendation system and method based on temporal graph information enhancement, in order to solve the above-mentioned problems existing in the prior art. By embedding graphs of different time windows into the language model in a token sequence manner, the self-attention mechanism of the language model is used to automatically learn the sequence evolution pattern of user interests, thereby significantly improving the accuracy, timeliness and diversity of recommendations.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A training method for a large language model recommendation system based on temporal graph information enhancement includes the following steps: S10. Preparation steps: Obtain pre-trained language model, graph neural network model, domain alignment module and user-item interaction history data, wherein the interaction history data includes corresponding text information and timestamp information; S20, Two-stage training steps: S21. Training phase of graph model and alignment module: Freeze the parameters of the language model, construct multiple sequence interaction graphs based on the timestamp information of the interaction history data, use the sequence interaction graphs as input, train the graph neural network model and domain alignment module, the graph neural network model is used to generate graph embedding representations for each sequence interaction graph, and the domain alignment module is used to map the graph embedding representations to the semantic space of the language model; S22, Language Model Collaborative Fine-Tuning Stage: Fix the parameters of the graph neural network model and domain alignment module trained in S21, arrange the graph embedding representations corresponding to different time windows in sequence to form a graph embedding token sequence, adopt parameter efficient fine-tuning technology, and fine-tune the language model based on the graph enhancement prompt information formed by fusing the text features generated from the text information with the graph embedding token sequence; S30, System Output Steps: Output the language model fine-tuned by S22, the graph neural network model trained by S21, and the domain alignment module, which together serve as the recommendation system.

[0008] Furthermore, the parameter efficient fine-tuning technique is the low-rank adaptive LoRA technique; the LoRA technique fine-tunes by introducing a low-rank matrix next to the linear layer of the language model, and keeps the original backbone parameters of the language model frozen during the fine-tuning process, training only the low-rank matrix.

[0009] Furthermore, the graph neural network model is implemented using a graph attention network (GAT). The domain alignment module is implemented by a multilayer perceptron containing fully connected layers and activation functions.

[0010] Furthermore, the construction of the sequence interaction graph described in S21 includes: Divide the complete time span T into W consecutive time windows. ; For each time window Based on this window The interaction records within the graph are used to construct a corresponding user-item bipartite graph. As a sequence interaction graph, the node set Includes all users and items that have appeared in this window, side It consists of all user-item interactions that occur within this window; This yields multiple sequence interaction graphs. .

[0011] Another objective of this invention is to provide a large language model recommendation method based on temporal graph information enhancement. This method is implemented using a recommendation system trained by the aforementioned training method for a large language model recommendation system based on temporal graph information enhancement, and includes the following steps: User profile generation: Generate structured user profile text based on the target user's historical interaction records; Sequence graph embedding acquisition: The target user node and candidate item node are input into the recommendation system. Through the graph neural network model and domain alignment module therein, the graph embedding representations corresponding to different time windows are obtained and arranged in sequence to form a graph embedding token sequence. The target user node and candidate item node correspond to the nodes in the sequence interaction graph constructed when training the recommendation system. Hint fusion and reasoning: The user profile text is fused with the graph embedding token sequence to form graph-enhanced hint information, which is then input into the fine-tuned language model in the recommendation system. The self-attention mechanism of the language model is used to capture the sequence evolution of user interests. Recommendation result generation: Based on the output of the language model, generate personalized recommendation results for the target user.

[0012] Furthermore, the graph embedding acquisition includes: Centered on the target user node, extract from the trained global sequence interaction graph Skip local subplots and extract local subplots for each time window. The local subgraph sequence is input into the graph neural network model of the recommendation system to generate graph mosaics for each time window. And arrange them in sequence to form a graph embedding token sequence.

[0013] Furthermore, the graph embedding acquisition includes: The target user's historical interaction records are divided into chronological sequences, and multiple sequential interactions are constructed based on these sequences. ; The sequence interaction graphs are input into the graph neural network model of the recommendation system to generate graph embeddings for each time window. The tokens are arranged in sequence to form a graph embedding sequence. After being input into the language model, the model automatically learns the importance of different time windows and sequence dependencies through its self-attention mechanism.

[0014] Furthermore, the user profile generation includes: segmenting the item text in the target user's historical interaction records into segments according to time sequence, inputting each segment into a language model to generate segmented profiles, and then integrating all segmented profiles to generate an overall user profile.

[0015] Another objective of this invention is to provide a large language model recommendation system based on temporal graph information enhancement. This system is trained using the aforementioned training method for a large language model recommendation system based on temporal graph information enhancement, and includes: The user profile generation module is configured to generate user profile text based on the user's historical interaction records. The graph structure prompt generation module includes the graph neural network model and is configured to generate graph embedding representations for multiple sequential interaction graphs respectively. The graph enhancement prompt fusion module includes the domain alignment module, which is configured to map the graph embedding representation to the semantic space of the language model, and fuse the graph embeddings of multiple time windows with the user profile text in a token sequence manner to form graph enhancement prompt information; The collaborative recommendation module includes the language model, is configured to process the graph-enhanced prompts, learns sequence dependencies through a self-attention mechanism, and outputs recommendation results.

[0016] Furthermore, the graph enhancement prompt fusion module introduces specific tokens to arrange the mapped graph embedding representations in sequence and inserts them into the text prompt template to form a graph embedding token sequence.

[0017] The present invention provides a large language model recommendation system and method based on temporal graph information enhancement, which has the following significant advantages compared with the prior art: This invention effectively captures the sequential evolution of user interests. By embedding graphs from different time windows into a language model in a token-sequence manner, and leveraging the language model's powerful self-attention mechanism to automatically learn the dependencies and importance weights between different time windows, it can accurately model the dynamic changes in user preferences over time and identify the evolutionary trajectory of user interests. Compared to traditional static graph methods, this invention more accurately reflects the user's current true interest state, significantly improving the timeliness and accuracy of recommendations.

[0018] It enhances the diversity and fairness of recommendations. By aggregating multi-hop neighbor features in the user-item interaction graph through graph neural networks, it effectively captures cross-behavioral information between different user groups, breaking the "filter bubble" caused by relying solely on users' own historical data, and helping users discover a wider range of content of interest.

[0019] It enhances the ability to uncover potential interests. By mapping graph structure information and integrating it into the semantic space of the language model through the domain alignment module, the model can understand explicit semantics while also perceiving implicit high-order relationships. This enables it to more accurately uncover users' potential interests and the potential audience of items, improving recommendation performance in cold start scenarios.

[0020] This method achieves efficient and low-cost model training. Employing a two-stage collaborative fine-tuning strategy combined with LoRA parameter fine-tuning technology, it significantly reduces the computational resources and time costs required for training while ensuring effective fusion of graph structure and semantic features. This method requires training only a small number of low-rank parameters, resulting in low memory consumption, making it ideal for rapid deployment and application in resource-constrained environments. Furthermore, the graph neural network uses the standard GAT architecture, eliminating the need for complex sequence graph models and further reducing implementation difficulty and computational overhead. Attached Figure Description

[0021] Figure 1 This is a flowchart of the two-stage training method of the present invention. Detailed Implementation

[0022] 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. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0023] This invention integrates the structural relationships captured by graph neural networks (GNNs) with the deep semantic understanding capabilities of large language models (LLMs) through a novel two-stage training framework. It also innovatively adopts a graph embedding token sequence input method and utilizes the self-attention mechanism of the language model to automatically learn the sequence evolution of user interests. This addresses the problems of filter bubbles, insufficient diversity, inability to capture the sequence evolution of user interests, and cold start in existing recommendation systems.

[0024] Example 1: This embodiment provides a training method for a large language model recommendation system based on temporal graph information enhancement. Figure 1This embodiment demonstrates the overall workflow of the training method described. The workflow primarily comprises two parallel paths: user profile generation and original graph node embedding generation. Model training is then conducted through two stages: graph cue fine-tuning (training of the graph model and alignment module) and collaborative fine-tuning (collaborative fine-tuning of the language model). The core of the method lies in fusing graph embeddings with textual features using the domain alignment module, and inputting graph embeddings from different time windows into the language model in a token sequence manner. The model utilizes its self-attention mechanism to learn sequence evolution patterns, thereby collaboratively optimizing the large language model and the graph neural network. Figure 1 In this embodiment, the item pool corresponds to the item set I, which is the set of all items in the recommendation system; the item subgraph and the user subgraph refer to the local connection structure centered on the item node and the user node in the interaction graph, respectively; the user graph, the item subgraph, and the user subgraph together constitute the user-item interaction graph constructed in this embodiment.

[0025] Specifically, the method described in this embodiment includes the following steps: S10. Preparation steps: Obtain pre-trained language model, graph neural network model, domain alignment module and user-item interaction history data, wherein the interaction history data includes corresponding text information and timestamp information; S20, Two-stage training steps: S21. Training phase of graph model and alignment module: Freeze the parameters of the language model, construct multiple sequence interaction graphs based on the timestamp information of the interaction history data, use the sequence interaction graphs as input, train the graph neural network model and domain alignment module, the graph neural network model is used to generate graph embedding representations for each sequence interaction graph, and the domain alignment module is used to map the graph embedding representations to the semantic space of the language model; S22, Language Model Collaborative Fine-Tuning Stage: Fix the parameters of the graph neural network model and domain alignment module trained in S21, arrange the graph embedding representations corresponding to different time windows in sequence to form a graph embedding token sequence, adopt parameter efficient fine-tuning technology, and fine-tune the language model based on the graph enhancement prompt information formed by fusing the text features generated from the text information with the graph embedding token sequence; S30, System Output Steps: Output the language model fine-tuned by S22, the graph neural network model trained by S21, and the domain alignment module, which together serve as the recommendation system.

[0026] The above methods and steps are explained in detail below.

[0027] 1. Preparation Steps: Obtain the pre-trained language model, graph neural network model, domain alignment module, and user-item interaction history data. This interaction history data includes corresponding text information and timestamp information. This step prepares the necessary components and data for model training. Specifically: Obtain the pre-trained model and module: Obtain a basic pre-trained Large Language Model (LLM) (such as the LLaMA-2 model), a Graph Neural Network (such as the GAT attention network), and a domain alignment module to be trained. This domain alignment module can be a randomly initialized Multilayer Perceptron (MLP), whose structure can be defined as: Input layer dimension... (Consistent with graph embedding dimension), output layer dimension (Same as the word embedding dimension of LLM), it may contain a hidden layer in the middle, using the ReLU activation function.

[0028] Retrieve user-item interaction history data: Obtain a collection of historical interaction records between users and items from a database or logs. ,in It is a user set It is a collection of items, and T is a collection of timestamps. Each interaction record is associated with a text message of the item. (For example, the product title, subtitle, and description) and the timestamp t of the interaction. This textual and temporal information forms the basis for subsequent user profiling, sequence interaction graph construction, and semantic fusion.

[0029] 2. Two-stage training steps.

[0030] This is the core innovation of the invention, achieving effective synergy between sequence graph structural information and semantic information. After completing data preparation and initializing the original node embeddings, the system enters a two-stage training process. In the first stage, graph structural features are learned using the original node embeddings. In the second stage, graph embeddings from different time windows are input into the language model in a token sequence manner, fusing graph features and semantic information.

[0031] Phase 1: Training of the graphical model and alignment module: The parameters of the language model are frozen. Multiple sequential interaction graphs are constructed based on the timestamp information of the interaction history data. These sequential interaction graphs are used as input to train the graph neural network model and the domain alignment module. The graph neural network model generates graph embedding representations for each sequential interaction graph, and the domain alignment module maps these graph embedding representations to the semantic space of the language model. The goal of this stage is to enable the GNN and the domain alignment module to learn to extract effective features from interaction graphs in different time windows and map them to the semantic space of the LLM, while preserving the original knowledge of the LLM.

[0032] The graph neural network model is implemented using a graph attention network (GAT); the domain alignment module is implemented using a multilayer perceptron containing fully connected layers and activation functions. The graph neural network model generates corresponding graph embeddings for each sequence slice by aggregating the multi-hop neighbor information of user nodes and item nodes. During the training phase of the graph model and alignment module, the cross-entropy loss function is used for optimization, and the weight parameters of the graph attention network (GAT) are updated through backpropagation, enabling the GAT to learn and generate user and item graph embeddings that better meet the requirements of the recommendation task.

[0033] First, a sequence interaction graph is constructed. Based on the acquired interaction history data and its timestamp information, multiple sequence user-item interaction graphs are built. The specific steps are as follows: ① Time window division: Divide the complete time span T into W consecutive time windows. The length of the time window can be selected based on data density and business scenario. For example, for e-commerce data with frequent interactions, a week or a month can be selected; for long video platforms with sparse interactions, a quarter or half a year can be selected.

[0034] ② Construct sequence slices: For each time window Based on this window The interaction records within the graph are used to construct a corresponding user-item bipartite graph. As a sequence interaction graph, the node set Includes all users and items that have appeared in this window, i.e. edge set It consists of all user-item interactions that occur within this window, i.e. Interaction time This results in multiple sequence interactions. .

[0035] ③ Global Graph Construction: Simultaneously construct a global user-item bipartite graph containing interactions across all time periods. in , The adjacency matrix of this global graph is denoted as... .

[0036] Node Feature Initialization: An initial feature vector is assigned to each user node and item node. These features can be generated based on the node's inherent attributes. For example, the features of item nodes can be obtained from their text descriptions (title, description, etc.) using a lightweight encoder, while the features of user nodes can be generated based on statistical features of their historical interaction behavior. Ensure that the original embedding dimension of all nodes is consistent with the input dimension of the graph neural network, providing a foundation for subsequent GNN processing.

[0037] Next, freezing and training are performed. All parameters of the pre-trained language model are frozen so that they do not participate in updates during this stage. Then, the constructed sequence interaction graph is used as input to train the graph neural network model. Field alignment module .in: The role of graph neural networks: This embodiment uses GAT as an example. For each time window t, the graph neural network processes the corresponding interaction. The representation of node i in the l-th layer is calculated as follows: First, calculate the attention coefficient between node i and its neighbor node j: Where l represents the l-th layer of the graph neural network; Indicates the feature vector of node i in layer (l-1). ; is a shared, learnable weight matrix. is a learnable attention parameter vector, ‖ denotes the concatenation operation, d is the input feature dimension, and d' is the output feature dimension of this layer. Both the attention vector a and the weight matrix W are learnable parameters that need to be optimized during model training.

[0038] Then, the attention coefficients are normalized using the softmax function: in, Let i represent the set of neighboring nodes of node i.

[0039] Finally, by aggregating the neighbor information, we obtain the representation of node i in time window t and at the l-th layer: By stacking K layers (K=3 yielded the best results in the experiments), the graph embedding representation of each node i within the time window t is obtained. .

[0040] The above processing is performed on all time windows separately, and finally the graph embedding order of user u in each time window is obtained. By using 3-hop neighbor aggregation, complex high-order relationships such as "items liked by user A are also liked by user B, who is similar to A, and user B also likes item C" can be captured, effectively overcoming the limitations of recommendation based on direct co-occurrence. At the same time, by preserving the independent graph embeddings of each time window, a foundation is laid for subsequent learning of sequence evolution using the self-attention mechanism of the language model.

[0041] ②The role of the field alignment module: This module embeds the graph output by the GNN. Mapped to the semantic space of the LLM. Its operations can be represented as: in These are the learnable parameters of an MLP.

[0042] This mapping transforms the graph structure relationships of each time window into a continuous vector representation that LLM can understand and that is similar to its word vector distribution, laying a solid foundation for subsequent input into the language model in a token sequence manner.

[0043] ③Loss function and optimization: This stage uses the cross-entropy loss function for optimization. For user u and item i, the model is optimized based on augmented prompts. The loss function for generating predicted answers is defined as follows: in The target answer token is the token used for positive examples (items i that user u has interacted with). = "yes"; For negative samples, = "no". D' is the dataset used in the collaborative fine-tuning phase. This loss function updates the weight parameters of the graph attention network (GAT) through backpropagation. This enables GAT to learn and generate user and item graph embeddings that better meet the requirements of recommendation tasks, thereby enhancing LLM's ability to understand collaborative filtering signals.

[0044] The second stage, the language model collaborative fine-tuning stage: The parameters of the graph neural network model and domain alignment module trained in the first stage are fixed. Graph embedding representations corresponding to different time windows are arranged sequentially to form a graph embedding token sequence. A parameter-efficient fine-tuning technique is employed, and the language model is fine-tuned based on graph-enhanced prompts generated from the text features and the graph embedding token sequence. This allows the language model to learn the sequential evolution pattern of user interests through its self-attention mechanism. The parameter-efficient fine-tuning technique is Low-Rank Adaptive Regression (LoRA). LoRA fine-tunes the language model by introducing a low-rank matrix next to the linear layers while keeping the original core parameters of the language model frozen, training only the low-rank matrix. In the language model collaborative fine-tuning stage, the cross-entropy loss function is used.

[0045] The goal of this stage is to enable LLM to learn to understand and utilize the graph structure information provided by GNN and domain alignment modules, and to automatically learn the dependencies and importance weights between graph embeddings in different time windows through its own self-attention mechanism, so as to complete the recommendation task.

[0046] ① Parameter fixing and input preparation The parameters of the GNN model trained during the fixed-graph model and alignment module training phase are as follows: Field alignment module parameters Next, we prepare the necessary input data for fine-tuning—the graph augmentation hints. Specifically: Text feature generation: Generate structured user profile text based on the user's interaction history text. (For example, including interests, preferences, and functional requirements). Specifically, the user's historical item text sequence can be first categorized by time. To avoid exceeding the model input context length limit; the segmented text is input into the pre-trained LLM to generate segmented images. Integrate all segmented user profiles chronologically and further generate a comprehensive user profile using a large-scale language model. The overall profile includes, but is not limited to, three semantic elements: interests and preferences, functional requirements, and user style.

[0047] Graph Embedded Token Sequence Construction and Fusion: Integrating User Profile Text (Overall Profile) Through LLM word embedding layer Convert to word vector order corresponding to text tokens Simultaneously, for the target user u, the graph embedding mapping results of the region alignment module are obtained for each time window. And the graph embedding of candidate item i .

[0048] The key innovation lies in arranging these graph embeddings sequentially and inserting them as special graph tokens into the word vector sequence. Specifically, a special token is introduced... Embed the corresponding graph Inserted chronologically into specific positions within the text prompt template to form the final sequence of graphic enhancement prompts: The prompt sequence constructed in this way simultaneously includes: the user's semantic profile (word vector sequence), the user's graph structure information at different time windows (graph embedding token sequence), and the graph structure information of candidate items.

[0049] Language models, through their powerful self-attention mechanism, can automatically learn the following: sequence dependencies between graph embeddings in different time windows; importance weights of each time window to the current recommendation task (recent behavior usually has higher weights); the evolution trend and patterns of user interests; and the association between graph structural information and text semantic information.

[0050] Compared to traditional methods that require explicit design of sequence attention mechanisms, this invention utilizes the self-attention capability already trained by LLM, eliminating the need to introduce additional sequence modeling modules, thus simplifying the model architecture while improving the flexibility of sequence modeling.

[0051] ② Efficient parameter fine-tuning The efficient parameter fine-tuning technique is the low-rank adaptive LoRA technique. The LoRA technique fine-tunes the language model by introducing a low-rank matrix next to the linear layers, while keeping the original backbone parameters of the language model frozen during the fine-tuning process, training only the low-rank matrix. For the linear layers in the LLM that require fine-tuning, their original weights... LoRA introduces an increment of low-rank decomposition. ,in ,rank (Usually 8 or 16). The forward propagation of this layer becomes: During fine-tuning, the original weights W are frozen, and only the newly introduced low-rank matrices A and B are trained. This significantly reduces the number of training parameters (from d×k to (d+k)×r) and memory consumption, making it possible to achieve efficient and low-cost adaptation on large models, while effectively preventing overfitting on recommendation data.

[0052] ③Loss Function and Optimization This stage uses the cross-entropy loss function. For user u and positive item i, the model predicts their click probability. This probability is the probability that the model outputs "yes", and the loss function is: That These are real tags, representing positive example items i that user u has interacted with. For negative examples, This loss function aims to achieve recommendation accuracy against the LoRA parameters. For optimization, D' is used for the dataset in the collaborative fine-tuning phase.

[0053] 3. System output steps: Output the language model after the second stage of fine-tuning, as well as the graph neural network model and domain alignment module trained in the first stage, together as the recommendation system.

[0054] After two stages of training, a fine-tuned language model is obtained. The trained graph neural network model Field alignment module These three elements are combined and packaged together to form the final sequence graph-enhanced language model recommendation system. This system has the ability to process both semantic and sequence graph structural information simultaneously, and can be used for efficient personalized recommendations.

[0055] In summary, the core of this training method lies in a two-stage training strategy: The first stage (graphic model and alignment module training, i.e., graph cue fine-tuning) trains only the GNN and domain alignment modules, freezes the LLM parameters, and generates graph embeddings for the interaction graphs of each time window. The second stage (language model collaborative fine-tuning, i.e., collaborative fine-tuning) loads the pre-trained graph embedding module, fixes its parameters, inputs the graph embeddings from different time windows into the LLM in a token sequence manner, and uses LoRA technology to train only a small number of adaptation parameters in the LLM, utilizing the LLM's self-attention mechanism to automatically learn the sequence evolution pattern. This strategy effectively reduces training costs and avoids overfitting. In the inference stage, the model generates cueing based on the overall user profile and the graph embedding token sequence, calculates the user's interaction probability with candidate items using the Softmax function, and selects the top K items with the highest probabilities as the final recommendation result. This method, by inputting the sequence graph embeddings into the language model in a token sequence manner and utilizing its powerful self-attention mechanism to learn the sequence evolution of user interests, effectively improves the accuracy, timeliness, diversity, and fairness of recommendations.

[0056] Example 2 (Recommendation method based on local subgraphs - comparison method) This embodiment provides a large language model recommendation method based on temporal graph information enhancement, which generates personalized recommendations for specific target users based on local subgraphs. This embodiment can serve as a control experiment against static graph methods.

[0057] System preparation: Obtain a complete recommendation system trained by the training method described in the embodiment, which includes a fine-tuned language model, a trained graph neural network model, and a domain alignment module.

[0058] Recommendation process: User profile generation: Generate structured user profile text based on the target user's historical interaction records. For specific methods, please refer to the implementation example.

[0059] Graph embedding acquisition (core of this solution): Centered on the target user node, extract its K-hop (usually K=2 or 3) local subgraph from the global interaction graph constructed during the training phase of the implementation example. Input this local subgraph (regardless of time window) into the frozen graph neural network model and domain alignment module in the recommendation system to obtain the graph embedding representation corresponding to the target user node, which is aligned with the semantic space of the language model. This graph embedding focuses on the user's direct social circle and interaction environment, but does not include sequence information. Specifically: Centered on the target user node, extract its K-hop local subgraph from the trained global sequence interaction graph, and extract the local subgraph for each time window. The local subgraph sequence is input into the graph neural network model of the recommendation system to generate graph embeddings for each time window. And arrange them in sequence to form a graph embedded token sequence.

[0060] Hint fusion and reasoning: The above single-graph embedding representation is fused with the user profile text to form graph-enhanced hint information, which is then input into the fine-tuned language model.

[0061] Recommendation result generation: Based on the output of the language model, a personalized recommendation list is generated for the target user.

[0062] This embodiment is computationally efficient and simple to implement, but it lacks sequence modeling capabilities and cannot capture the evolution of user interests. It can be used as a control baseline.

[0063] Example 3 (Recommendation Method Based on Time Series Evolution Graph) This embodiment provides a recommendation method for large language models based on temporal sequence graph information enhancement. It generates dynamic, personalized recommendations for specific target users by embedding token sequences into complete sequence graphs. This embodiment is the core recommendation method of this invention.

[0064] The system preparation is the same as in Example 2.

[0065] Recommendation process: User profile generation: Same as Example 2.

[0066] Sequence graph embedding acquisition (core of this solution): Divide the target user's historical interaction records into time sequences and construct multiple sequence interaction graphs based on this. The sequence interaction graphs are input into the graph neural network model of the recommendation system to generate graph embeddings for each time window. The tokens are arranged in sequence to form a graph embedding sequence. After being input into the language model, the model automatically learns the importance of different time windows and sequence dependencies through its self-attention mechanism.

[0067] For example, user interaction behavior over the past year can be divided into months, with the interaction data for each month forming a subgraph. There are a total of 12 sequence interaction graphs.

[0068] These sequence interaction graphs are fed into the graph neural network model of the recommender system to generate graph embeddings for each time window. .

[0069] These graph embeddings are arranged sequentially as a sequence of graph tokens. After being input into a language model, their self-attention mechanism automatically learns the importance and sequence dependencies of different time windows. Specifically, special markers are inserted into the text prompt template. Embed the corresponding graph Inserting in chronological order results in: Hint fusion and inference: Graph-enhanced hints, containing graph embeddings of token sequences, are input into the fine-tuned language model. The language model automatically performs the following tasks through its self-attention mechanism: Calculate the correlation between graph embeddings of different time windows; Assign importance weights to each time window (usually, more recent time windows have higher weights); Identify the evolving trends in user interests (e.g., the shift from sports and fitness to home entertainment to baking tools). Deeply fusing sequence diagram information with textual semantic information; for example, assuming that after self-attention calculation, it is found that: (In the last 3 months) it has gained high weight; The image embeddings over these three months show a shift in user interest from sports to baking; The model automatically reduces the weights of early motion-related map embeddings; Finally, we recommend baking-related products.

[0070] The advantage of this embodiment compared to Embodiment 2 is that the static graph method in Embodiment 2 treats all interactions across all time periods equally, failing to distinguish the temporal evolution of user interests. In contrast, this embodiment, by constructing a sequence graph embedding a token sequence and utilizing the self-attention mechanism of LLM, can: automatically learn the importance weights of different time windows, capture the long-term evolution trajectory and trends of user interests, accurately reflect the user's current true interest state, and generate recommendation results that better match the user's recent preferences. This method is particularly suitable for scenarios such as e-commerce, music, and long-form video that require a deep understanding of the long-term evolution of user preferences, and it eliminates the need for explicitly designing complex sequence models, fully utilizing the existing sequence modeling capabilities of LLM.

[0071] Example 4: This embodiment provides a large language model recommendation method based on temporal graph information enhancement. The method employs a recommendation system trained using the aforementioned training method for a large language model recommendation system based on temporal graph information enhancement. The method includes: User profile generation: generating structured user profile text based on the target user's historical interaction records; Sequence graph embedding acquisition: inputting the target user node and candidate item nodes into the recommendation system, and using its graph neural network model and domain alignment module to obtain graph embedding representations corresponding to different time windows, arranging them sequentially to form a graph embedding token sequence. The target user node and candidate item node correspond to nodes in the sequence interaction graph constructed during the training of the recommendation system; Hint fusion and inference: fusing the user profile text with the graph embedding token sequence to form graph-enhanced hint information, and inputting it into the fine-tuned language model in the recommendation system, utilizing the language model's self-attention mechanism to capture the sequential evolution of user interests; Recommendation result generation: generating personalized recommendation results for the target user based on the output of the language model. The user profile generation includes: segmenting the item text in the target user's historical interaction records according to time order, inputting each segment into the language model to generate segmented profiles, and then integrating all segmented profiles to generate an overall user profile.

[0072] This embodiment describes the use of the system trained in Embodiment 1. The actual recommendation process is as follows: User profile generation: Receiving target users The historical interaction records are used to generate structured user profiles in the same way as during training (e.g., segmentation and integration). .

[0073] Sequence graph embedding acquisition: from system sequence interactions Locate the target user node u' and the set of candidate items. For the corresponding nodes, the graph embeddings for each time window are obtained through the pre-trained GNN and domain alignment module within the system. And image embedding of candidate items .

[0074] Hints, Fusion, and Inference: Integrating User Profile Text Graph Embedded Token Order Enhanced image fusion and prompts Input into the finely tuned LLM within the system In this context, LLM automatically learns sequence evolution patterns through its self-attention mechanism.

[0075] Recommendation result generation: LLM outputs each candidate item based on the prompt information. Recommendations The final Top-N personalized recommendation list is generated based on probability sorting. .

[0076] Example 5: This embodiment provides a large language model recommendation system based on temporal graph information enhancement. The system is trained using the training method for a large language model recommendation system based on temporal graph information enhancement described in Embodiment 1. It can be physically deployed on a server or in the cloud, and includes: The user profile generation module is configured to generate user profile text based on the user's historical interaction records. The graph structure prompt generation module includes the graph neural network model and is configured to generate graph embedding representations for multiple sequential interaction graphs respectively. The graph enhancement prompt fusion module includes the domain alignment module, which is configured to map the graph embedding representation to the semantic space of the language model, and fuse the graph embeddings of multiple time windows with the user profile text in a token sequence manner to form graph enhancement prompt information; The collaborative recommendation module includes the language model, is configured to process the graph-enhanced prompts, learns sequence dependencies through a self-attention mechanism, and outputs recommendation results.

[0077] The graph enhancement prompt fusion module introduces specific tokens to arrange the mapped graph embedding representations in sequence and insert them into the text prompt template, forming a graph embedding token sequence. This enables the language model to capture the dependencies between graph embeddings in different time windows through its self-attention mechanism.

[0078] In summary, this invention innovatively integrates the structured information processing capabilities of graph neural networks with the deep semantic understanding capabilities of large language models by introducing a two-stage training framework. Its core features are: First, in the graph cue fine-tuning stage, the graph neural network and domain alignment module are trained independently, constructing multiple sequential interaction graphs based on timestamp information from user-item interaction history data, effectively capturing high-order relationships within these graphs. Then, in the collaborative fine-tuning stage, parameter-efficient fine-tuning techniques (such as LoRA) are used to organize graph embeddings from different time windows according to a token sequence and seamlessly combine them with text features to form graph-enhanced cue information. This fine-tunes the language model, enabling it to automatically learn the sequential evolution patterns of user interests through its self-attention mechanism. This method not only overcomes the "filter bubble" and lack of diversity problems inherent in traditional recommendation systems but also effectively captures the sequential evolution patterns of user interests, significantly improving the ability to uncover potential user interests and the accuracy and timeliness of recommendations. Simultaneously, the parameter-efficient fine-tuning strategy greatly reduces computational overhead, providing a feasible technical path for developing efficient, accurate, and reliable next-generation intelligent recommendation systems.

[0079] Contents not described in detail in this specification are prior art known to those skilled in the art. It is hereby indicated that the above description is intended to help those skilled in the art understand this invention, but does not limit the scope of protection of this invention. Any equivalent substitutions, modifications, improvements, or simplifications of the above descriptions that do not depart from the essential content of this invention fall within the scope of protection of this invention.

Claims

1. A training method for a large language model recommendation system based on temporal graph information enhancement, characterized in that, Includes the following steps: S10. Preparation steps: Obtain pre-trained language model, graph neural network model, domain alignment module and user-item interaction history data, wherein the interaction history data includes corresponding text information and timestamp information; S20, Two-stage training steps: S21. Training phase of graph model and alignment module: Freeze the parameters of the language model, construct multiple sequence interaction graphs based on the timestamp information of the interaction history data, use the sequence interaction graphs as input, train the graph neural network model and domain alignment module, the graph neural network model is used to generate graph embedding representations for each sequence interaction graph, and the domain alignment module is used to map the graph embedding representations to the semantic space of the language model; S22, Language Model Collaborative Fine-Tuning Stage: Fix the parameters of the graph neural network model and domain alignment module trained in S21, arrange the graph embedding representations corresponding to different time windows in sequence to form a graph embedding token sequence, adopt parameter efficient fine-tuning technology, and fine-tune the language model based on the graph enhancement prompt information formed by fusing the text features generated from the text information with the graph embedding token sequence; S30, System Output Steps: Output the language model fine-tuned by S22, the graph neural network model trained by S21, and the domain alignment module, which together serve as the recommendation system.

2. The training method for a large language model recommendation system based on temporal graph information enhancement according to claim 1, characterized in that, The efficient parameter fine-tuning technique is the low-rank adaptive LoRA technique; the LoRA technique fine-tunes by introducing a low-rank matrix next to the linear layer of the language model, and keeps the original backbone parameters of the language model frozen during the fine-tuning process, training only the low-rank matrix.

3. The training method for a large language model recommendation system based on temporal graph information enhancement according to claim 1, characterized in that: The graph neural network model is implemented using the graph attention network GAT. The domain alignment module is implemented by a multilayer perceptron containing fully connected layers and activation functions.

4. The training method for a large language model recommendation system based on temporal graph information enhancement according to claim 1, characterized in that, The construction of the sequence interaction graph described in S21 includes: Divide the complete time span T into W consecutive time windows. ; For each time window Based on this window The interaction records within the graph are used to construct a corresponding user-item bipartite graph. As a sequence interaction graph, the node set The edge set contains all users and items that have appeared within the window. It consists of all user-item interactions that occur within this window; This yields multiple sequence interaction graphs. .

5. A recommendation method for large language models based on temporal sequence graph information enhancement, characterized in that, This method employs a recommendation system trained using the training method for a large language model recommendation system based on temporal graph information enhancement as described in any one of claims 1-4, and includes the following steps: User profile generation: Generate structured user profile text based on the target user's historical interaction records; Sequence graph embedding acquisition: The target user node and candidate item node are input into the recommendation system. Through the graph neural network model and domain alignment module therein, the graph embedding representations corresponding to different time windows are obtained and arranged in sequence to form a graph embedding token sequence. The target user node and candidate item node correspond to the nodes in the sequence interaction graph constructed when training the recommendation system. Hint fusion and reasoning: The user profile text is fused with the graph embedding token sequence to form graph-enhanced hint information, which is then input into the fine-tuned language model in the recommendation system. The self-attention mechanism of the language model is used to capture the sequence evolution of user interests. Recommendation result generation: Based on the output of the language model, generate personalized recommendation results for the target user.

6. The large language model recommendation method based on temporal sequence graph information enhancement according to claim 5, characterized in that, The graph embedding acquisition includes: Centered on the target user node, extract its K-hop local subgraph from the trained global sequence interaction graph, and extract the local subgraph for each time window. The local subgraph sequence is input into the graph neural network model of the recommendation system to generate graph embeddings for each time window. And arrange them in sequence to form a graph embedded token sequence.

7. The large language model recommendation method based on temporal sequence graph information enhancement according to claim 5, characterized in that, The graph embedding acquisition includes: The target user's historical interaction records are divided into chronological order, and multiple sequence interaction graphs are constructed based on this. ; The sequence interaction graphs are input into the graph neural network model of the recommendation system to generate graph embeddings for each time window. The tokens are arranged in sequence to form a graph embedding sequence. After being input into the language model, the model automatically learns the importance of different time windows and sequence dependencies through its self-attention mechanism.

8. The large language model recommendation method based on temporal sequence graph information enhancement according to claim 5, characterized in that, The user profile generation includes: segmenting the item text in the target user's historical interaction records into segments according to time sequence, inputting each segment into a language model to generate segmented profiles, and then integrating all segmented profiles to generate an overall user profile.

9. A large language model recommendation system based on temporal sequence graph information enhancement, characterized in that, The system is trained using the training method of a large language model recommendation system based on temporal graph information enhancement as described in any one of claims 1-4, comprising: The user profile generation module is configured to generate user profile text based on the user's historical interaction records. The graph structure prompt generation module includes the graph neural network model and is configured to generate graph embedding representations for multiple sequential interaction graphs respectively. The graph enhancement prompt fusion module includes the domain alignment module, which is configured to map the graph embedding representation to the semantic space of the language model, and fuse the graph embeddings of multiple time windows with the user profile text in a token sequence manner to form graph enhancement prompt information; The collaborative recommendation module includes the language model, is configured to process the graph-enhanced prompts, learns sequence dependencies through a self-attention mechanism, and outputs recommendation results.

10. A large language model recommendation system based on temporal sequence graph information enhancement according to claim 9, characterized in that, The graph enhancement prompt fusion module introduces specific tokens to arrange the mapped graph embedding representations in sequence and inserts them into the text prompt template, forming a graph embedding token sequence.