Hidden space decoding generative recommendation method and system based on large language model
By building a memory module in the language space and decoding products in the hidden space, the problem of low inference efficiency of decoding recommended products in the language space is solved, and the excellent recommendation effect at low cost is achieved.
Patent Information
- Application Number
- CN202510361574.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
When decoding recommended products in the language space, inference is inefficient and costly, especially when each recommendation request needs to generate a product list, resulting in the inference cost being linearly related to the number of products generated.
By building a memory module, the hidden state of the training sample is generated and the match pairing between the real product, and the product is decoded in the hidden space, avoiding the decoding of the autoregressive method, and decoding the product directly from the hidden state of the large language model.
It significantly reduces the overhead of decoding products in large language models, while maintaining excellent recommendation performance, achieving excellent recommendation results at low cost.
Smart Images

Figure CN119887349A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of generative recommendation technology, and more specifically to a latent space decoding generative recommendation method and system based on a large language model. Background Art
[0002] Due to the powerful capabilities of large language models (LLMs), researchers are currently working on applying them to recommendation systems, resulting in the most popular recommendation paradigm based on large language models. Unlike traditional recommendations, this paradigm redesigns the recommendation system in a "language space", where tasks and related entities (i.e., users and products) are described in natural language. In this paradigm, large language models usually perform recommendation tasks in a generative manner - fine-tuning the large language model directly generates (decodes) products in the language space. This approach is very consistent with the generative characteristics of large language models, and can effectively utilize the powerful generative capabilities of large language models to achieve impressive results.
[0003] When decoding recommended items in the language space, reasoning efficiency faces huge challenges. Figure 2 As shown in (a), when decoding the language space, the large language model must autoregressively generate its representation (such as the title, which consists of multiple tokens, and the generation of each token depends on the previous token), which will incur a lot of time cost. To make matters worse, each recommendation request usually requires the generation of a list of items, so the inference cost is linearly related to the number of generated items. Although existing grounding techniques can reduce the number of items to be generated by large language models by mapping each generated item representation to multiple actual items, it is impractical to reduce the number of generated items excessively because mapping only a few items to a long recommendation list will reduce the recommendation performance. Therefore, to achieve higher recommendation performance of large language models, it is necessary to increase the inference cost several times higher than generating a single item, which is unrealistic. Summary of the invention
[0004] In this embodiment, a latent space decoding generative recommendation method, system, electronic device and storage medium based on a large language model are provided, which can directly decode products in the latent space rather than the language space, and achieve excellent recommendation performance at a low cost.
[0005] In a first aspect, an embodiment of the present invention provides a latent space decoding generative recommendation method based on a large language model, and the latent space decoding generative recommendation method based on a large language model includes: (1) Construct a memory module to generate and store matching pairs of hidden states of training samples and real products through the user-product interaction dataset. The hidden state is obtained by extracting the last hidden state of the last layer of the input instruction from the large language model. (2) Generating candidate product representations, aggregating hidden states associated with the same product from the memory module to generate a latent space representation of the candidate product; (3) Product decoding: Calculate the similarity between the hidden state of the test sample and the candidate product representation, and generate a recommendation list based on the similarity sorting.
[0006] In an optional embodiment, the construction process of the memory module includes: Convert user interaction history into fixed template instruction data; The instruction data is encoded through a large language model, and the last hidden state of the last layer is extracted.
[0007] In an optional embodiment, the aggregation in step (2) includes a global aggregation strategy and a local aggregation strategy.
[0008] In an optional embodiment, the global aggregation strategy includes: All hidden states of the same product in the memory module are averaged to form a global product representation.
[0009] In an optional embodiment, the local aggregation strategy includes: Based on the hidden state of the test sample, retrieve the most similar M hidden states from the memory module; The retrieved hidden states are grouped and aggregated by product to generate candidate product representations related to the user.
[0010] In an optional embodiment, the retrieval of the most similar M hidden states is achieved by calculating the inverse of the L2 distance, where the L2 distance is defined as the Euclidean distance between the hidden state of the test sample and the hidden state in the memory module.
[0011] In an optional embodiment, in the local aggregation strategy, the value of M is dynamically adjusted according to the test scenario. In scenarios with dense user interactions, the value of M is increased to improve personalization, and in scenarios with sparse user interactions, the value of M is reduced to reduce noise.
[0012] Compared with the prior art, the latent space decoding generative recommendation method based on a large language model of the present invention has the following beneficial effects: The present invention can be applied to a generative recommendation platform based on a large language model, which can not only significantly reduce the overhead of decoding products of the large language model, but also maintain excellent recommendation performance. The L2D method of the present invention decodes directly from the latent space of the large language model, that is, only the large language model needs to be forward propagated once to obtain the latent state of the user input, avoiding decoding in an autoregressive manner. The (hidden state, real product) matching pair of the memory module is used to generate a representation of the product in the latent space. For each product, it aggregates the relevant hidden states paired with the product to create a representation of the product. This method can effectively model the characteristics of a product. Using the current user's state information, the most relevant M hidden states are retrieved. The real products composed of these hidden states contain the user's personalized information. After aggregation operations, personalized product representations can be formed.
[0013] In a second aspect, an embodiment of the present invention provides a latent space decoding generative recommendation system based on a large language model, including: The memory module is configured to: generate and store matching pairs of hidden states of training samples and real products through a user-product interaction dataset, wherein the hidden state is obtained by extracting the last hidden state of the last layer of the input instruction from the large language model; A candidate product representation generation module is configured to: aggregate hidden states associated with the same product from the memory module to generate a latent space representation of the candidate product; The product decoding recommendation module is configured to: calculate the similarity between the hidden state of the test sample and the representation of the candidate product, and generate a recommendation list based on the similarity sorting.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a bus, wherein the processor, the communication interface and the memory communicate with each other through the bus, and the processor can call logic instructions in the memory to execute the steps of the method provided in the first aspect.
[0015] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the latent space decoding generative recommendation method based on a large language model as described in the first aspect.
[0016] Compared with the prior art, the beneficial effects of the latent space decoding generative recommendation system, electronic device and storage medium based on a large language model of the present invention are the same as those of the latent space decoding generative recommendation method based on a large language model described in the first aspect, so they will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0018] Figure 1 Flow chart of a latent space decoding generative recommendation method based on a large language model in an embodiment of the present invention; Figure 2 It is a schematic diagram and principle diagram of language space decoding and latent space decoding in an embodiment of the present invention; Figure 3 It is a schematic diagram of a latent space decoding generative recommendation method based on a large language model in an embodiment of the present invention; Figure 4 This is a comparison chart of the time cost of the L2D method in an embodiment of the present invention on the CDs and Games data sets; Figure 5 This is a performance comparison diagram of the L2D method in an embodiment of the present invention on the CDs and Games data sets; Figure 6 A comparison diagram of the L2D method in dense and sparse scenarios according to an embodiment of the present invention; Figure 7 It is a structural block diagram of a latent space decoding generative recommendation system based on a large language model in an embodiment of the present invention; Figure 8 1 is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0020] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0021] First, the basic concepts of generative recommendation based on large language models are explained, and then the latent space decoding generative recommendation method (L2D method) based on large language models is formally introduced.
[0022] The basic concept of generative recommendation based on large language model: D represents the user-item interaction dataset. The jth sample in D is represented as ,in Represents the user's interaction history, are the products that users in this sample have interacted with. It is worth noting that and are all in text form. In order to train a generative recommendation system based on a large language model, each sample Converted to instruction data, using a fixed prompt template, such as "The user interacted with the following items: < >; Which product does the user want next? ", at this time is the real product that the large language model is expected to output. Then, the instruction data Can be used to fine-tune large language models.
[0023] When the large language model is inferred, given the user's interaction history s to generate the next item that the user may like, the large language model first encodes prompt(s) into a hidden state in the form of: Where h represents the last hidden state of the input prompt(s) in the last layer, and represents the function that extracts the last hidden state from the last layer of the large language model. In the traditional language space decoding method, h is further mapped to the output layer of the large language model to generate the first token of the product (each product title is composed of multiple tokens), which is then added to the input and the process is repeated to generate the complete product title. In contrast, this scheme explores decoding products directly from the hidden state h, as shown in Figure 2 (b) and Figure 3 shown.
[0024] Specifically, an embodiment of the present invention provides a latent space decoding generative recommendation method based on a large language model. Figure 1 is a flowchart of the latent space decoding generative recommendation method based on a large language model of the present invention, such as Figure 1 As shown, the process includes the following steps: S100, construct a memory module, generate and store (hidden state, real product) matching pairs of training samples through the user-product interaction dataset, and the hidden state is obtained by extracting the last hidden state of the last layer of the input instruction from the large language model; It should be noted that the construction process of the memory module includes: Convert user interaction history into fixed template instruction data; The instruction data is encoded through a large language model, and the last hidden state of the last layer is extracted.
[0025] Specifically, a memory module is constructed to store (hidden state, real product) matching pairs from training samples. These matching pairs are derived from real user-product interaction data, which means that the hidden state reflects the characteristics of a certain aspect of the corresponding product and can be further used to generate the representation of the product. Specifically, for the first training samples , we calculate its final hidden state in the last layer, expressed as: , and Stored in the memory module Memory (abbreviated as Mem). Repeat this process for all samples in the training set, and construct the final memory module Mem based on the latent space decoding generative recommendation method (L2D) of the large language model, expressed as, Where N represents the total number of training samples, and then Mem is used to generate the representation of candidate products.
[0026] S200, generating candidate product representations, aggregating hidden states associated with the same product from the memory module to generate latent space representations of the candidate products; After constructing the memory module, L2D generates representations of candidate products in the latent space using the (hidden state, real product) matching pairs of the memory module Mem. For each product, it aggregates the relevant hidden states paired with the product as a real product to generate the representation of the product.
[0027] It should be noted that the aggregation in step S200 includes a global aggregation strategy and a local aggregation strategy.
[0028] The global aggregation strategy includes taking the average of all hidden states of the same product in the memory module to form a global product representation.
[0029] First, let’s explain global aggregation. In order to aggregate the hidden states stored in the memory module Mem to generate the representation of the candidate product, a simple method is to directly average all the hidden states paired with the same product. Global aggregation follows this strategy. Specifically, the hidden states in the memory module Mem are first grouped by product, and then the hidden states in each group are averaged to form the representation of the corresponding product. Expressed by formula, that is, for a product v, its representation h v The calculation of is as follows: ; Where Mem(v) represents the set of all hidden states associated with item (commodity) v, defined as: ; The size of Mem(v) is expressed as express.
[0030] Next, local aggregation is described. Local aggregation strategies include: Based on the hidden state of the test sample, retrieve the most similar M hidden states from the memory module; The retrieved hidden states are grouped and aggregated by product to generate candidate product representations related to the user.
[0031] Specifically, a product may contain multiple feature aspects, and the global aggregation method combines all aspects to form a comprehensive product representation. However, in the reasoning stage, not all feature aspects are relevant to each test sample; only the aspects relevant to the test sample are important. That is, mixing all aspects may introduce interference. Considering this, local aggregation is proposed, which only utilizes the top M samples in Mem that are most relevant to the hidden state of the test sample to generate the representation of the candidate product. Specifically, for a test sample (S t ,), first according to the hidden state h of the test sample t Filter out some of the Mem (hidden state, real product) matching pairs, recorded as Mem t . It is expressed as: in the largest first M}; in, Measure the hidden state h in Mem j And the hidden state h of the test sample t Then, for Mem t Apply a strategy similar to global aggregation to obtain the representation of the candidate item. Given a candidate item v, the representation is as follows: ; in, Indicates the size of Mem(v), Mem t (v) is the Mem containing candidate v as the real product t A subset of is defined as: ; It should be noted that in the local aggregation strategy, the value of M is dynamically adjusted according to the test scenario. In scenarios with dense user interactions, the value of M is increased to improve personalization, and in scenarios with sparse user interactions, the value of M is reduced to reduce noise.
[0032] Compared with global aggregation, local aggregation can better focus on the characteristics of the test samples, which may improve the subsequent matching performance. However, due to the lack of relevant hidden states, local aggregation may have difficulty in handling the representation of sparse items. In addition, the representation obtained by global aggregation is uniform for all test samples, while the representation obtained by local aggregation is different and is tailored to each test sample.
[0033] S300, product decoding, calculating the similarity between the hidden state of the test sample and the representation of the candidate products, and generating a recommendation list based on the similarity sorting.
[0034] Retrieving the most similar M hidden states is achieved by calculating the inverse of the L2 distance, which is defined as the Euclidean distance between the hidden state of the test sample and the hidden state in the memory module.
[0035] Specifically, after generating the representation of the candidate product, L2D can efficiently decode the products contained in the latent space during the reasoning process by measuring the similarity between the hidden state of the test sample and the candidate product representation. Specifically, for a given test sample, its hidden state is h t and candidate product v, and the representation of the candidate product is denoted by h v , which is defined as: ; Then, use the L2 distance to calculate h t and h v The similarity score between: ; Once the similarity scores of all candidate items are calculated, the top K items with the highest similarity scores to the test sample are selected to form the final recommendation list. The globally aggregated L2D is called L2D-G, and the locally aggregated L2D is called L2D-L.
[0036] We conduct experiments on two real-world datasets to demonstrate the effectiveness of the L2D approach in balancing performance and inference overhead.
[0037] like Figure 4 As shown in the figure, the performance and time cost comparison of L2D and traditional methods on the CDs and Games datasets. The vertical axis is the recommended performance of the model, and the horizontal axis is the time cost required by the model.
[0038] like Figure 5 As shown, Figure 5 This is a performance comparison between L2D and traditional methods on the CDs and Games datasets.
[0039] In order to verify the effectiveness of the L2D method, Figure 4 The performance and inference cost of our approach compared to traditional methods are shown in Figure 5 The performance of our method under different @K values is illustrated in Figure 2. From the figure and table, we can find that: When evaluating the performance of all methods versus inference cost, Figure 4 It is observed that the points closer to the upper left corner indicate better performance at a lower cost. The L2D method of the present invention is closest to the upper left corner on both datasets, indicating that L2D achieves excellent performance while maintaining low inference cost, demonstrating the effectiveness of directly decoding the goods in the latent space. Even compared with the previous most effective large language model-based method AlphaRec, which uses a large language model as embedding, L2D has a cost reduction of at least five times and achieves better performance, further demonstrating the significant potential of L2D in deployment in real scenarios.
[0040] When comparing the performance of traditional autoregressive generation methods under different beam sizes, it is observed that the performance of traditional autoregressive generation methods improves approximately linearly with the increase of beam size and inference cost. The larger the number of beams, the more items can be generated at one time by traditional methods based on large language models. 3 Shows stronger scalability (larger growth rate). It would not be surprising if these methods were indeed able to outperform L2D by increasing the inference overhead (e.g., increasing the beam size to 50), but this could result in an almost hundred-fold increase in cost, which is not feasible in most real-world scenarios. In addition, our experiments use Llama3.2-1B as the base model, which is a relatively small-scale large language model. The cost would be higher if a larger-scale large language model was used.
[0041] When comparing the two variants of the proposed L2D method, L2D-G and L2D-L, it is observed that L2D-L performs more stably on both datasets with only a slight increase in computational overhead. This demonstrates the effectiveness and robustness of the user-specific local memory module tailored for the user. In addition, although L2D-G does not perform as stably as L2D-L, it still has a significant advantage in terms of overhead compared to other traditional methods.
[0042] In addition, if Figure 5 As shown in Figure 2, L2D outperforms all traditional methods in all metrics. The ability of this method to effectively decode multiple user interests in the latent space of a large language model significantly improves the possibility of satisfying the user's current interests, further demonstrating the robustness and scalability of this method.
[0043] Figure 6 (a), (b), (c) and (d) show the performance of our method BIGRec (traditional), L2D-G and L2D-L in dense and sparse scenarios respectively.
[0044] Furthermore, the application and characteristics of the two decoding strategies of L2D in sparse and dense recommendation scenarios are explained. L2D-L shows stable performance compared to L2D-G. However, since L2D-L is designed to create user-specific memory modules using the hidden states of test samples, it may not be applicable in scenarios where user-item interactions are very sparse. To analyze this, the test set is divided into sparse and dense categories according to the interaction frequency of the items in the training set. Figure 6 The overall performance of the two strategies in these scenarios is shown.
[0045] The following points are observed: (1) Dense scenarios: L2D-L performs best due to the large number of hidden states for each item, which enables it to create more personalized candidate item representations and eliminate irrelevant information. (2) Sparse scenarios: The interaction frequency of items is very low, that is, the hidden states corresponding to each item are very limited, which means that even the most similar hidden states may not accurately represent user preferences, which may lead to biased results and performance degradation. In contrast, L2D-G provides more balanced results through global aggregation. In summary, L2D-G and L2D-L each have their own advantages and disadvantages, but our decoding strategy allows flexible switching between the two methods to adapt them to different scenarios.
[0046] In summary, the L2D method of the present invention decodes directly from the latent space of the large language model, that is, only the large language model needs to be forward propagated once to obtain the latent state of the user input, avoiding decoding in an autoregressive manner. The (hidden state, real product) matching pairs of the memory module Mem are used to generate a representation of the product in the latent space. For each product, it aggregates the relevant hidden states paired with the product to create a representation of the product. This method can effectively model the characteristics of a product. L2D-L will use the current user's state information to retrieve the most relevant M hidden states, which constitute Mem t It contains the user's personalized information and can form personalized product representations after aggregation operations. L2D uses the existing large language model to generate product representations and uses the L2 distance as a metric function. It can achieve excellent recommendation results without training additional models.
[0047] The embodiment of the present invention also provides a latent space decoding generative recommendation system based on a large language model, which is used to implement the above method embodiment, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for predetermined functions. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware or a combination of software and hardware is also possible and conceivable.
[0048] like Figure 7 As shown, Figure 7 It is a structural block diagram of the latent space decoding generative recommendation system based on the large language model in the present invention, and the system includes: The memory module 101 is configured to: generate and store matching pairs of hidden states of training samples and real products through a user-product interaction dataset, wherein the hidden state is obtained by extracting the last hidden state of the last layer of the input instruction from the large language model; The candidate product representation generation module 102 is configured to: aggregate hidden states associated with the same product from the memory module to generate a latent space representation of the candidate product; The product decoding recommendation module 103 is configured to calculate the similarity between the hidden state of the test sample and the representation of the candidate products, and generate a recommendation list based on the similarity sorting.
[0049] The latent space decoding generative recommendation system based on a large language model of the present invention has the same principle as the latent space decoding generative recommendation method based on a large language model described above, so it will not be repeated here.
[0050] Figure 8 A structural block diagram of an electronic device provided by an embodiment of the present invention, such as Figure 8 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the following method: Construct a memory module to generate and store matching pairs of hidden states of training samples and real products through the user-product interaction dataset. The hidden state is obtained by extracting the last hidden state of the last layer of the input instruction from the large language model. Generating candidate product representations, aggregating hidden states associated with the same product from the memory module to generate latent space representations of the candidate products; Product decoding: Calculate the similarity between the hidden state of the test sample and the candidate product representation, and generate a recommendation list based on the similarity sorting.
[0051] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0052] An embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method provided in the above embodiments is implemented.
[0053] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A latent space decoding generative recommendation method based on a large language model, characterized in that: The latent space decoding generative recommendation method based on the large language model includes: (1) Construct a memory module to generate and store matching pairs of hidden states of training samples and real products through the user-product interaction dataset. The hidden state is obtained by extracting the last hidden state of the last layer of the input instruction from the large language model. (2) Generating candidate product representations, aggregating hidden states associated with the same product from the memory module to generate a latent space representation of the candidate product; (3) Product decoding: Calculate the similarity between the hidden state of the test sample and the candidate product representation, and generate a recommendation list based on the similarity sorting.
2. The latent space decoding generative recommendation method based on a large language model according to claim 1, characterized in that: The construction process of the memory module includes: Convert user interaction history into fixed template instruction data; The instruction data is encoded through a large language model, and the last hidden state of the last layer is extracted.
3. The latent space decoding generative recommendation method based on a large language model according to claim 1, characterized in that: The aggregation in step (2) includes a global aggregation strategy and a local aggregation strategy.
4. The latent space decoding generative recommendation method based on a large language model according to claim 3, characterized in that: The global aggregation strategy includes: All hidden states of the same product in the memory module are averaged to form a global product representation.
5. The latent space decoding generative recommendation method based on a large language model according to claim 3, characterized in that: The local aggregation strategy includes: Based on the hidden state of the test sample, retrieve the most similar M hidden states from the memory module; The retrieved hidden states are grouped and aggregated by product to generate candidate product representations related to the user.
6. The latent space decoding generative recommendation method based on a large language model according to claim 5, characterized in that: The retrieval of the most similar M hidden states is achieved by calculating the inverse of the L2 distance, where the L2 distance is defined as the Euclidean distance between the hidden state of the test sample and the hidden state in the memory module.
7. The latent space decoding generative recommendation method based on a large language model according to claim 5, characterized in that: In the local aggregation strategy, the value of M is dynamically adjusted according to the test scenario. In scenarios with dense user interactions, the value of M is increased to improve personalization, and in scenarios with sparse user interactions, the value of M is reduced to reduce noise.
8. A latent space decoding generative recommendation system based on a large language model, characterized by: include: The memory module is configured to: generate and store matching pairs of hidden states of training samples and real products through a user-product interaction dataset, wherein the hidden state is obtained by extracting the last hidden state of the last layer of the input instruction from the large language model; A candidate product representation generation module is configured to: aggregate hidden states associated with the same product from the memory module to generate a latent space representation of the candidate product; The product decoding recommendation module is configured to: calculate the similarity between the hidden state of the test sample and the representation of the candidate product, and generate a recommendation list based on the similarity sorting.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the latent space decoding generation recommendation method based on a large language model is implemented as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the latent space decoding generation recommendation method based on a large language model are implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Commodity recommendation method, system and device and storage medium
CN114896517A
Article recommendation model training method and device, electronic equipment and storage medium
CN115841366A
Multi-modal large language model training method and system based on multi-modal encoder
CN117218498A
Entity recommendation method and device based on large language model, equipment and storage medium
CN117273173A
E-commerce intelligent recommendation system based on user behavior big data
CN119671686A