Search

CN-121997176-A - User recommendation method, device, medium and product based on large language model

CN121997176ACN 121997176 ACN121997176 ACN 121997176ACN-121997176-A

Abstract

The application discloses a user recommending method, a device, a medium and a product based on a large language model, and relates to the technical field of large language model recommending, wherein the method comprises the steps of carrying out preliminary screening on an article library based on a user time sequence interaction sequence to obtain a first candidate article set and a second candidate article set, and determining the candidate article sets after merging and de-duplication; determining final candidate quantity according to the core scale parameter, screening out candidate item set Candidate items are determined, and a candidate item information set is determined; The method comprises the steps of obtaining a target prompt word template, obtaining a candidate item information set, obtaining a final recommendation list, obtaining a final candidate quantity, embedding the candidate item information set into a preset placeholder of the target prompt word template to generate an executable instruction, determining the sorting score of each candidate item in the candidate item information set by utilizing a trimmed large language model, and obtaining the final recommendation list based on the sorting score, item IDs and core feature set of all candidate items in the candidate item information set. The application improves the recommendation precision of user recommendation.

Inventors

  • LUO WEIQUN
  • CHENG YONGSHENG
  • ZHU RUI

Assignees

  • 西藏民族大学
  • 厦门大学

Dates

Publication Date
20260508
Application Date
20260127

Claims (10)

  1. 1. The large language model-based user recommendation method is characterized by comprising the following steps of: acquiring a user time sequence interaction sequence and an article library; performing preliminary screening on the article library based on the user time sequence interaction sequence by utilizing LRURec algorithm and BM25 algorithm respectively to obtain a first candidate article set and a second candidate article set; Determining a prompting word template corresponding to an original data set to obtain a target prompting word template, and extracting core scale parameters from the original data set, wherein the target prompting word template contains description fields of a core feature set of an article under the field type of the original data set; determining a final candidate number according to the core scale parameter; merging and de-duplicating the first candidate item set and the second candidate item set to obtain a merged and de-duplicated candidate item set; Screening out candidate article set after merging and de-duplication Candidate items and determining Item IDs and core feature sets of candidate items, thereby forming a candidate item information set; Is the final candidate number; Embedding the candidate item information set into a preset placeholder of a target prompt word template to generate an executable instruction fusing the user history behavior, the candidate item information and the sequencing task instruction; Determining the sorting score of each candidate item in the candidate item information set based on an executable instruction by utilizing the trimmed large language model, wherein the trimmed large language model is obtained by trimming the Llama2-7B basic model through QLoRA low-rank adaptation technology; And obtaining a final recommendation list based on the ranking scores, the item IDs and the core feature sets of all candidate items in the candidate item information set.
  2. 2. The large language model based user recommendation method according to claim 1, wherein the preliminary screening of the item library based on the user time sequence interaction sequence to obtain a first candidate item set using LRURec algorithm comprises: Respectively mapping the object IDs at all times in the user time sequence interaction sequence through an embedding layer to obtain vectors corresponding to the object IDs at all times; Determining the current interest of the user based on vectors corresponding to the object IDs at all times by using a linear circulation unit; Respectively mapping the object IDs of all the objects in the object library through an embedding layer to obtain vectors corresponding to the object IDs of all the objects; determining the behavior score of each item in the item library based on the vector corresponding to the item ID of each item and the current interest of the user; the action scores of all the articles in the article library are ordered in descending order and are utilized before Items, constructing a first candidate item set; is a first preset value.
  3. 3. The large language model based user recommendation method according to claim 2, wherein the preliminary screening of the item library based on the user time sequence interaction sequence by using a BM25 algorithm to obtain a second candidate item set includes: Extracting texts corresponding to the object IDs at all times through the object IDs at all times in the user time sequence interaction sequence; extracting texts corresponding to the object IDs of the objects through the object IDs of the objects in the object library respectively; Splicing texts corresponding to the object IDs at all times to obtain a user query text; Text word segmentation and stop word removal processing are respectively carried out on the user query text and the text corresponding to the article ID of each article to obtain a query word set and an article word set of each article; based on the query word set and the article word set of each article, respectively calculating word frequency of each query word in the article word set of each article and inverse document frequency of each query word in the query word set; Determining any article in the article library as a current article, and determining words in the article word set of the current article and the query word set as valid words corresponding to the current article; Determining a BM25 matching score of the current article based on the inverse document frequency of all the effective words corresponding to the current article and the word frequency of all the effective words corresponding to the current article in the article word set of the current article; The BM25 matching scores of all the items in the item library are sorted in descending order and utilized before Items, constructing a second candidate item set; is a first preset value.
  4. 4. The large language model based user recommendation method according to claim 1, wherein determining a prompt word template corresponding to an original data set to obtain a target prompt word template comprises: Acquiring a metadata configuration file of an original data set, determining the field type of the original data set according to metadata tags in the metadata configuration file, and extracting a core feature set of an article under the field type of the original data set; The method comprises the steps of obtaining a preset dictionary mapping relation, wherein the dictionary mapping relation is a corresponding relation between a field type and a prompt word template; and determining a prompting word template corresponding to the original data set according to the dictionary mapping relation and the field type of the original data set, and obtaining a target prompting word template.
  5. 5. The large language model based user recommendation method according to claim 1, wherein determining the final candidate number according to the core scale parameter comprises: Calculating interaction density according to the core scale parameters; And determining the final candidate quantity according to the total number of the users, the total number of the articles and the interaction density.
  6. 6. The large language model based user recommendation method of claim 1, wherein determining ranking scores for each candidate item in the candidate item information set based on executable instructions using the trimmed large language model comprises: inputting an executable instruction into the trimmed large language model, and extracting the logic value of the option letter corresponding to each candidate item in the candidate item information set through single forward propagation; and directly mapping the logic value of the option letter corresponding to each candidate item in the candidate item information set into the sorting score of the corresponding candidate item.
  7. 7. The large language model based user recommendation method according to claim 1, wherein obtaining a final recommendation list based on ranking scores, item IDs and core feature sets of all candidate items in the candidate item information set comprises: Descending order of the order scores of all candidate items in the candidate item information set, so that the order scores of the candidate items after descending order are determined; Determining the sorting score of the candidate articles subjected to descending sorting and the corresponding article ID and core feature set as a sorting result; Converting the sequencing result into an initial natural language result; And cleaning redundant formats in the initial natural language result to obtain a final recommendation list.
  8. 8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the large language model based user recommendation method according to any of claims 1-7.
  9. 9. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the large language model based user recommendation method according to any of claims 1-7.
  10. 10. A computer program product comprising a computer program which, when executed by a processor, implements the large language model based user recommendation method of any one of claims 1 to 7.

Description

User recommendation method, device, medium and product based on large language model Technical Field The application relates to the technical field of large language model recommendation, in particular to a large language model-based user recommendation method, device, medium and product. Background With the rapid development of deep learning technology, recommendation systems based on large language models (Large Language Model, LLM) have become a research hotspot in the personalized service field. In the prior art, a typical large language model recommendation scheme generally adopts a 'retrieval-ordering' two-stage architecture, namely, a candidate set is initially screened from a mass object library through a traditional collaborative filtering model (such as LRURec and other ID-based sequence modeling methods), and then the candidate objects are finely ordered by using the large language model, so that a personalized recommendation list is finally generated. However, the conventional large language model recommendation scheme has three major core limitations that 1. The retrieval stage is single, namely, only the LRURec model is relied on to perform ID-based sequence retrieval, only the user interaction history is utilized, and the text characteristics of the articles are not combined, so that the matching degree of the candidate set and the real preference of the user is low. 2. And the prompting words in the ordering stage are fixed, namely, a unified template is adopted to adapt to all data sets, so that the characteristics of different data sets (such as the difference between the movie recommendation and the user demand expression of the make-up recommendation) cannot be matched, and the recommendation accuracy is influenced. In summary, the conventional two-stage recommendation of a large language model has the problem of low recommendation accuracy. Disclosure of Invention The application aims to provide a large language model-based user recommendation method, device, medium and product, which are used for solving the problem of low recommendation precision in two-stage recommendation of a traditional large language model. In order to achieve the above object, the present application provides the following. In a first aspect, the present application provides a large language model-based user recommendation method, including: acquiring a user time sequence interaction sequence and an article library; performing preliminary screening on the article library based on the user time sequence interaction sequence by utilizing LRURec algorithm and BM25 algorithm respectively to obtain a first candidate article set and a second candidate article set; Determining a prompting word template corresponding to an original data set to obtain a target prompting word template, and extracting core scale parameters from the original data set, wherein the target prompting word template contains description fields of a core feature set of an article under the field type of the original data set; determining a final candidate number according to the core scale parameter; merging and de-duplicating the first candidate item set and the second candidate item set to obtain a merged and de-duplicated candidate item set; Screening out candidate article set after merging and de-duplication Candidate items and determiningItem IDs and core feature sets of candidate items, thereby forming a candidate item information set; Is the final candidate number; Embedding the candidate item information set into a preset placeholder of a target prompt word template to generate an executable instruction fusing the user history behavior, the candidate item information and the sequencing task instruction; Determining the sorting score of each candidate item in the candidate item information set based on an executable instruction by utilizing the trimmed large language model, wherein the trimmed large language model is obtained by trimming the Llama2-7B basic model through QLoRA low-rank adaptation technology; And obtaining a final recommendation list based on the ranking scores, the item IDs and the core feature sets of all candidate items in the candidate item information set. In an embodiment, using LRURec algorithm, performing preliminary screening on the object library based on the user time sequence interaction sequence to obtain a first candidate object set, including: Respectively mapping the object IDs at all times in the user time sequence interaction sequence through an embedding layer to obtain vectors corresponding to the object IDs at all times; Determining the current interest of the user based on vectors corresponding to the object IDs at all times by using a linear circulation unit; Respectively mapping the object IDs of all the objects in the object library through an embedding layer to obtain vectors corresponding to the object IDs of all the objects; determining the behavior score of each item in the item library based on