Knowledge concept sequence recommendation method and system based on large language model
By constructing a graph attention network and a hybrid prompt template, and combining a multi-objective loss function to optimize the large language model, this solves the problem in existing learning resource recommendation algorithms that ignore learner background and the inconsistency between the training objectives of the large language model and the actual learning resource recommendation algorithm. This achieves more accurate knowledge concept recommendation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-04-07
AI Technical Summary
Existing MOOC learning resource recommendation algorithms ignore learners' specific knowledge background, resulting in low learning efficiency. Furthermore, large language models have inconsistent training objectives and recommendation tasks, weak understanding of collaborative features, and difficulty in effectively recommending knowledge concepts.
We construct a graph attention network to extract features from videos and knowledge concepts, design a hybrid prompt template to guide the reasoning of a large language model, optimize the recommendation model through a multi-objective loss function, and train the large language model in conjunction with course learning strategies to capture learners' preferences and the temporal dependencies of knowledge concepts.
It improves the accuracy of knowledge concept recommendation by using the reasoning ability of a large language model to recommend knowledge concepts of interest, thus mitigating the bias caused by single-objective training and enhancing the effectiveness of the recommendation system.
Smart Images

Figure CN121808138A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of knowledge concept recommendation, in particular to a knowledge concept sequence recommendation method and system based on a large language model. BACKGROUND
[0002] Knowledge concept recommendation is one of the research focuses of a large-scale online course platform MOOC. Online learning brings learning convenience to the public and promotes the rapid development of MOOC. However, the existing MOOC learning resource recommendation algorithm mostly depends on course recommendation, and this coarse-grained recommendation method often ignores the specific knowledge background of learners, resulting in low learning efficiency and even dropout. Knowledge concept recommendation can fill the gaps in the current knowledge structure of learners from a more fine-grained perspective, provide more accurate learning resource recommendation for learners, and improve learning efficiency.
[0003] The application of current graph learning technology in the recommendation field is gradually mature. Domestic and foreign scholars model the learning resource relationship and learner behavior through traditional graph structure or hypergraph structure. However, the method based on graph convolution fails to fully consider the sequence of interactions in the learner behavior, and is a static modeling in problem modeling, which limits the recommendation effect in actual scenarios such as interest deviation and scene migration. In this case, an additional time modeling mechanism needs to be introduced to capture the dynamic evolution law in the learning process of learners.
[0004] In recent years, the application of large language model LLM in sequence recommendation has attracted the attention of researchers. The powerful reasoning ability of LLM on text sequence makes it easy to understand the text information in the interaction sequence of learners. The existing large language model recommendation technology is mainly divided into two categories: text enhancer and direct recommender. The text enhancer takes the GraphGPS concept encoder as an example, and uses the large language model to generate enhanced text description for each concept in the knowledge graph, and then serves the subsequent graph structure enhancement task. However, the performance of this method depends to a great extent on whether the subsequent encoder can effectively realize the semantic alignment between item features and text features. The direct recommender adopts an end-to-end paradigm, and uses the large language model as a recommendation engine to directly generate a recommendation result. It is considered as the potential core architecture of the next generation of recommendation system because it can deeply integrate semantic understanding and recommendation logic. However, the training target of LLM is not consistent with the recommendation task, and the understanding of collaborative features by LLM is weak. This needs to further explore how to train LLM or rechange the network structure to adapt to the recommendation task. SUMMARY
[0005] The purpose of the application is to provide a knowledge concept sequence recommendation method and system based on a large language model, which improves the accuracy of knowledge concept recommendation.
[0006] Technical solution: The knowledge concept sequence recommendation method based on a large language model comprises the following steps:
[0007] Obtain a MOOC dataset;
[0008] Construct a graph attention network based on the learning resource graph between the MOOC video and the knowledge concept, and extract the video and knowledge concept features;
[0009] Construct a sequence recommendation model according to the video and knowledge concept features, calculate the interest score of the learner and the knowledge concept, and sort and retrieve the candidate items; the loss function of the sequence recommendation model considers the preference perception of the learner to the video and the preference perception to the knowledge concept from two angles;
[0010] Map the collaborative features generated by the sequence recommendation model to the text semantic space of the large language model to construct a hybrid prompt template to guide the LLM inference; the hybrid prompt template includes four tokens, which are the preference features of the learner, the video features, the concept features of recent interaction, and the features of the candidate items;
[0011] Train the inference ability of the large language model from the effective token set of the MOOC dataset;
[0012] Input the learner sequence to be recommended into the sequence recommendation model, input the candidate items and their collaborative features retrieved by the sequence recommendation model into the trained large language model, and obtain the final recommendation list.
[0013] Further, the course learning strategy is used to train the large language model, comprising:
[0014] The large language model training task is divided into simple and difficult tasks through course learning, the hybrid prompt design of the simple task includes the learner features, the video features and the text features of the knowledge concept, and the hybrid prompt design of the difficult task includes the learner features, the video features, the collaborative features of the knowledge concept and the text features;
[0015] The prompt set designed in the course learning is shuffled, the simple prompt and the difficult prompt are mixed in percentage form, and then the LLM is trained from simple to difficult.
[0016] Further, a bipartite graph is constructed as a learning resource graph according to the video-concept relationship in the MOOC dataset; the graph attention network is built based on the video-concept bipartite graph.
[0017] Further, the graph attention network dynamically captures the weight between nodes through a learnable attention mechanism and then aggregates, and the attention weight is normalized and represented as:
[0018] ;
[0019] wherein, is the weight between node i and node j, is the activation function, is the trainable parameter, wherein denotes the softmax function, which is used to calculate the proportion of node j in the neighbor nodes of node i, denotes the importance estimation tensor of node j to node i, denotes the feature of node i, denotes the feature of node j, denotes the kth neighbor of node i in the neighbor set .
[0020] For the video-concept relationship, define as the adjacency matrix of course-concept, denotes the bipartite graph association matrix of course-video, thus, the graph attention network is represented as:
[0021] .
[0022] wherein, and are the video and knowledge concept features extracted by the graph attention network; is used to define the GAT function; is the embedding of the video obtained by ID matching, which is initialized by a random normal distribution; is defined by the Sentence-Bert sentence embedding model SBert coding; is used to define the linear function of dimension alignment; is the video-concept neighbor matrix with self-connection, is the unit matrix.
[0023] Further, the SASRec model is used as the basic model to construct a sequence recommendation model according to the video and knowledge concept features.
[0024] Further, the sequence recommendation model comprises:
[0025] the learner sequence is defined as , the video corresponding to the knowledge concept set of the next interaction in the sequence is ; secondly, the input node features of the sequence model are defined as and , and the residual connection is used for the input feature representation of the video and the concept, which is represented as:
[0026] .
[0027] ;
[0028] Then, the features are mapped to the learner sequence by course ID and concept ID and the knowledge concept set ; the learner sequence combines the position encoding to get the predicted sequence latent feature after the self-attention network of the SASRec model ;
[0029] wherein, represents the interaction sequence of all learners about the video, represents the length of the interaction sequence of the learner u about the video.
[0030] Further, the loss function of the sequence recommendation model is:
[0031] ;
[0032] wherein, is a hyperparameter for controlling the contribution of the two loss functions; is a hyperparameter of L2 norm, is a set of model trainable parameters, is the video preference loss, is the knowledge concept preference loss;
[0033] Given a learner sequence , the sequence prediction feature is obtained by encoding the sequence recommendation model , and the learner feature is the prediction feature of the last interaction item in the sequence ; first, calculate , take the video in the sequence as the positive example, and take the same number of videos not watched by the learner as the negative example, and model the video prediction task as a binary classification problem:
[0034] ;
[0035] wherein, is the positive and negative example set of the interaction video in the sequence , indicates the positive example, indicates the negative example. is the predicted score, which is used to calculate the interest score between the learner and the video, by dot product of the learner feature and the video feature ;
[0036] Then, calculate , take the sequence The last video interaction of the concept is taken as a positive example, and the same number of learners' non-interaction concepts are taken as negative examples, and the concept prediction task is modeled as a positive and negative example ranking loss problem:
[0037] ;
[0038] wherein, is the interest score between the learner and the concept, which is obtained by the dot product of the learner feature and the concept feature, as a triple in the video corresponding learner-concept interaction dataset , respectively indicating the learner, the concept positive example and the concept negative example.
[0039] Further, the loss function of the large language model comprises an effective token loss function and a video contrast loss;
[0040] ;
[0041] wherein, β is a hyperparameter ranging from 0 to 1, is the effective token loss function, is the video contrast loss;
[0042] Effective token loss function : convert the title of the knowledge concept in the dataset into tokens as an effective token set by a tokenizer ; then use a prefix tree to represent the horizontal and vertical relationships of the tokens representing the title of the knowledge concept, the horizontal represents the dependency relationship before and after, and the vertical represents the relationship with the same prefix; introduce MSL mask softmax loss function to calculate the loss loss, the core formula is as follows:
[0043] ;
[0044] wherein, is the token of the positive example, is the token with the same prefix, in order to alleviate the gradient vanishing problem, the temperature coefficient is adaptively regulated, and is controlled within a reasonable range through clipping means; represents the probability of LLM predicting token , from the effective token set , represents the probability of LLM predicting token , represents the parameters of LLM, represents the text content before the next token predicted by the LLM, represents the token that needs to be predicted by the LLM next time;
[0045] Video contrast loss : the student interaction sequence The dot product of the obtained learner feature and the video feature of the next interaction is taken as the prediction score, and the next real interaction is compared with the video set that the learner has not interacted with. The core formula can be represented as:
[0046] ;
[0047] wherein, indicates the learner embedding mapped to the LLM, is the video feature, is the video set that the learner has never interacted with, indicates a fixed temperature coefficient, is the learner, is the feature of the video j that the learner has never interacted with mapped to the LLM, is the student interaction sequence the feature of the positive example video of the next interaction, is the learner set.
[0048] The knowledge concept sequence recommendation system based on a large language model comprises:
[0049] A model construction and training unit is used to obtain a MOOC data set;
[0050] A graph attention network is constructed based on the learning resource graph between the MOOC video and the knowledge concept, and video and knowledge concept features are extracted;
[0051] A sequence recommendation model is constructed according to the video and knowledge concept features, the interest score of the learner and the knowledge concept is calculated and sorted to retrieve the candidate item; the loss function of the sequence recommendation model considers the two aspects of the learner's preference perception for the video and the preference perception for the knowledge concept;
[0052] The collaborative feature generated by the sequence recommendation model is mapped to the text semantic space of the large language model to construct a hybrid prompt template to guide the LLM reasoning; the hybrid prompt template comprises four tokens, which are the preference feature of the learner, the video feature, the concept feature of the recent interaction and the feature of the candidate item;
[0053] The reasoning ability of the large language model is trained from the effective token set of the MOOC data set;
[0054] The recommendation unit is used to input the sequence of learners to be recommended into the sequence recommendation model, and input the candidate items and their collaborative features retrieved by the sequence recommendation model into the trained large language model to obtain the final recommendation list.
[0055] The computer program product of the present invention includes a computer program that, when executed by a processor, implements the knowledge concept sequence recommendation method based on the large language model.
[0056] Beneficial Effects: Compared with existing technologies, the advantages of this invention are as follows: 1) This invention captures the temporal sequence of knowledge concepts and learner preference features from video sequences using an ID-based sequence recommendation model, and then utilizes the reasoning ability of LLM to recommend knowledge concepts of interest to learners from the perspective of text sequences, thereby improving the accuracy of knowledge concept recommendation. 2) This invention extracts the relevant features between videos and concepts through a graph attention mechanism, and simultaneously captures the temporal dependencies between concepts in subsequent learning of video sequences, thereby avoiding the need to observe the interaction sequences of knowledge concepts. 3) This invention, through the design of hybrid prompts, enables the Large Language Model (LLM) to learn collaborative features and the relationship between collaborative features and text features through instruction training. 4) This invention, through multi-objective loss optimization, avoids model training relying solely on a single learning resource objective, but instead focuses on both videos and concepts, thereby mitigating the bias caused by a single objective. Attached Figure Description
[0057] Figure 1 This is a flowchart of the training and inference process for an ID-based sequence recommendation model.
[0058] Figure 2 This is a flowchart of the large language model training and inference process of the present invention.
[0059] Figure 3 Example diagram of the hybrid prompt design of the present invention. Detailed Implementation
[0060] like Figure 1 As shown, the ID-based sequence recommendation model captures learners' interest preferences for videos and concepts through a configured graph attention network. However, this model still has shortcomings: it is essentially based on behavioral statistics and is highly susceptible to noise in learners' behavior, and it ignores the influence of side information on learners' preferences. Therefore, this invention further proposes an improvement, specifically using LLM as a reorderer to alleviate the semantic gap and noise sensitivity of the ID-based sequence recommendation model. Furthermore, due to the lack of observation of concept-level interaction sequences and the difficulty in observation in MOOC platforms, it is difficult to model learner-concept interaction sequences. Therefore, this invention approaches the problem from another angle: capturing the temporal dependencies between knowledge concepts, specifically capturing these temporal dependencies from video interaction sequences and video-concept relationships.
[0061] The technical solution of the present invention will be further described below with reference to the accompanying drawings. The knowledge concept sequence recommendation method based on a large language model according to the present invention includes the following steps.
[0062] Step 1) Establish a bidirectional graph attention mechanism for learning resources: Extract video-concept relationships from the MOOC dataset to construct a learning resource graph; construct a graph attention network based on the learning resource graph between MOOC videos and knowledge concepts to identify the potential mapping between video content and knowledge concepts and extract more accurate feature representations.
[0063] Step 1.1) Split the dataset to obtain learner behavior data and learning resource graph: Split the MOOC dataset MOOCCube according to time order. In this embodiment, firstly, extract all data from January 1, 2019 to June 1, 2019 from the JSON file of learner interactions with videos and process the data with Pandas. Use the data from January 1, 2019 to May 1, 2019 as the training set dates and the data from May 1, 2019 to June 1, 2019 as the test set dates. Use a sliding window to obtain learner behavior data. Use the video of the first interaction of learners in the test set as the test example, the video of the last interaction in the training set as the validation set example, and the rest for training. Select the knowledge concepts corresponding to the videos in the validation set and the videos in the test set that learners have not yet interacted with to test learners' preferences for knowledge concepts. Construct a bipartite graph based on the video-concept relationship in the dataset. As a learning resource map.
[0064] Step 1.2) Based on the video-concept bipartite graph obtained in Step 1.1), a graph attention network (GAT) is built: The GAT module dynamically captures and aggregates the weights between nodes through a learnable attention mechanism. The core formula for attention weight normalization can be expressed as:
[0065] (1)
[0066] in, Let be the weight between node i and node j. For the activation function, this embodiment uses the LeakyReLU activation function. Here are trainable parameters, where This refers to the softmax function, which is used here to calculate the proportion of node j among the neighboring nodes of node i. This represents the importance prediction tensor of node j to node i. Represent the characteristics of node i. Representing the characteristics of node j, denotes the k-th neighbor of node i in the neighbor set .
[0067] For the video-concept relation, define as the adjacency matrix of course-concept, denotes the bipartite graph incidence matrix of course-video. Therefore, the GAT module can be represented as:
[0068] ; (2)
[0069] where, and are the video and concept features extracted by the GAT module; is used to define the GAT function; is the embedding of the video obtained by ID matching, which is initialized by a random normal distribution; is the knowledge concept definition encoded by the Sentence-Bert sentence embedding model SBert; the knowledge concept definition is enhanced by the DeepSeek-v3 model; is used to define the linear function of dimension alignment; is the video-concept neighbor matrix with self-connection, is the identity matrix.
[0070] Step 2) Build a sequence recommendation model: this embodiment uses the SASRec (Self-Attention-based Sequential Recommendation) model as the basic model to model the interaction sequence based on the learning resource features obtained in step 1) to capture the temporal dependency between knowledge concepts, and calculate the interest score of the learner and the learning resource. The structure of the SASRec model is similar to the encoder part of the Transformer, and each encoding block includes a self-attention layer and a feed-forward neural network (FFN).
[0071] Step 2.1) Extract sequence features: first, define the learner sequence as , the next interaction video of the sequence, and the corresponding knowledge concept set ; second, define the input node features and of the sequence model, and the residual connection is used to represent the input feature of the video and the concept as:
[0072] ; (3)
[0073] ; (4)
[0074] where, denotes the sequence of interactions of all learners on the video, denotes the length of the sequence of interactions of learner u on the video.
[0075] Step 2.2) Feature mapping: mapping features to learner sequences by course ID and concept ID and the set of knowledge concepts ; the learner sequence combines the position encoding to obtain the predicted sequence latent feature after the self-attention network of the SASRec model .
[0076] Step 3) Building a multi-objective optimization loss function: designing a target function from two perspectives of learner preference perception on videos and knowledge concepts to optimize the sequence recommendation model, thereby generating high-quality collaborative features.
[0077] Step 3.1) Video preference loss: given a learner sequence , the videos in the sequence are taken as positive examples, and the same number of videos not watched by the learner are taken as negative examples, and the video prediction task is modeled as a binary classification problem. The binary cross-entropy loss function is calculated as:
[0078] ; (5)
[0079] wherein is the positive and negative example set of the interactive video in the sequence , refers to the positive example, refers to the negative example. is the predicted score, which is used to calculate the interest score between the learner and the video, by dot product of the learner feature and the video feature ;
[0080] Step 3.2) Knowledge concept preference loss: given a learner sequence , the concepts related to the next interactive video in the sequence are taken as positive examples, and the same number of concepts not watched by the learner are taken as negative examples. The learner feature is the latent embedding of the last interactive item of the sequence prediction feature . The Bayesian personalized ranking loss is calculated as:
[0081] ; (6)
[0082] wherein is the interest score between the learner and the concept, obtained by dot product of the learner feature and the concept feature, as the appearance of the triple in the video corresponding learner-concept interaction dataset , respectively referring to the learner, the concept positive example and the concept negative example.
[0083] Step 3.3) Define the final loss function: The final loss function of the sequence model SASRec can be represented as:
[0084] (7)
[0085] wherein, is a hyperparameter for controlling the contribution of the two loss functions; is a hyperparameter of the L2 norm, is a set of model trainable parameters. The optimization of the model uses the Adam optimizer.
[0086] Step 4) Design a mixed prompt template: As shown in Figure 2 , the collaborative features generated by the sequence model in step 3) are mapped to the text semantic space of the large language model LLM through a projector to construct a mixed prompt template to guide the LLM inference.
[0087] Step 4.1) Mixed template definition: As shown in Figure 3 , the prompt template is defined in a natural language manner, which contains four special tokens, namely <user_des>, <video_des>, <current_des>, and <concept_des>. Among them, <user_des> is used to replace the preference features of the learner, <video_des> is used to replace the video features, <current_des> is used to replace the concept features of recent interactions, and <candidate_des> is used to replace the features of candidate knowledge concepts. The knowledge concept features are replaced using a mixed form of text features and collaborative features, i.e., the token corresponding to the knowledge concept title plus the knowledge concept collaborative feature.
[0088] Step 4.2) Projection mapping: A gated MLP layer GMLP is introduced to enhance the ability to capture nonlinearity during feature mapping through a dynamic feature modulation mechanism. The core formula is represented as:
[0089] (8)
[0090] wherein, is the lower projection weight, is the gated projection weight, is the upper projection weight, is the element-wise multiplication, is the activation function, and in this embodiment, the SiLU activation function is used.
[0091] Step 5) Constructing Token-level loss function and learning resource contrastive learning training LLM: training the inference ability of LLM only from the valid token set of the dataset, and alleviating the only knowledge concept target optimization through learning resource contrastive learning. In addition, a curriculum learning strategy is introduced to train the ability of LLM to generate recommendations. The training loss function of the large language model is:
[0092] ;
[0093] where β is a hyperparameter ranging from 0 to 1, is the valid token loss function, is the video contrast loss.
[0094] Step 5.1) Valid token loss function: convert the title of the knowledge concept in the dataset into tokens as the valid token set through the tokenzier tokenizer; then use the prefix tree to represent the horizontal and vertical relationships of the tokens representing the knowledge concept title tokens in the valid tokens, with the horizontal representing the front-back dependency relationship and the vertical representing the tokens with the same prefix relationship. Introduce MSL mask softmax loss function to calculate the loss loss, the core formula is as follows:
[0095] ; (9)
[0096] where, is the token of the positive example, is the token with the same prefix, in order to alleviate the gradient vanishing problem, the temperature coefficient is adaptively regulated, and is controlled within a reasonable range through pruning means; represents the probability of LLM predicting token , from the valid token set , represents the probability of LLM predicting token , represents the parameters of LLM, represents the text content before LLM predicts the next token, represents the next token that LLM needs to predict.
[0097] Step 5.2) Introducing video contrast loss: In order to prevent the model from being trained in an environment with only knowledge concepts as the target, a contrast method is set for the video. By taking the dot product of the learner features obtained by the current sequence and the video features of the next item interaction as the prediction score, the next real interaction is compared with the learner's current non-interaction video set, and the core formula can be represented as:
[0098] ; (10)
[0099] wherein, denotes the learner embedding mapped to the LLM, is the video feature, is the set of videos that the learner has never interacted with, denotes the fixed temperature coefficient, is the learner, is the feature of video j that the learner has never interacted with mapped to the LLM, is the student interaction sequence the feature of the positive example video of the next interaction, is the set of learners.
[0100] Step 5.3) Introduce course learning strategy to train LLM: Divide the LLM training task into two tasks, simple and difficult, through course learning. The mixed prompt design of the simple task contains learner features, video features, and text features of knowledge concepts, and the mixed prompt design of the difficult task contains learner features, video features, collaborative features of knowledge concepts, and text features. Formally, the prompt set designed in course learning is shuffled, and simple prompts and difficult prompts are mixed in percentage form, and then the LLM is trained from simple to difficult. This progressive learning method helps the LLM understand the sequence features and the text features of the knowledge concepts, and then understand the collaborative features.
[0101] Step 6) Generate a recommendation list: Store the title of the candidate obtained by retrieving the ID-based sequence recommendation model using a prefix tree, and then the LLM obtains the predicted score of each candidate through beam search, and selects the top K candidates to construct the final recommendation list.
[0102] Step 6.1) Select candidate: Given the learner sequence , obtain the sequence prediction feature and the learner feature by encoding the SASRec model, and perform similarity matching with the knowledge concept feature , and finally obtain the predicted score matrix of the learner to the knowledge concept :
[0103] ; (11)
[0104] Then, filter out the knowledge concepts that the learner has already interacted with:
[0105] ; (12)
[0106] wherein, is the multi-hot tensor of the knowledge concepts interacted by the learner, and is obtained by Sort and select the top K as candidates.
[0107] Step 6.2) Reordering: The candidate obtained in step 6.2) and the learner characteristics, the video characteristics of the learner's recent interaction and the concept characteristics are injected into the mixed prompt to generate the final result by the LLM. In order to ensure that the generated text is consistent with the label format in the data set and accurately obtain the predicted score of each candidate, the candidate is stored through the prefix tree, and the generation probability of each candidate is calculated based on the beam search algorithm, which is taken as the predicted score, and finally a recommendation list is constructed.
[0108] The method of the application is verified by specific experiments.
[0109] In the experiment, the parameters of SASRec are set to learning rate 1e-3, batch 128, embedding dimension 256, recent sequence length 50, bert dimension 1024, multi-attention head 1, block 2; the parameters of LLM are set to learning rate 1e-4, batch 12, token dimension 1536, intermediate dimension 1536, sequence truncation length 1024, dropout rate 0.1, video sequence length 10, and the number of recent concepts is 20. The Lora configuration is set to rank 8, scaling factor 32, dropout rate 0.05, and target module QV. During the training process, the QLora quantization technology is used for efficient fine-tuning of parameters, and the precision is 8 bits. The data set is MOOC Cube.
[0110] The method of the application is compared with BPRMF, LightGCN, SASRec, LRURec, ALLMRec and LLaRA algorithms, and the experimental results are shown in Table 1. As shown in Table 1, the application is better than the traditional model and the current sequence method based on LLM.
[0111] Table 1 Performance comparison of the application and existing algorithms
[0112]
[0113] In summary, the application uses a combination of a traditional sequence model and a large language model to capture the sequence characteristics of learners: the traditional sequence model configures a multi-target optimization graph attention network to extract sequence characteristics and avoid observing knowledge concept interaction sequences; the large language model configures a mixed prompt and a projector to adapt to the ranking task from the token level through multi-target optimization and alleviate the deviation of the linear layer in capturing features caused by a single target.
Claims
1. A knowledge concept sequence recommendation method based on a large language model, characterized in that, Includes the following steps: Obtain the MOOC dataset; A graph attention network is constructed based on the learning resource graph between MOOC videos and knowledge concepts to extract features from videos and knowledge concepts. A sequence recommendation model is constructed based on the video and knowledge concept features to calculate the learner's interest score with the knowledge concept and rank the retrieval candidates; the loss function of the sequence recommendation model considers two perspectives: the learner's perceived preference for the video and the learner's perceived preference for the knowledge concept. The collaborative features generated by the sequence recommendation model are mapped to the text semantic space of the large language model to construct a hybrid prompt template to guide LLM inference; the hybrid prompt template includes four types of tokens, namely learner preference features, video features, recent interaction concept features, and candidate features; The reasoning ability of a large language model is trained from a valid set of tokens in a MOOC dataset. The learner sequence to be recommended is input into the sequence recommendation model, and the candidate items and their collaborative features retrieved by the sequence recommendation model are input into the trained large language model to obtain the final recommendation list.
2. The knowledge concept sequence recommendation method based on a large language model according to claim 1, characterized in that, Training large language models using curriculum learning strategies, including: Through course learning, the training task of large language model is divided into two types of tasks: simple and difficult. The mixed prompt design for simple tasks includes learner features, video features, and text features of knowledge concepts. The mixed prompt design for difficult tasks includes learner features, video features, collaborative features of knowledge concepts, and text features. The set of hints designed in the course is shuffled, and easy and difficult hints are mixed in percentage form. Then, LLM is trained from easy to difficult.
3. The knowledge concept sequence recommendation method based on a large language model according to claim 1, characterized in that, A bipartite graph is constructed based on the video-concept relationship in the MOOC dataset as a learning resource graph; a graph attention network is then built on the video-concept bipartite graph.
4. The knowledge concept sequence recommendation method based on a large language model according to claim 3, characterized in that, Graph attention networks dynamically capture and aggregate the weights between nodes through a learnable attention mechanism. The normalized representation of the attention weights is as follows: ; in, Let i be the weight between node i and node j. For activation function, Here are trainable parameters, where The softmax function is used to calculate the weight of node j among the neighboring nodes of node i. This represents the importance prediction tensor of node j to node i. Represents the characteristics of node i. Representing the characteristics of node j, This indicates that node i is in the neighbor set. The k-th neighbor; For video-concept relationships, define For the adjacency matrix of courses and concepts, The course-video bipartite graph association matrix is used; therefore, the graph attention network is represented as: ; in, and These are the video and knowledge concept features extracted using a graph attention network; Used to define GAT functions; The embeddings obtained from video ID matching are initialized using a random normal distribution; The knowledge concept definition is obtained through Sentence-Bert sentence embedding model SBert encoding; Linear functions used to define dimension alignment; For a video-concept neighbor matrix with self-connectivity, It is an identity matrix.
5. The knowledge concept sequence recommendation method based on a large language model according to claim 1, characterized in that, A sequence recommendation model is constructed based on the SASRec model as the base model and the video and knowledge concept features.
6. The knowledge concept sequence recommendation method based on a large language model according to claim 5, characterized in that, The sequence recommendation model includes: Define the learner sequence as The video of the next interaction in the sequence The corresponding set of knowledge concepts is Secondly, define the input node features of the sequence model. and Residual connections are used for the input features of videos and concepts, represented as follows: ; ; Then, the features are mapped to learner sequences using course IDs and concept IDs. and collection of knowledge concepts In the middle; learner sequences combined with positional encodings are processed through a self-attention network of the SASRec model to obtain the latent features of the predicted sequence. ; in, This represents the sequence of interactions among all learners regarding the video. This represents the length of learner u with respect to the video interaction sequence.
7. The knowledge concept sequence recommendation method based on a large language model according to claim 1, characterized in that, The loss function for the sequence recommendation model is: ; in, These are hyperparameters used to control the contributions of the two loss functions; For L2 paradigm hyperparameters, For the set of trainable parameters of the model, For video preference loss, For knowledge concept preference loss; Given a learner's interaction sequence Sequence prediction features are obtained through sequence recommendation model encoding. The learner features are the predicted features of the last interaction item in the sequence. First, calculate , convert the sequence The videos in the list are used as positive examples, and the same number of videos that the learners have not watched are used as negative examples. The video prediction task is modeled as a binary classification problem: ; in, For sequence The set of positive and negative examples of interactive videos in China. Correction example, Refer to negative examples. To predict scores, interest scores between learners and videos are calculated using dot product learner features. and video features ; Then, calculate , convert the sequence The concept associated with the last video in the interaction is taken as a positive example, and the same number of concepts not interacted with by the learners are taken as negative examples. The concept prediction task is modeled as a positive and negative example ranking loss problem: ; in, Interest scores between learners and concepts are obtained through the dot product of learner features and concept features. As a learner-concept interaction dataset corresponding to the video The triples in the text refer to the learner, the positive example of the concept, and the negative example of the concept.
8. The knowledge concept sequence recommendation method based on a large language model according to claim 1, characterized in that, The loss function of the large language model includes an effective token loss function and a video contrast loss: ; Where β is a hyperparameter ranging from 0 to 1. For the effective token loss function, For video contrast loss; Effective token loss function The tokenizer converts the titles of knowledge concepts in the dataset into tokens, which form a valid set of tokens. Then, a prefix tree is used to represent the horizontal and vertical relationships between knowledge concept title tokens in the valid tokens. The horizontal relationship represents the dependencies between tokens, and the vertical relationship represents tokens with the same prefix. The MSL mask softmax loss function is introduced to calculate the loss. The core formula is as follows: ; in, It is a positive example token. These are tokens with the same prefix. To mitigate the vanishing gradient problem, the temperature coefficient is... Adaptive adjustment is performed, and the results are controlled within a reasonable range through trimming techniques. Indicates LLM predicts tokens The probability, From the set of valid tokens , Indicates LLM predicts tokens The probability, The parameters representing LLM, This indicates that LLM predicts the text content preceding the next token. This indicates the next token that needs to be predicted in the LLM; Video contrast loss By using student interaction sequences The predicted score is obtained by taking the dot product of the learned learner features and the video features of the next interaction. This score is then compared with the set of videos where the learner has not yet interacted with the actual next interaction. The core formula can be expressed as: ; in, Refers to the learner embedding mapped to the LLM. For video features, A collection of videos that learners have never interacted with. Refers to a fixed temperature coefficient. A learner Mapping the features of video j (where the learner did not interact) to LLM. Student interaction sequence The characteristics of the next positive example video for interaction, For learners.
9. A knowledge concept sequence recommendation system based on a large language model, characterized in that, include: The model building and training unit is used to acquire MOOC datasets; A graph attention network is constructed based on the learning resource graph between MOOC videos and knowledge concepts to extract features from videos and knowledge concepts. A sequence recommendation model is constructed based on the video and knowledge concept features to calculate the learner's interest score with the knowledge concept and rank the retrieval candidates; the loss function of the sequence recommendation model considers two perspectives: the learner's perceived preference for the video and the learner's perceived preference for the knowledge concept. The collaborative features generated by the sequence recommendation model are mapped to the text semantic space of the large language model to construct a hybrid prompt template to guide LLM inference; the hybrid prompt template includes four types of tokens, namely learner preference features, video features, recent interaction concept features, and candidate features; The reasoning ability of a large language model is trained from a valid set of tokens in a MOOC dataset. The recommendation unit is used to input the sequence of learners to be recommended into the sequence recommendation model, and input the candidate items and their collaborative features retrieved by the sequence recommendation model into the trained large language model to obtain the final recommendation list.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the knowledge concept sequence recommendation method based on a large language model according to any one of claims 1-8.