Text sequence recommendation method and system based on large language model

Through a multi-stage processing method based on a large language model, the problem of insufficient use of text information and large model hallucinations in sequence recommendation is solved, and more accurate and efficient text sequence recommendation is achieved.

CN119760120AActive Publication Date: 2025-04-04JINAN UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411660991.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-04-04
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

In the prior art, in the sequence recommendation scenario, there are insufficient use of text information in historical behavior information, misalignment with the recommendation algorithm space of the behavior sequence pattern and hallucination problems in the recommendation task, resulting in inaccurate recommendations.

Method used

The text sequence recommendation method based on large language models is adopted, and the semantic space and vector space are optimized to alleviate the hallucination problem of large models in recommendation tasks through data preprocessing, large language model pretraining, sequence model fine-tuning and matching stages.

Benefits of technology

Effectively utilize text information in historical behavior information to enhance the understanding of user preferences and recommendation accuracy, alleviate the hallucination problem of large language models in recommendation tasks, and improve the performance of text sequence recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760120A_ABST
    Figure CN119760120A_ABST
Patent Text Reader

Abstract

The invention discloses a text sequence recommendation method and system based on a large language model, and belongs to the technical field of recommendation algorithms, and the method comprises a data preprocessing stage, a large language model pre-training stage, a sequence model fine tuning stage and a matching stage. According to the method, the large language model is introduced into the text sequence recommendation task, so that rich pre-training corpora of the large language model can be utilized, and the text can be better modeled; meanwhile, sequence modeling is carried out on the text, the capacity of sequence recommendation modeling in a large model is activated, an ID-based recommendation normal form in a traditional recommendation algorithm is eliminated, and recommendation task learning processing is better carried out in a cold start scene and a knowledge migration scene; and finally, the recommendation result is finally optimized through the sequence model, so that the problem that an output result of a conventional large language model has illusion and cannot be accurately matched can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of recommendation algorithms, and in particular to a text sequence recommendation method and system based on a large language model. Background Art

[0002] In recent years, with the rapid development of computer technology, the Internet and related industries, a huge amount of text-based data is generated on the Internet every day, showing the characteristics of big data. At the same time, artificial intelligence content generation technology is also developing rapidly, further accelerating the emergence of data information. How to quickly filter out the content that everyone is really interested in from such a huge amount of data has promoted the research of recommendation systems. Recommendation system is a technology that uses user behavior data and text information to provide users with personalized recommendations. It analyzes the user's historical behavior and text features, uses algorithm models to predict the content that the user may be interested in, and recommends it. This type of system is widely used in text-based fields, such as news push, e-book recommendation, academic article retrieval, etc., aiming to improve user experience, enhance user stickiness, and promote the effective dissemination of content. The development of recommendation systems not only has an important impact on users and enterprises, but also provides rich practical opportunities for research and application in the fields of information technology and artificial intelligence.

[0003] As an important scenario in recommendation systems, sequence recommendation has always received widespread attention. In recommendation systems, the temporal information of user behavior is crucial. For the prediction of the user's next behavior, whether the past behavior sequence can be effectively utilized is directly related to the accuracy of the recommendation and the user experience. The key to solving the problem of sequence recommendation is to infer the user's preferences from the historical behavior sequence through a series of technical means, and to make personalized recommendations or searches based on the behavior sequence. In the sequence recommendation scenario, the existing methods have the problem that the logic of ID encoding does not fully utilize the text information in the historical behavior information, the behavior sequence pattern is not aligned with the recommendation algorithm space, and the use of large language models will also lead to inaccurate recommendations due to the large language hallucination problem. Summary of the invention

[0004] In order to solve the above problems, the purpose of the present invention is to provide a text sequence recommendation technology based on a large language model, aiming to overcome the insufficient utilization of historical text content information in the text sequence recommendation scenario, by activating the ability of large language model sequence recommendation, and optimizing in semantic space and vector space at the same time, thereby alleviating the impact of the hallucination problem of large models in recommendation tasks, thereby obtaining better recommendation effects.

[0005] In order to achieve the above technical objectives, the present application provides a text sequence recommendation method based on a large language model, which includes the following stages:

[0006] Data preprocessing stage: Convert the historical text sequence data clicked by the user into a set of attribute key-value pairs to construct a dataset for large model training;

[0007] Pre-training stage of the large language model: Construct the dataset into a prompt training set for the large language model, convert the sequential recommendation task into a natural language task and then perform model training to obtain the best text sequence recommendation results at the semantic space level;

[0008] Fine-tuning stage of the sequence model: Optimize the results based on the large language model in the sequential recommendation task by fine-tuning the sequence model;

[0009] Matching stage: Based on the processing results of the large language model stage and the sequence model stage, match the text content in the embedding vector space dimension and output the results of sequential recommendation.

[0010] Preferably, in the data preprocessing stage, the historical text sequence data is processed by removing punctuation marks, removing HTML tags, removing stop words, removing extra spaces, and lemmatization;

[0011] Construct the processed data into a format including attribute keys and values, sort it in reverse order according to the interaction time, and select the interaction sequences with more than 5 interactions as the dataset.

[0012] Preferably, in the pre-training stage of the large language model, construct a missing corpus prompt dataset by obscuring the value in a certain sequence in the interaction sequence;

[0013] Construct a contrastive learning prompt dataset according to the user interaction text data and the non-interacted text data;

[0014] According to the missing corpus dataset and the contrastive learning prompt dataset, divide them according to the ratio of training set: validation set: test set of 8:1:1 to construct a prompt training set.

[0015] Preferably, in the pre-training stage of the large language model, use a low-rank matrix as a supplement to the fine-tuning parameters of the large model, and merge the original parameters with the parameters of the low-rank matrix to form the overall parameters of the large language model for model training.

[0016] Preferably, in the pre-training stage of the large language model, the goal of training the large model is:

[0017]

[0018] In the formula, x represents the given task, y t is the output of the large model, and y<t represents the output content between the large model output y t and P u represents the overall parameters of the large language model.

[0019] Preferably, during the sequence model fine-tuning stage, Langformer is used as the sequence model to prevent excessively long interaction sequences from affecting the calculation results and to speed up the calculation efficiency of the attention mechanism.

[0020] Preferably, in the sequence model fine-tuning stage, a reference vector is selected, and a vector obtained after training with the large language model is used as a positive sample of the reference vector, and a vector obtained without training with the large language model is used as a negative sample of the reference vector;

[0021] Based on the benchmark vector, according to the positive samples and negative samples, by setting the perturbation factor, a contrastive learning Loss function is constructed for fine-tuning the downstream tasks. The contrastive learning Loss function is expressed as:

[0022]

[0023] In the formula, E final represents the base vector, represents a positive sample, represents negative samples, α1 represents the perturbation factor, L c Represents contrastive learning Loss function.

[0024] Preferably, in the process of fine-tuning the downstream task, the multilayer perceptron is used as the downstream task and is transferred using the cross entropy Loss, where the cross entropy Loss is expressed as:

[0025]

[0026] Where n is the number of samples, y i For real click behavior, if clicked, it is 1, if not clicked, it is 0. is the predicted probability output by the model;

[0027] For the sequence model, the fine-tuned overall Loss function is: L = L b +L c .

[0028] Preferably, in the matching stage, the text data to be recommended is obtained, reasoning is performed through the large model, the output result of the large model is obtained, and the embedding vector set of the text data to be recommended is reasoned with the downstream task model, and the final text recommendation is performed based on the cosine similarity between the inference result and the vector in the embedding vector set to be recommended.

[0029] The present invention discloses a text sequence recommendation system based on a large language model, which is used to execute the above-mentioned text sequence recommendation method based on a large language model. The system comprises:

[0030] The data preprocessing module is used to convert the historical text sequence data of user clicks into a set of attribute key-value pairs to construct a data set for large model training;

[0031] The large language model pre-training module is used to construct the dataset into a prompt word training set for the large language model, convert the sequence recommendation task into a natural language task, and then perform model training to obtain the best text sequence recommendation results at the semantic space level;

[0032] The sequence model fine-tuning module is used to fine-tune the sequence model so that the results based on the large language model are optimized in the sequence recommendation task;

[0033] The matching stage module is used to match the text content in the embedding vector space dimension based on the processing results of the large language model stage and the sequence model stage, and output the sequence recommendation results.

[0034] The present invention discloses the following technical effects:

[0035] The present invention can optimize the text sequence recommendation function by introducing a large language model, and utilize the more sufficient training corpus of the large language model to enhance the utilization of text information in historical behavior information; at the same time, based on contrastive learning and sequence construction prompts, it stimulates the sequence recommendation ability of the large language model. In view of the previous problems of misalignment between sequence patterns and recommendation algorithm space, as well as large language model hallucination, the present invention introduces a sequence model to perform fine-tuning optimization at the vector level, which can effectively match different spaces, and fit through vectors, which alleviates the problem of large language model hallucination and effectively improves the performance of text sequence recommendation. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 is a flowchart of the steps of the method described in the present invention;

[0038] Figure 2 is a schematic diagram of training data processing according to the present invention;

[0039] Figure 3 is a schematic diagram of the large language model training process described in the present invention;

[0040] Figure 4 is a schematic diagram of fine-tuning the sequence model of the present invention;

[0041] Figure 5 It is a schematic diagram of the sequence recommendation result matching described in the present invention. DETAILED DESCRIPTION

[0042] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0043] like Figure 1-5 As shown, the main steps of the text sequence recommendation algorithm technology based on a large language model provided by the present invention are: training data preprocessing, training a large language model, fine-tuning the sequence model, and matching sequence recommendation results; specifically, it includes the following contents:

[0044] S1. Training data preprocessing:

[0045] Based on the text content clicked by the user, the historical text sequence data of the user's click is constructed, and the recommended sequence text dataset required in the subsequent steps is constructed by converting it into a set of attribute key-value pairs. Each text is represented by an attribute dictionary, which includes different attribute feature information of the text. The processing process is finally as follows Figure 2 shown.

[0046] S1.1 Training data preprocessing:

[0047] Process the collected training data, including removing punctuation: remove punctuation in the text to reduce noise. Remove HTML tags: If the captured text contains HTML tags, use regular expressions or HTML parsers (such as BeautifulSoup) to clean it up. Remove stop words: Stop words (such as "the", "is", etc.) may not be helpful for the task, delete these words to reduce the input dimension. Remove extra spaces: There may be extra spaces or line breaks in the text, which are cleaned up uniformly. At the same time, perform lemmatization: restore the words to the dictionary form, for example, "running" becomes "run". You can use the lemmatization tool in spaCy or NLTK.

[0048] S1.2 Text sequence key-value pair dataset construction:

[0049] Based on the data processed in step S1.1, a text sequence key-value pair dataset is constructed according to the task. For the text data clicked by the user, its data is constructed as a dictionary value of {attribute key 1: value 1; attribute 2: value 2; ...; attribute key n: value n}, represented as D. For the attribute key and value of the i-th position, Keyi and Value i For a user, the text sequence he has interacted with is composed of D sequences, which are recorded as Seq (D∈Seq). The overall data processing flow is as follows: Figure 1 As shown in the figure, for each user, the length of their interaction sequence is not necessarily the same. In order to reduce the impact of insufficient interaction on model training, interaction sequences with more than 5 interactions are selected as the final dataset.

[0050] S2. Training large language model:

[0051] like Figure 3 As shown, based on the data set obtained in step S1, a prompt word training set of a large language model is constructed, the sequence recommendation task is converted into a natural language task, and the large language model is pulled in for training to obtain the best text sequence recommendation result at the semantic space level.

[0052] S2.1 Large language model acquisition:

[0053] Large language models are usually divided into open source and paid. Open source ones are usually model weights, such as Meta's L1ama series and Alibaba's Qwen series; paid models are usually called through API interfaces, such as OpenAI's ChatGPT series. This invention takes the L1ama series as an example, and the other large language models can be slightly adjusted, and the obtained original large model parameters are represented as L0.

[0054] S2.2 Construction of large language model training prompt word dataset

[0055] The dataset constructed in step S1.2 is used to construct the large model prompt words. The missing corpus prompt dataset is constructed by masking the value in a certain sequence in the interaction sequence, which is recorded as C. q Blocking certain content in the sequence and letting the big language model complete it can significantly improve the big language model's ability to learn the sequence content. mask ∈C q , the characteristics of its construction are as follows:

[0056] Q: Users have interacted with the following text content. The content sorted in reverse order of interaction time is [Seq mask ], please predict the missing content;

[0057] A: The complete sequence data of user interaction is [Seq];

[0058] In the above content, Seqmas k It is a text interaction sequence to be completed after masking certain positions, and Seq is a complete text sequence of user interaction.

[0059] Construct a comparative learning prompt dataset based on user interaction text data and non-interaction text data, denoted as C c By constructing contrastive learning prompts at the text level, the core idea of ​​contrastive learning, “bringing similarities closer and dissimilarities further apart”, is instilled into the large language model through natural language. Cc ∈C c , the characteristics of its construction are as follows:

[0060] The user clicks on the item [D i ], and clicked on the item [D j ], but it does not click on the item [D k ];

[0061] The missing corpus dataset and the comparative learning prompt dataset are divided into training set: validation set: test set ratio of 8:1:1. The training set, validation set, and test set are represented by T cq , T cc 、V cq , V cc 、T cq , T cc To express.

[0062] S2.2 Train a large language model based on the prompt dataset:

[0063] For the original large model L o , it is a time-consuming and labor-intensive task to fully train its parameters. In order to facilitate fine-tuning training, a low-rank matrix is ​​used as a supplement to the fine-tuning parameters of the large model. The principle of the LoRA method is to use rank decomposition, and then merge the trained parameters with the original parameters of the large model. Since the parameters of the original model are not trained, only a few parameters are needed to approach the effect of the original training of all parameters. The original parameters of the large language model are recorded as P o , the parameter of the low-rank matrix after training is P l . Change the original parameter P o and the parameter P of the low-rank matrix l After merging, the overall parameter of the large language is expressed as P u , which can be expressed by the following formula: u =P o +P l .

[0064] The overall task of step S2 is to make the trained large language model L t The output y t Be able to do as much as possible in the given task x and in the output y t Previous output content y <t , which can maximize the output yt. Its overall optimization goal is shown in the following formula:

[0065]

[0066] S2.3 Get the original text interaction embedding vector:

[0067] Based on the text attribute key-value pair dictionary D constructed in step S1.2, it is input into the large language model L trained in step S2.2 t In the example, since the original structure of the large language model is a multi-layer Transformer structure, we refer to the structure of the Transformer model and take the vector output by its embedding layer as D in the model L. t Attribute key value embedding vector E under model encoding d , the process can be expressed as follows:

[0068] E d =L t (D);

[0069] This is convenient for subsequent fine-tuning of the sequence model. Based on the data sequence Seq in step S1.2 and the attribute key-value pair dictionary D, based on the trained large language model L t To sequence training embedding vector E seq , the training process can be expressed as follows:

[0070] E seq =L t (Seq(D1, D2, ..., D n ));

[0071] S3. Fine-tuning sequence model:

[0072] In order to align the sequence recommendation results at a more fine-grained level, the sequence model of the prediction sequence task is fine-tuned based on the dataset constructed in step S1 using the text embedding vector output by the large language model trained in step S2 to enhance the sequence prediction information at the embedding vector level and reduce the impact of the large language model output hallucination on the final result. The overall process is as follows: Figure 4 shown.

[0073] S3.1 Initialize the sequence model tensor:

[0074] For the sequence model, to prevent the influence of overly long interaction sequences on the calculation results and to accelerate the calculation efficiency of the attention mechanism, Langformer is selected as the sequence model in the present invention. Its structure is similar to that of the traditional Transformer model, but the attention layer mechanism is optimized, converting the traditional self-attention module into a sliding window attention module. The sliding window attention module stipulates that each token can only see a set number w of tokens in the window. Therefore, its complexity is reduced from O(n 2 ) to O(n*w) where w << n. For the sequence model Langformer, the sequence model trained in step S2.3 is used as its initial embedding vector. Before the initial embedding vector, the initial embedding vector of the sequence identifier [CLS] is added where n is the size of each training batch and m is the vector dimension when initializing E cls , and its value is randomly initialized. After the final initialization, the model tensor E init can be expressed as:

[0075] E init = E cls || E seq ;

[0076] After the initialized vector is trained and fitted by Langformer, the Langformer output vector E final is obtained.

[0077] S3.2 Fine-tuning the downstream task based on the sequence model:

[0078] For the sequence model, based on the tensor initialized in step S3.1, the downstream task is fine-tuned. The downstream task is mainly the matching score Score output between the embedding vector E final output by the sequence model and the attribute key-value embedding vector obtained in the previous step S2.3. For each user U i , the fine-tuning training steps are as follows:

[0079] - Take the embedding vector E final after training in step S3.1 as the reference vector

[0080] - Take the dictionary D i of the interaction text attribute key-value pairs of user U k after the training sequence, and the vector t obtained after training in the large language model L as the positive sample comparison for the reference vector E final

[0081] - Take user U i ​The interactive text attribute key-value pair dictionary D that is not performed in the entire text data k , in the large language model L t The vector obtained after training As the reference vector E final Negative sample comparison

[0082] -Select 1 positive sample and h negative samples, construct a contrastive learning Loss function for learning, and compare the learning Loss function L c As shown in the following formula, α1 is the disturbance factor:

[0083]

[0084] The downstream task model here can use a multi-layer perceptron. In the present invention, the downstream task model adopts a four-layer structure. Specifically, the first layer is a linear layer, and the dimensional space is Among them, m and n are the input feature dimension size and output feature dimension size respectively. The second layer is a nonlinear layer, and the activation function is the tanh function. The third layer is a linear layer, and the dimension space is Where k is the attribute key-value pair dictionary vector E output from the large language model D The dimensions are the same; the fourth layer calculates E final With E D The score is then transferred through cross entropy Loss, which can be expressed as follows:

[0085]

[0086] Where n is the number of samples, y i For real click behavior, if clicked, it is 1, if not clicked, it is 0. is the predicted probability output by the model.

[0087] For the sequence model, the fine-tuned overall Loss function is: L = L b +L c .

[0088] S4.Sequence recommendation result matching:

[0089] For users who need to be predicted, their historical interaction sequences are generated according to step S1, and prompt words are constructed at the same time. The prompt word interaction is performed on the model in S2 after training to obtain the output recommendation results. The recommendation results are then input into the sequence model to generate the embedded text vector for final retrieval. Matching is performed in the vector database based on the embedded text vector, and the K bits with the highest matching scores are output as the recommendation results.

[0090] S4.1 Recommended data collation:

[0091] For the text data to be recommended, organize it into the attribute key-value pair form required for model input according to step S1.1, and construct the prompt use case required by the large model according to step S2.2.

[0092] S4.2 Large Model Reasoning:

[0093] Construct the prompt Prompt using the prompt use cases organized in step S4.1 final as follows:

[0094] The following is a sequence of text content data [Seq] with which the user has interacted. Please output the text content that the user may have interacted with in the format of {attribute key 1: attribute value 1, ..., attribute key n: attribute value n}, taking into account the content that may appear at the same time as the content that the user has interacted with, and avoid content that is unlikely to appear at the same time.

[0095] Take {attribute key 1: attribute value 1, ..., attribute key n: attribute value n} in the final output as the text recommendation result output by the large language model, and use rep fianl to represent it and input it into the large language model L as input data t , and get its sequence embedding vector representation At the same time, all the text data attribute key-value pairs dictionary D to be matched are input into the large language model L t , and its embedding vector is represented as E D , and store it in the vector database.

[0096] S4.2 Sequence model downstream task matching:

[0097] For the large model output obtained in step S4.2 And the embedding vector set C to be recommended emd , use the downstream task model for reasoning to obtain its final representation embedding vector E ult . Calculate the cosine similarity between it and the vector in the embedding vector set to be recommended, and select the k with the highest similarity for the final text recommendation. The process can be expressed as follows:

[0098]

[0099] Final rep =TopK(Sim)

[0100] Final in the above formula rep Represents the final recommended result.

[0101] By introducing a large language model into the text sequence recommendation task, the present invention can utilize the rich pre-trained corpus of the large language model to better model the text; at the same time, by performing sequence modeling on the text, the ability of the large model for sequence recommendation modeling is activated, breaking away from the ID-based recommendation paradigm in the traditional recommendation algorithm, and better performing recommendation task learning and processing in cold start scenarios and knowledge transfer scenarios; finally, through the final optimization of the recommendation results by the sequence model, the problem of hallucinations and inability to accurately match the output results of the previous large language model can be solved.

[0102] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0103] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0104] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A text sequence recommendation method based on a large language model, characterized in that: The following phases are included: Data preprocessing stage: Convert the historical text sequence data of user clicks into a set of attribute key-value pairs to construct a data set for large model training; Large language model pre-training stage: construct the data set into a prompt word training set of the large language model, convert the sequence recommendation task into a natural language task, and then perform model training to obtain the best text sequence recommendation results at the semantic space level; Sequence model fine-tuning stage: By fine-tuning the sequence model, the results based on the large language model are optimized in the sequence recommendation task; Matching stage: Based on the processing results of the large language model stage and the sequence model stage, the text content is matched in the embedding vector space dimension and the sequence recommendation results are output.

2. The text sequence recommendation method based on a large language model according to claim 1, characterized in that: In the data preprocessing stage, the historical text sequence data is processed by removing punctuation marks, HTML tags, stop words, redundant spaces, and word form restoration; The processed data is constructed into a format including attribute keys and values, and is sorted in reverse order of interaction time, and interaction sequences with a number of interactions greater than 5 are selected as the data set.

3. The text sequence recommendation method based on a large language model according to claim 2, characterized in that: In the pre-training stage of the large language model, a missing corpus prompt dataset is constructed by masking the value in a certain sequence in the interaction sequence; Construct a comparative learning prompt dataset based on user interaction text data and non-interaction text data; According to the missing corpus dataset and the comparative learning prompt dataset, the prompt word training set is constructed by dividing them into a training set: a validation set: a test set ratio of 8:1:

1.

4. The text sequence recommendation method based on a large language model according to claim 3, characterized in that: During the pre-training stage of the large language model, a low-rank matrix is ​​used as a supplement to the fine-tuning parameters of the large model. The original parameters are merged with the parameters of the low-rank matrix to form the overall parameters of the large language model for model training.

5. The text sequence recommendation method based on a large language model according to claim 4, characterized in that: In the pre-training phase of the large language model, the goals of training the large model are: In the formula, x represents the given task, y t is the output of the large model, y<t means the output of the large model y t The output content between u Represents the overall parameters of the large language model.

6. The text sequence recommendation method based on a large language model according to claim 5, characterized in that: During the sequence model fine-tuning stage, Langformer is used as a sequence model to prevent excessively long interaction sequences from affecting the calculation results and to speed up the calculation efficiency of the attention mechanism.

7. The text sequence recommendation method based on a large language model according to claim 6, characterized in that: In the sequence model fine-tuning stage, a reference vector is selected, a vector obtained after training with a large language model is used as a positive sample of the reference vector, and a vector obtained without training with a large language model is used as a negative sample of the reference vector; Based on the reference vector, according to the positive sample and the negative sample, by setting the perturbation factor, a contrastive learning Loss function is constructed for fine-tuning the downstream task, wherein the contrastive learning Loss function is expressed as: In the formula, E final represents the base vector, represents a positive sample, represents negative samples, α1 represents the perturbation factor, L c Represents contrastive learning Loss function.

8. The text sequence recommendation method based on a large language model according to claim 7, characterized in that: In the process of fine-tuning the downstream task, the multi-layer perceptron is used as the downstream task and transferred using the cross entropy Loss, where the cross entropy Loss is expressed as: Where n is the number of samples, y i For real click behavior, if clicked, it is 1, if not clicked, it is 0. is the predicted probability output by the model; For the sequence model, the fine-tuned overall Loss function is: L = L b +L c .

9. The text sequence recommendation method based on a large language model according to claim 8, characterized in that: In the matching stage, the text data to be recommended is obtained, and reasoning is performed through the large model to obtain the output result of the large model and the embedded vector set of the text data to be recommended. The downstream task model is used for reasoning, and the final text recommendation is performed based on the cosine similarity between the reasoning result and the vector in the embedded vector set to be recommended.

10. A text sequence recommendation system based on a large language model, characterized in that: The system is used to execute a text sequence recommendation method based on a large language model as claimed in any one of claims 1 to 9, and the system comprises: The data preprocessing module is used to convert the historical text sequence data of user clicks into a set of attribute key-value pairs to construct a data set for large model training; A large language model pre-training module is used to construct the data set into a prompt word training set of the large language model, convert the sequence recommendation task into a natural language task, and then perform model training to obtain the best text sequence recommendation result at the semantic space level; The sequence model fine-tuning module is used to fine-tune the sequence model so that the results based on the large language model are optimized in the sequence recommendation task; The matching stage module is used to match the text content in the embedding vector space dimension based on the processing results of the large language model stage and the sequence model stage, and output the sequence recommendation results.

Citation Information

Patent Citations

  • Method for learning dynamic user interests based on content enhancement language model

    CN117390290A

  • Multi-modal sequence-oriented recommendation method

    CN118261670A

  • Cold start recommendation method and system based on large language model

    CN118734177A

  • Multi-task language model-oriented meta-knowledge fine tuning method and platform

    WO2022088444A1