User recommendation method and device based on large language model, medium and product

By combining the LRURec and BM25 algorithms to filter the candidate item set and using a fine-tuned large language model to generate a recommendation list, the problem of low recommendation accuracy of traditional large language models is solved, and higher recommendation accuracy is achieved.

CN121997176APending Publication Date: 2026-05-08TIBET UNIVERSITY FOR NATIONALITIES +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIBET UNIVERSITY FOR NATIONALITIES
Filing Date
2026-01-27
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Traditional large language model recommendation schemes suffer from low recommendation accuracy, mainly because the reliance on the LRURec model in the retrieval stage results in a low match between the candidate set and the user's true preferences, and the fixed prompt words in the ranking stage cannot be adapted to the characteristics of different datasets.

Method used

The algorithm combines LRURec and BM25 to initially screen the candidate item set, and generates a recommendation list through a fine-tuned large language model. The recommendation accuracy is improved by integrating user history behavior and candidate item information using target prompt word templates.

Benefits of technology

By combining the initial screening of the LRURec and BM25 algorithms with the ranking of the large language model after fine-tuning, the recommendation accuracy of user recommendations is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121997176A_ABST
    Figure CN121997176A_ABST
Patent Text Reader

Abstract

The invention discloses a user recommendation method and device based on a large language model, a medium and a product, and relates to the technical field of large language model recommendations, and the method comprises the steps: carrying out the preliminary screening of an article library based on a user time sequence interaction sequence, obtaining a first candidate article set and a second candidate article set, and determining the candidate article sets after merging and duplicate removal; determining a final candidate number according to the core scale parameter; screening out candidate items from the candidate item set, and determining a candidate item information set; the number is a final candidate number; embedding the candidate item information set into a preset placeholder of the target cue word template to generate an executable instruction; determining a sorting score of each candidate item in the candidate item information set by using the fine-tuned large language model; and obtaining a final recommendation list based on the sorting scores of all candidate items in the candidate item information set, the item IDs and the core feature set. According to the invention, the recommendation precision of user recommendation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of large language model recommendation technology, and in particular to a user recommendation method, apparatus, medium and product based on a large language model. Background Technology

[0002] With the rapid development of deep learning technology, recommendation systems based on Large Language Models (LLMs) have become a research hotspot in the field of personalized services. In existing technologies, typical LLM recommendation schemes usually adopt a two-stage architecture of "retrieval-ranking": first, a candidate set is initially screened from a massive item database using traditional collaborative filtering models (such as ID-based sequence modeling methods like LRURec); then, the LLM is used to fine-rank the candidate items, and finally, a personalized recommendation list is generated.

[0003] However, traditional large language model recommendation schemes have three major limitations: 1. Single retrieval stage: Relying solely on the LRURec model for ID-based sequence retrieval, utilizing only user interaction history without incorporating item text features, resulting in a low match between the candidate set and the user's true preferences. 2. Fixed prompts in the ranking stage: Using a uniform template to adapt to all datasets fails to accommodate the characteristics of different datasets (e.g., the user needs expressed in movie recommendations differ from those in beauty recommendations), affecting recommendation accuracy.

[0004] In summary, traditional large language models with two-stage recommendation suffer from low recommendation accuracy. Summary of the Invention

[0005] The purpose of this application is to provide a user recommendation method, device, medium, and product based on a large language model, so as to solve the problem of low recommendation accuracy in traditional two-stage recommendation based on large language models.

[0006] To achieve the above objectives, this application provides the following solution.

[0007] Firstly, this application provides a user recommendation method based on a large language model, including: Obtain the user's temporal interaction sequence and item library; The LRURec algorithm and the BM25 algorithm are used respectively to initially screen the item database based on the user's temporal interaction sequence, and the first candidate item set and the second candidate item set are obtained. Determine the prompt word template corresponding to the original dataset to obtain the target prompt word template, and extract the core scale parameters from the original dataset; the target prompt word template contains the description field of the core feature set of items under the domain type of the original dataset; the core scale parameters include: total number of users, total number of items, and total number of interactions; The final number of candidates is determined based on the core size parameters; The first and second candidate item sets are combined and deduplicated to obtain the merged and deduplicated candidate item set; Select from the merged and deduplicated candidate item set 10 candidate items, and determine The item IDs and core feature sets of each candidate item constitute the candidate item information set. This represents the final number of candidates. The candidate item information set is embedded into the preset placeholder of the target prompt word template to generate an executable instruction that integrates user history behavior, candidate item information and sorting task instructions; Using the fine-tuned large language model, the ranking score of each candidate item in the candidate item information set is determined based on executable instructions; the fine-tuned large language model is obtained by fine-tuning the Llama2-7B basic model through QLoRA low-rank adaptation technology. The final recommendation list is obtained based on the ranking scores, item IDs, and core feature sets of all candidate items in the candidate item information set.

[0008] In one embodiment, the LRURec algorithm is used to perform preliminary screening of the item library based on the user's temporal interaction sequence to obtain a first candidate item set, including: The item IDs at each time point in the user's temporal interaction sequence are mapped through the embedding layer to obtain the vector corresponding to the item IDs at each time point; Using linear cyclic units, the user's current interest is determined based on the vector corresponding to the item ID at all times; The item IDs of each item in the item library are mapped through the embedding layer to obtain the vector corresponding to each item ID; Based on the vector corresponding to the item ID of each item and the user's current interest, the behavioral score of each item in the item library is determined. Sort the behavior scores of all items in the item library in descending order, and use the top... 1 item, construct the first candidate item set; This is the first preset value.

[0009] In one embodiment, the BM25 algorithm is used to perform preliminary screening of the item library based on the user's temporal interaction sequence to obtain a second candidate item set, including: Extract the text corresponding to the item ID at each moment in the user's time-series interaction sequence; Extract the text corresponding to each item's item ID from the item database; Concatenate the text corresponding to the item IDs at all times to obtain the user query text; The user query text and the text corresponding to the item IDs of each item are processed by text segmentation and stop word removal to obtain the query term set and the item term set of each item. Based on the query term set and the item term set of each item, calculate the term frequency of each query term in the query term set in the item term set of each item and the inverse document frequency of each query term; Any item in the item library is identified as the current item, and any word that exists in both the query term set and the item term set of the current item is identified as a valid word corresponding to the current item. The BM25 matching score of the current item is determined based on the inverse document frequency of all valid words corresponding to the current item and the word frequency of all valid words corresponding to the current item in the item word set of the current item. Sort all items in the item library by their BM25 matching scores in descending order, and use the previous... For each item, construct a second candidate item set; This is the first preset value.

[0010] In one implementation, determining the prompt word template corresponding to the original dataset to obtain the target prompt word template includes: Obtain the metadata configuration file of the original dataset, determine the domain type of the original dataset based on the metadata tags in the metadata configuration file, and extract the core feature set of items under the domain type of the original dataset. Retrieve the preset dictionary mapping relationship; the dictionary mapping relationship is the correspondence between domain type and prompt word template; Based on the dictionary mapping relationship and the domain type of the original dataset, the prompt word template corresponding to the original dataset is determined, and the target prompt word template is obtained.

[0011] In one implementation, determining the final number of candidates based on core size parameters includes: Calculate the interaction density based on the core scale parameters; The final number of candidates is determined based on the total number of users, the total number of items, and the interaction density.

[0012] In one implementation, using a fine-tuned large language model, based on executable instructions, the ranking score of each candidate item in the candidate item information set is determined, including: The executable instructions are input into the fine-tuned large language model, and the logical values ​​of the option letters corresponding to each candidate item in the candidate item information set are extracted through a single forward propagation. The logical values ​​of the option letters corresponding to each candidate item in the candidate item information set are directly mapped to the ranking scores of the corresponding candidate items.

[0013] In one implementation, based on the ranking scores, item IDs, and core feature sets of all candidate items in the candidate item information set, a final recommendation list is obtained, including: Sort the ranking scores of all candidate items in the candidate item information set in descending order to determine the ranking scores of the candidate items after descending order. The ranking score of the candidate items after descending order, along with the corresponding item ID and core feature set, is determined as the ranking result; Transform the sorting results into initial natural language results; Clean up redundant formatting in the initial natural language processing results to obtain the final recommendation list.

[0014] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the user recommendation method based on a large language model as described above.

[0015] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the user recommendation method based on a large language model as described above.

[0016] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the user recommendation method based on a large language model as described above.

[0017] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application discloses a user recommendation method, apparatus, medium, and product based on a large language model. First, the LRURec algorithm and the BM25 algorithm are used respectively to perform preliminary screening of the item database based on user temporal interaction sequences, obtaining a first candidate item set and a second candidate item set. Second, the prompt word template corresponding to the original dataset is determined to obtain the target prompt word template, and core scale parameters are extracted from the original dataset. The final number of candidates is determined based on the core scale parameters. The first and second candidate item sets are deduplicated to obtain a merged and deduplicated candidate item set. Then, the final candidate item set is selected from the merged and deduplicated candidate item set. 10 candidate items, and determine The item IDs and core feature sets of each candidate item constitute the candidate item information set. The final candidate list is determined by: embedding the candidate item information set into preset placeholders in the target prompt word template to generate an executable instruction that integrates user history behavior, candidate item information, and ranking task instructions; then, using a fine-tuned large language model, based on the executable instruction, determining the ranking score of each candidate item in the candidate item information set; the fine-tuned large language model is obtained by fine-tuning the Llama2-7B basic model using QLoRA low-rank adaptation technology; finally, based on the ranking scores, item IDs, and core feature sets of all candidate items in the candidate item information set, the final recommendation list is obtained. This application improves the recommendation accuracy of users by simultaneously using the LRURec algorithm and the BM25 algorithm for initial screening and further ranking using a fine-tuned large language model. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of a user recommendation method based on a large language model provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] The purpose of this application is to provide a user recommendation method, apparatus, medium, and product based on a large language model, aiming to improve the recommendation accuracy of user recommendations.

[0022] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0023] In one exemplary embodiment, such as Figure 1 As shown, a user recommendation method based on a large language model is provided, which includes the following steps.

[0024] Step 1: Obtain the user's temporal interaction sequence and item library.

[0025] Step 2: Using the LRURec algorithm and the BM25 algorithm respectively, the item database is initially screened based on the user's temporal interaction sequence to obtain the first candidate item set and the second candidate item set.

[0026] As an optional implementation, in step 2, the LRURec algorithm is used to perform preliminary screening of the item library based on the user's temporal interaction sequence to obtain the first candidate item set, including the following steps.

[0027] Step 211: Map the item IDs at each time step in the user's temporal interaction sequence through the embedding layer to obtain the vector corresponding to the item IDs at each time step. The expression is: ; in, Let be the vector corresponding to the item ID at time t in the user's temporal interaction sequence. , The total number of moments for item IDs in the user's temporal interaction sequence; For embedding layer; The item ID at time t in the user's time-series interaction sequence; It is a real number; For the embedded dimension.

[0028] Step 212: Using linear cyclic units, determine the user's current interest based on the vector corresponding to the item ID at all times.

[0029] Specifically, step 212 includes the following steps.

[0030] Step 2121: Determine any moment in the user's time-series interaction sequence as the current moment.

[0031] Step 2122: Based on the vector corresponding to the item ID at the current moment and the interest vector at the previous moment, determine the interest vector at the current moment; if the current moment is the initial moment, the interest vector at the previous moment is the initialized preset interest vector. The expression is: ; in, Let be the interest vector at time t; The tanh activation function; The weight matrix is ​​. The weight matrix is ​​. This is the interest vector at time t-1; This is the bias vector.

[0032] Step 2123: The first step in the user's time-series interaction sequence... Interest vector at time 1 Determined as the user's current interests .

[0033] Step 213: Map the item IDs of each item in the item library through the embedding layer to obtain the vector corresponding to each item ID. The expression is: ; in, The vector corresponding to the item ID of item y; Let y be the item ID.

[0034] Step 214: Determine the behavior score for each item in the item library based on the vector corresponding to each item's item ID and the user's current interest. The expression is: ; in, Score the behavior of item y.

[0035] Step 215: Sort the behavior scores of all items in the item library in descending order, and use the previous... 1 item, construct the first candidate item set; This is the first preset value.

[0036] As an optional implementation, in step 2, the BM25 algorithm is used to perform preliminary screening of the item library based on the user's temporal interaction sequence to obtain a second candidate item set, including the following steps.

[0037] Step 221: Extract the text corresponding to the item ID at each time point in the user's time-series interaction sequence. The expression is: ; in, The text (such as title and description) corresponding to the item ID at time t in the user's time-series interaction sequence. This is a text mapping function (associating text content with an item ID).

[0038] Step 222: Extract the text corresponding to each item's item ID from the item library. The expression is: ; in, This is the text corresponding to the item ID of item y.

[0039] Step 223: Concatenate the text corresponding to the item IDs at all times to obtain the user query text. The expression is: ; in, For users to query text; The text corresponding to the item ID at the first moment in the user's temporal interaction sequence; For text concatenation operations (merging content in chronological order); The text corresponding to the item ID at the second moment in the user's temporal interaction sequence; The first in the user's time-series interaction sequence The text corresponding to the item ID at each moment.

[0040] Step 224: Perform text segmentation and stop word removal on the user query text and the text corresponding to the item IDs of each item, respectively, to obtain the query term set and the item term set for each item. The expression is: ; ; in, For the set of query terms; Functions for text segmentation and stop word removal; For the m-th query term in the query term set, , This represents the total number of query terms in the query term set. Let y be the set of item words corresponding to item y; Let n be the nth item word in the set of item words corresponding to item y. , The set of item words corresponding to item y The total number of item words in the text.

[0041] Step 225: Based on the query term set and the item term set for each item, calculate the term frequency and inverse document frequency of each query term in the query term set within the item term set for each item. The expression is: ; ; in, For any query term exist Word frequency in; It is a counting function; For any query term Inverse document frequency; This represents the total number of items in the inventory. The text corresponding to the item ID of an item in the item library contains the query term. The number of texts.

[0042] Step 226: Identify any item in the item library as the current item, and identify all words that exist in both the query term set and the item term set of the current item as valid words corresponding to the current item.

[0043] Step 227: Determine the BM25 matching score of the current item based on the inverse document frequency of all valid words corresponding to the current item and the word frequency of all valid words corresponding to the current item in the item word set of the current item. The expression is: ; in, The BM25 matching score for candidate item y is given; the higher the score, the stronger the text relevance. For those that exist simultaneously in the query term set and item word set Valid words in; for Inverse document frequency; for exist Word frequency in; This parameter is used to adjust word frequency saturation and control the upper limit of the influence of word frequency on the score; it is usually set to 1.2. The parameter used to adjust the impact of text length controls the degree to which the difference between the text length and the average length corrects the score; it is usually set to 0.75. The length of the text corresponding to the item ID of candidate item y (i.e. (number of words in the text) This is the average length of the text corresponding to the item IDs of all items in the item library.

[0044] Step 228: Sort all items in the item library by their BM25 matching scores in descending order, and use the previous... For each item, construct a second candidate item set; This is the first preset value.

[0045] Step 3: Determine the prompt word template corresponding to the original dataset, obtain the target prompt word template, and extract the core scale parameters from the original dataset.

[0046] The target prompt word template contains a description field of the core feature set of items under the domain type of the original dataset; the core scale parameters include: total number of users, total number of items, and total number of interactions.

[0047] As an optional implementation, step 3 includes the following steps.

[0048] Step 31: Obtain the metadata configuration file of the original dataset, determine the domain type of the original dataset based on the metadata tags in the metadata configuration file, and extract the core feature set of items under the domain type of the original dataset.

[0049] Step 32: Obtain the preset dictionary mapping relationship; the dictionary mapping relationship is the correspondence between domain type and prompt word template.

[0050] Step 33: Based on the dictionary mapping relationship and the domain type of the original dataset, determine the prompt word template corresponding to the original dataset to obtain the target prompt word template.

[0051] Specifically, step 3 will be explained using a specific scenario, including the following content.

[0052] (1) Read the metadata labels of the “dataset_type” field in the metadata configuration file of the original dataset, denoted as Tlabel (e.g., “movie”, “beauty”, “game”), and identify the domain type and core feature set of the original dataset based on the labels: If Tlabel="movie" (such as the ML-100k dataset), it is determined to be a movie dataset, denoted as Ttype="movie dataset", and the core feature set is Fcore={movie type, release year, director, actor}; If Tlabel="beauty" (such as the Amazon Beauty dataset), it is determined to be a beauty dataset, denoted as Ttype="beauty dataset", and the core feature set is Fcore={product efficacy (moisturizing / whitening), skin type suitability (dry skin / oily skin), product form (face cream / mask)}; If Tlabel="game" (such as the Amazon Games dataset), it is determined to be a game dataset, denoted as Ttype="game dataset", and the core feature set is Fcore={game type (RPG / shooter), platform (PC / console), publisher}; Where Tlabel represents the dataset metadata label, Ttype represents the dataset type, Fcore represents the set of core features of this type of dataset, and dataset_type represents the metadata label field.

[0053] (2) Retrieve the template that matches Ttype through the dictionary mapping relationship. The mapping relationship is map_temp={“Movie dataset”: movie_template,“Beauty dataset”: beauty_template,“Game dataset”: game_template}, and the retrieval formula is Temp_target=map_temp[T_type]; Where M_temp represents the prompt word template library, map_temp represents the mapping relationship between dataset type and template, and Temp_target represents the domain-specific prompt word template to be retrieved (the template contains feature description fields corresponding to F_core, such as "type" and "director" fields for movie templates, and "efficacy" and "skin type" fields for beauty templates).

[0054] Step 4: Determine the final number of candidates based on the core size parameters.

[0055] As an optional implementation, step 4 includes the following steps.

[0056] Step 41: Calculate the interaction density based on the core scale parameters. The expression is: ; in, Interaction density; This represents the total number of interactions; Total number of users; This represents the total number of items in the original data.

[0057] Step 42: Determine the final number of candidates based on the total number of users, the total number of items, and the interaction density. The expression is: ; in, This represents the final number of candidates. Weighted by the total number of users; Weights for the total number of items; Weights are used to compensate for interaction density. The number of basic candidates.

[0058] Step 5: Combine the first and second candidate item sets to remove duplicates, resulting in a merged and deduplicated candidate item set.

[0059] Step 6: Select from the merged and deduplicated candidate item set 10 candidate items, and determine The item IDs and core feature sets of each candidate item constitute the candidate item information set.

[0060] in, This represents the final number of candidates.

[0061] Step 7: Embed the candidate item information set into the preset placeholders of the target prompt word template to generate an executable instruction that integrates user history behavior, candidate item information, and sorting task instructions. The expression is: ; in, Executable instructions; A function to fill in the preset placeholders for the target prompt word template; This is a set of candidate item information.

[0062] Step 8: Using the fine-tuned large language model, determine the ranking score of each candidate item in the candidate item information set based on the executable instructions.

[0063] The fine-tuned large language model was obtained by fine-tuning the Llama2-7B basic model using the QLoRA low-rank adaptation technique.

[0064] Specifically, when fine-tuning the Llama2-7B base model, the prompt words in each sample pair in the training set are used as input, and the corresponding letter labels are used as output. The loss function is: ; in, The loss is negative log-likelihood. The number of sample pairs in the training set; To predict probabilities; The prompt word in the i-th sample pair in the training set; The letter label for the i-th sample pair in the training set; For QLoRA low-rank parameters.

[0065] As an optional implementation, step 8 includes the following steps.

[0066] Step 81: Input the executable instructions into the fine-tuned large language model, and extract the logical values ​​of the option letters corresponding to each candidate item in the candidate item information set through a single forward propagation. The expression is: ; in, It is a set of logical values ​​consisting of the option letters corresponding to all candidate items in the candidate item information set; For the forward propagation operation function in the fine-tuned large language model; It is a set consisting of the option letters corresponding to all candidate items in the candidate item information set.

[0067] Step 82: Directly map the logical values ​​of the option letters corresponding to each candidate item in the candidate item information set to the ranking scores of the corresponding candidate items. The expression is: ; in, The ranking score of the j-th candidate item in the candidate item information set; It is the logical value of the option letter corresponding to the j-th candidate item in the candidate item information set.

[0068] Step 9: Based on the ranking scores, item IDs, and core feature sets of all candidate items in the candidate item information set, obtain the final recommendation list.

[0069] As an optional implementation, step 9 includes the following steps.

[0070] Step 91: Sort the ranking scores of all candidate items in the candidate item information set in descending order to determine the ranking scores of the candidate items after descending order.

[0071] Step 92: Determine the ranking score of the candidate items after descending order, along with the corresponding item ID and core feature set, as the ranking result.

[0072] Step 93: Convert the sorting results into initial natural language results.

[0073] Step 94: Clean up redundant formatting in the initial natural language results to obtain the final recommendation list.

[0074] In one exemplary embodiment, a computer device is provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the computer program to implement a user recommendation method based on a large language model.

[0075] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements a user recommendation method based on a large language model.

[0076] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements a user recommendation method based on a large language model.

[0077] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 2As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a user recommendation method based on a large language model.

[0078] Those skilled in the art will understand that Figure 2 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0079] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0080] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0081] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0082] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0083] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A user recommendation method based on a large language model, characterized in that, The user recommendation method based on a large language model includes: Obtain the user's temporal interaction sequence and item library; The LRURec algorithm and the BM25 algorithm are used respectively to initially screen the item database based on the user's temporal interaction sequence, and the first candidate item set and the second candidate item set are obtained. Determine the prompt word template corresponding to the original dataset to obtain the target prompt word template, and extract the core scale parameters from the original dataset; the target prompt word template contains the description field of the core feature set of items under the domain type of the original dataset; the core scale parameters include: total number of users, total number of items, and total number of interactions; The final number of candidates is determined based on the core size parameters; The first and second candidate item sets are combined and deduplicated to obtain the merged and deduplicated candidate item set; Select from the merged and deduplicated candidate item set 10 candidate items, and determine The item IDs and core feature sets of each candidate item constitute the candidate item information set. This represents the final number of candidates. The candidate item information set is embedded into the preset placeholder of the target prompt word template to generate an executable instruction that integrates user history behavior, candidate item information and sorting task instructions; Using the fine-tuned large language model, the ranking score of each candidate item in the candidate item information set is determined based on executable instructions; the fine-tuned large language model is obtained by fine-tuning the Llama2-7B basic model through QLoRA low-rank adaptation technology. The final recommendation list is obtained based on the ranking scores, item IDs, and core feature sets of all candidate items in the candidate item information set.

2. The user recommendation method based on a large language model according to claim 1, characterized in that, Using the LRURec algorithm, the item database is initially screened based on the user's temporal interaction sequence to obtain a first candidate item set, including: The item IDs at each time point in the user's temporal interaction sequence are mapped through the embedding layer to obtain the vector corresponding to the item IDs at each time point; Using linear cyclic units, the user's current interest is determined based on the vector corresponding to the item ID at all times; The item IDs of each item in the item library are mapped through the embedding layer to obtain the vector corresponding to each item ID; Based on the vector corresponding to the item ID of each item and the user's current interest, the behavioral score of each item in the item library is determined. Sort the behavior scores of all items in the item library in descending order, and use the top... 1 item, construct the first candidate item set; This is the first preset value.

3. The user recommendation method based on a large language model according to claim 2, characterized in that, Using the BM25 algorithm, the item database is initially screened based on the user's temporal interaction sequence to obtain a second candidate item set, including: Extract the text corresponding to the item ID at each moment in the user's time-series interaction sequence; Extract the text corresponding to each item's item ID from the item database; Concatenate the text corresponding to the item IDs at all times to obtain the user query text; The user query text and the text corresponding to the item IDs of each item are processed by text segmentation and stop word removal to obtain the query term set and the item term set of each item. Based on the query term set and the item term set of each item, calculate the term frequency of each query term in the query term set in the item term set of each item and the inverse document frequency of each query term; Any item in the item library is identified as the current item, and any word that exists in both the query term set and the item term set of the current item is identified as a valid word corresponding to the current item. The BM25 matching score of the current item is determined based on the inverse document frequency of all valid words corresponding to the current item and the word frequency of all valid words corresponding to the current item in the item word set of the current item. Sort all items in the item library by their BM25 matching scores in descending order, and use the previous... For each item, construct a second candidate item set; This is the first preset value.

4. The user recommendation method based on a large language model according to claim 1, characterized in that, Determine the prompt word template corresponding to the original dataset to obtain the target prompt word template, including: Obtain the metadata configuration file of the original dataset, determine the domain type of the original dataset based on the metadata tags in the metadata configuration file, and extract the core feature set of items under the domain type of the original dataset. Retrieve the preset dictionary mapping relationship; the dictionary mapping relationship is the correspondence between domain type and prompt word template; Based on the dictionary mapping relationship and the domain type of the original dataset, the prompt word template corresponding to the original dataset is determined, and the target prompt word template is obtained.

5. The user recommendation method based on a large language model according to claim 1, characterized in that, The final number of candidates is determined based on core size parameters, including: Calculate the interaction density based on the core scale parameters; The final number of candidates is determined based on the total number of users, the total number of items, and the interaction density.

6. The user recommendation method based on a large language model according to claim 1, characterized in that, Using a fine-tuned large language model, based on executable instructions, the ranking score of each candidate item in the candidate item information set is determined, including: The executable instructions are input into the fine-tuned large language model, and the logical values ​​of the option letters corresponding to each candidate item in the candidate item information set are extracted through a single forward propagation. The logical values ​​of the option letters corresponding to each candidate item in the candidate item information set are directly mapped to the ranking scores of the corresponding candidate items.

7. The user recommendation method based on a large language model according to claim 1, characterized in that, Based on the ranking scores, item IDs, and core feature sets of all candidate items in the candidate item information set, the final recommendation list is obtained, including: Sort the ranking scores of all candidate items in the candidate item information set in descending order to determine the ranking scores of the candidate items after descending order. The ranking score of the candidate items after descending order, along with the corresponding item ID and core feature set, is determined as the ranking result; Transform the sorting results into initial natural language results; Clean up redundant formatting in the initial natural language processing results to obtain the final recommendation list.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the user recommendation method based on a large language model as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the user recommendation method based on a large language model as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the user recommendation method based on a large language model as described in any one of claims 1-7.