A large language model recommendation method based on collaborative similarity alignment
By integrating a large language model with collaborative filtering signals through a similarity alignment mechanism and a quality assessment module, the problems of information discrepancies and noise were solved, thereby improving the accuracy and generalization ability of the recommendation system.
Patent Information
- Application Number
- CN202511202918.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-08-27
AI Technical Summary
In existing technologies, the fusion of large language models and collaborative filtering signals results in information discrepancies, leading to information loss and noise interference, which affects recommendation performance.
By fusing a large language model with collaborative filtering signals through a similarity alignment mechanism, and combining a quality assessment module to filter high-quality information, the embedding parameters are optimized using a cosine similarity algorithm and Manhattan distance, and popularity weights and preset thresholds are introduced to filter noise.
This improves the accuracy and generalization ability of recommendation systems, ensures that large models learn stable and reliable collaborative knowledge, and reduces information loss and noise interference.
Smart Images

Figure CN120687685B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of large model recommendation, in particular to a large language model recommendation method based on collaborative similarity alignment. BACKGROUND
[0002] In the past few decades, recommendation systems have greatly improved the ability to efficiently retrieve user preference content from massive data. Various large online platforms mine user interests from multiple information sources to achieve more accurate recommendations, thereby bringing extremely rich revenue. Although recommendation technology is constantly evolving, collaborative filtering signals still play a core role in recommendation systems, that is, users with similar behavior patterns often have similar purchase preferences. Here, the behavior patterns include historical click commodity sequences, user portraits, and attribute features of purchased commodities.
[0003] In recent years, large language models (LLMs) have reshaped the research paradigm in the recommendation field with their ability to encode world knowledge and excellent reasoning ability. Numerous researchers have invested a lot of effort in trying to explore more efficient ways to deeply integrate LLMs with recommendation systems. They start from different angles, either optimizing model structures to enhance the understanding of collaborative signals or designing new training paradigms to fully utilize user-item interaction data, striving to improve recommendation quality while overcoming the limitations of existing methods. However, there is a huge gap between the knowledge contained in large models and the collaborative information in recommendation systems. Previous research often relied on simple adapters to align the differences between the two, but this approach cannot fully understand the deep structure of collaborative signals, limiting the further development of large models in the recommendation task. On the other hand, collaborative filtering signals are mixed with a lot of noise, and if not distinguished, direct introduction may lead to misleading patterns learned by large models, thereby damaging the recommendation effect. SUMMARY
[0004] In this embodiment, a large language model recommendation method based on collaborative similarity alignment, device, electronic equipment and storage medium are provided to seamlessly integrate collaborative signals through a similarity alignment mechanism and introduce a quality evaluation module to filter high-quality information from a statistical and collaborative perspective, thereby improving the understanding ability of the recommendation system for user behavior and the recommendation effect.
[0005] In the first aspect, the application embodiment provides a large language model recommendation method based on collaborative similarity alignment, which comprises:
[0006] S100, a similarity alignment stage: extracting vector representations of items from language space embeddings generated by a large language model and row space embeddings generated by a collaborative filtering method, respectively;
[0007] a first similarity matrix between the language space embeddings and a second similarity matrix between the row space embeddings, and adjusting parameters of the large language model to make the language space embeddings reflect the similarity relationship of the row space embeddings by minimizing a difference between the first similarity matrix and the second similarity matrix;
[0008] S200, a quality evaluation stage: quality evaluation of the row space embedding based on a statistical perspective and a collaborative perspective, screening out high-quality collaborative signals meeting pre-trial conditions, wherein the statistical perspective adjusts the weight of collaborative similarity through the historical interaction frequency of the item, and the collaborative perspective filters low-quality similarity item pairs by setting a preset threshold.
[0009] S300, a joint training stage: complete end-to-end model training by jointly optimizing the similarity alignment loss and the standard training target of the language model to generate a recommendation result.
[0010] In an optional embodiment, the extraction method of the language space embedding comprises: using a large language model to encode the text information of the item to generate a semantic embedding vector.
[0011] The extraction method of the row space embedding is: based on the user-item interaction matrix, the ID embedding vector of the item is obtained by training a collaborative filtering model.
[0012] In an optional embodiment, the first similarity matrix and the second similarity matrix are calculated by using a cosine similarity algorithm.
[0013] In an optional embodiment, the optimization of the difference uses Manhattan distance as a loss function, and directly adjusts the embedding parameters of the large language model to minimize the difference.
[0014] In an optional embodiment, the screening of the statistical perspective is: calculating the popularity weight of the item according to the historical interaction frequency of the item, and weighting the collaborative similarity based on the weight to reduce the influence of cold start item pairs on similarity alignment.
[0015] In an optional embodiment, the collaborative perspective filters low-quality similarity item pairs by setting a preset threshold, which is formalized as follows:
[0016] ;
[0017] Wherein, represents the similarity of items i and j in the row space, is a set threshold, represents the weight coefficient of the coupling information between i and j.
[0018] In an optional embodiment, the screening of the collaborative view angle comprises:
[0019] A similarity threshold is set, and the weight of an item pair with a similarity lower than the threshold in the alignment process is reduced or the item pair is directly excluded.
[0020] In an optional embodiment, the loss function of the joint training is:
[0021] ;
[0022] wherein, is a standard training loss of a language model, is a similarity alignment loss, is a balance hyperparameter.
[0023] In an optional embodiment, the collaborative filtering model is selected from one of LightGCN or SASRec.
[0024] In an optional embodiment, the similarity threshold is set in a manner that the threshold is dynamically adjusted according to the distribution characteristics of the item space similarity matrix to adapt to the noise level of different data sets.
[0025] Compared with the prior art, the large language model recommendation method based on collaborative similarity alignment has the following beneficial effects:
[0026] The present application proposes a novel large model recommendation framework to seamlessly integrate the rich information contained in collaborative similarity. Specifically, the present application first introduces an alignment module, which includes extracting embeddings from a large language model and an item space, calculating respective similarities, and finally aligning the similarities, thereby avoiding the limitation of the adapter in the traditional method that only converts embeddings and cannot fully understand the collaborative signal. In addition, to improve the robustness of the large model, the present application further designs a quality evaluation module, which evaluates the quality of item embeddings from the statistical and collaborative perspectives, accurately screens and filters noise information, and ensures that the large model can learn stable and reliable collaborative knowledge, thereby significantly improving the accuracy and generalization ability of recommendation.
[0027] In a second aspect, an embodiment of the present application provides a large language model recommendation device based on collaborative similarity alignment, comprising:
[0028] A similarity alignment module is configured to extract vector representations of items from language space embeddings generated by a large language model and item space embeddings generated by a collaborative filtering method, respectively.
[0029] a first similarity matrix between the language space embeddings and a second similarity matrix between the item space embeddings, and adjusting parameters of the large language model to make the language space embeddings reflect the similarity relationship of the item space embeddings by minimizing the difference between the first similarity matrix and the second similarity matrix;
[0030] a quality evaluation module configured to perform quality evaluation on the item space embeddings based on a statistical perspective and a collaborative perspective, and filter high-quality collaborative signals that meet pre-trial conditions, wherein the statistical perspective adjusts the weight of collaborative similarity based on the historical interaction frequency of the item, and the collaborative perspective filters low-quality similar item pairs by setting a preset threshold;
[0031] a joint training module configured to perform complete end-to-end model training by jointly optimizing the similarity alignment loss and the standard training target of the language model, to generate a recommendation result.
[0032] In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a bus. The processor, the communication interface and the memory can communicate with each other through the bus. The processor can invoke a logical instruction in the memory to execute the steps of the method provided in the first aspect.
[0033] In a fourth aspect, a non-transitory computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the collaborative similarity alignment-based large language model recommendation method provided in the first aspect are implemented.
[0034] Compared with the prior art, the beneficial effects of the collaborative similarity alignment-based large language model recommendation device, the electronic device and the storage medium of the present application are the same as those of the collaborative similarity alignment-based large language model recommendation method of the first aspect, and therefore will not be described here. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0036] Figure 1 a flowchart of the collaborative similarity alignment-based large language model recommendation method in the embodiments of the present application;
[0037] Figure 2 a similarity-aware large model recommendation framework structure diagram in the embodiments of the present application;
[0038] Figure 3 A structural block diagram of the large language model recommendation device based on collaborative similarity alignment in an embodiment of the present application is shown in FIG. 1.
[0039] Figure 4 A structural block diagram of the electronic device in an embodiment of the present application is shown in FIG. 2. DETAILED DESCRIPTION
[0040] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and explained below in conjunction with the accompanying drawings and embodiments.
[0041] Unless otherwise defined, technical terms or scientific terms used in the present application shall have the general meaning understood by a person with ordinary skill in the art to which the present application belongs. In the present application, "one", "a", "an", "the", "these" and similar words do not represent a quantitative limitation, and they can be singular or plural. In the present application, the terms "include", "contain", "have" and any variants thereof have the purpose of covering non-exclusive inclusion; for example, a process, method and system, product or device containing a series of steps or modules (units) are not limited to the listed steps or modules (units), but can include steps or modules (units) not listed, or can include other steps or modules (units) inherent to the process, method, product or device. In the present application, the terms "connected", "connected", "coupled" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. In the present application, "multiple" means two or more. The association between the associated objects is described by "and / or", which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. In general, the character " / " represents an "or" relationship between the objects before and after it. In the present application, the terms "first", "second", "third" and the like are only used to distinguish similar objects, and do not represent a specific order of the objects.
[0042] First, the technical solutions of the present application are briefly described. The purpose of the present application is to provide a method of fusing large language models and collaborative signals, seamlessly fusing collaborative signals through a similarity alignment mechanism, and introducing a quality evaluation module to filter high-quality information from a statistical and collaborative perspective, thereby improving the understanding ability of the recommendation system for user behavior and the recommendation effect.
[0043] The implementation process of the present application is divided into two stages. In the first stage, the goal of the present application is to align the similarity of large language models with user behavior space, and through the similarity alignment mechanism, the large model can understand the potential pattern of the collaborative signal. In the second stage, based on the alignment result of the first stage, the quality evaluation module is introduced to filter high-quality collaborative information from the statistical and collaborative perspective to improve the accuracy and generalization ability of the recommendation.
[0044] In the first stage, the present application designs a similarity alignment module, aiming to enable the large language model to understand and absorb the inherent pattern of the collaborative signal. Specifically, the module first extracts embeddings from the large language model and the user behavior space, respectively calculates the text-based embedding similarity and the user behavior-based embedding similarity. Subsequently, through the similarity alignment mechanism, the embeddings in the large language model are adjusted so that they can reflect the similarity relationship in the user behavior space in the language space, thereby bridging the gap between the two. This way avoids the limitation of the traditional method that the adapter only performs embedding conversion and cannot deeply understand the collaborative information.
[0045] In the second stage, the present application introduces a quality evaluation module to ensure that the alignment process can filter out noise information and retain high-quality collaborative knowledge. Specifically, the module evaluates the quality of item embeddings from both statistical and collaborative perspectives. In the statistical perspective, the present application adjusts the influence of cold-start items based on the popularity information of items to avoid low-quality embeddings interfering with model learning. In the collaborative perspective, the present application measures the collaborative similarity between items, sets an adaptive threshold, filters out reliable collaborative signals, and suppresses the spread of noise information. Ultimately, the module can ensure that the large language model focuses on learning high-quality collaborative information, thereby improving the accuracy and generalization ability of the recommendation system.
[0046] Specifically, a large language model recommendation method based on collaborative similarity alignment is provided in the embodiment of the present application, Figure 1 is a flowchart of the large language model recommendation method based on collaborative similarity alignment of the present application, as Figure 1 shown, the flow includes the following steps:
[0047] S100, similarity alignment stage: extracting vector representations of items from language space embeddings generated by a large language model and behavior space embeddings generated by a collaborative filtering method, respectively;
[0048] calculating a first similarity matrix between language space embeddings and a second similarity matrix between behavior space embeddings, adjusting the parameters of the large language model by minimizing the difference between the first similarity matrix and the second similarity matrix, so that the language space embeddings reflect the similarity relationship of the behavior space embeddings; it should be noted that the calculation of the first similarity matrix and the second similarity matrix both uses cosine similarity algorithm.
[0049] Specifically, the extraction manner of the language space embedding includes: encoding the text information of the item by using a large language model to generate a semantic embedding vector;
[0050] The extraction manner of the behavior space embedding is: based on a user-item interaction matrix, an ID embedding vector of the item is obtained by training a collaborative filtering model.
[0051] Since there is a significant difference between the embedding space of the large language model and the embedding space of the traditional collaborative filtering method in terms of representation and feature distribution, directly aligning the embeddings of the two will result in information loss or semantic distortion. Therefore, the application proposes a similarity alignment mechanism, which guides the embedding of LLMs to gradually approach the collaborative information contained in the user behavior data by comparing the similarity structures in the two spaces, thereby making up for the shortcomings of the traditional adapter method.
[0052] The application first extracts the vector representation of the item from the language space (semantic embedding generated by LLM) and the behavior space (ID embedding based on the collaborative filtering method).
[0053] Behavior space embedding: the embedding vector of the item ID is obtained by using a mature collaborative filtering method (such as LightGCN, SASRec). The vector is trained by a user-item interaction matrix and can capture the collaborative relationship between items.
[0054] ;
[0055] wherein, represents embedding information obtained by a traditional ID-based recommendation method, c represents a traditional collaborative filtering method, represents the parameter information that has been trained, represents processing of the item i by using a traditional recommendation system.
[0056] Language space embedding: for each item, the application encodes the text information (such as title, description) of the item by using a large language model to generate a high-dimensional semantic embedding.
[0057] ;
[0058] wherein, represents embedding information obtained by encoding the title by using a large model, represents the parameters of the large model, and LLM represents processing of the item i by using a large-scale language model, represents the title of the item i.
[0059] Further, in order to establish the connection between the two spaces, the application calculates the behavior space similarity and the language space similarity respectively, and uses them as the basis for alignment.
[0060] Item similarity in action space: measures the similarity of item pairs in the collaborative filtering method by calculating the cosine similarity between ID-based embedding vectors.
[0061] Item similarity in language space: measures the closeness of items in the semantic space by calculating the cosine similarity between item embeddings generated by LLMs.
[0062] ;
[0063] where i and j represent two different items, and represent the representations of items i and j obtained after traditional methods , and represent the representations of items i and j obtained after processing by large language models. , and represent the similarity between items i and j in the action space and the language space, respectively, and cosine_similarity represents the cosine similarity between two vectors.
[0064] Further, after obtaining the similarity matrices in the two spaces, the present application optimizes the parameters of the large language model using a similarity alignment loss to minimize the difference in similarity between the two;
[0065] ;
[0066] represents a distance function used to express the difference between similarity and , note that any distance function can be used to calculate the difference between the two. represents the difference between the information of items i and j, where the difference is calculated by default using a distance function, i.e., the farther the distance, the greater the difference between items i and j. is the sum of the differences of all item pairs (i, j) as an alignment loss. Our goal is to reduce this alignment loss, thereby aligning the signals of the traditional recommendation method and the large language model method. Without loss of generality, the optimization of the difference uses Manhattan distance as the loss function, which directly adjusts the embedding parameters of the large language model to minimize the difference. The present application uses Manhattan distance:
[0067] ;
[0068] represents a distance function used to express the difference between similarity and , | represents the difference between two similarities, while | - | represents the absolute value.
[0069] Furthermore, this invention directly adjusts the embedding of large models, enabling them to actively approach similar structures in the behavior space during training, thereby avoiding information loss caused by traditional adapter methods that only perform simple embedding transformations.
[0070] S200, Quality Assessment Stage: The quality of behavioral space embedding is assessed based on statistical and collaborative perspectives to select high-quality collaborative signals that meet the pre-screening criteria. The statistical perspective adjusts the weight of collaborative similarity based on the historical interaction frequency of items, while the collaborative perspective filters out low-quality similarity item pairs by setting a preset threshold.
[0071] The statistical perspective of selection involves calculating the popularity weight of an item based on its historical interaction count, and then weighting the collaborative similarity based on this weight to reduce the impact of cold-start items on similarity alignment.
[0072] The selection criteria for a collaborative perspective include:
[0073] Set a similarity threshold, and reduce the weight of item pairs with similarity below the threshold in the behavior space during the alignment process or exclude them directly.
[0074] The collaborative filtering model is selected from either LightGCN or SASRec.
[0075] The similarity threshold is set by dynamically adjusting the threshold according to the distribution characteristics of the behavior space similarity matrix to adapt to the noise level of different datasets.
[0076] Specifically, while similarity alignment enables LLMs to learn collaborative knowledge, the ID embeddings in traditional collaborative filtering methods often contain noise; for example, low-quality embeddings of cold-start items may affect the model's learning. Therefore, this invention further designs a quality assessment module to ensure that LLMs only absorb high-quality collaborative signals. The formula is as follows:
[0077] ;
[0078] in, This represents the difference between items i and j. This represents the distance difference between two similarities. The weight representing this distance, i.e. Not only affected by the distance function The constraints should also be subject to a weighting function to prevent certain items from having an excessive impact on (i, j). Weighting It is divided into 3 parts, among which, is the weight coefficient representing the coupling information between items i and j, and is the weight coefficient representing the coupling information between items i and j, and is the weight coefficient representing the coupling information between items i and j, and
[0079] Further, since the interaction data of cold-start items is sparse, the embedding vectors of the items often lack sufficient training and cannot accurately reflect the real collaborative relationship of the items. Therefore, the application adopts a popularity weighting strategy to adjust the similarity weight of the items according to the historical interaction frequency of the items.
[0080] The application uses the following function to measure the popularity of the items and weight the collaborative similarity of the items:
[0081] ;
[0082] wherein, represents the weight represented by the internal attribute of item i, tanh represents the tangent function, the function expression of which is tanh(x)=sinh(x) / cosh(x), which is used to limit the weight range to-1~1, log represents the logarithmic function, which is used to prevent the numerical inflation phenomenon caused by the large pop function. pop(i) represents the historical interaction times of item i, is a hyperparameter for controlling the influence of popularity. Through this method, the model can pay more attention to items with high popularity and weaken the influence of cold-start items on similarity alignment.
[0083] Relying only on popularity information is not enough to completely remove low-quality embedding, so the application further adopts a collaborative similarity screening strategy to filter noise information based on the collaborative relationship between items.
[0084] ;
[0085] wherein, represents the similarity of item i and j in the traditional recommendation embedding space, is a threshold value. represents an indicator function, that is, when is greater than the threshold value , the output is 1, and when is less than the threshold value , the output is 0. represents the weight of the output of the coupling information between items i and j. For item pairs below the threshold value, the application reduces their influence in the alignment process to ensure that the LLMs only learn high-quality collaborative information.
[0086] Finally, the application combines statistical and collaborative perspectives to build a robust quality evaluation mechanism, enabling large language models to absorb collaborative signals while avoiding noise interference, thereby improving the reliability and generalization ability of recommendations.
[0087] ;
[0088] As described above, represents the weight coefficient corresponding to the distance function, which is used to re-evaluate the alignment difference between item pair (i, j). That is, the coupling coefficient , and represents the weight coefficient formed by the internal attributes of items i and j. The multiplication of the three obtains the final weight coefficient , which indicates that only when the similar item pairs in the traditional recommendation embedding space and the number of their own items are sufficient, i.e. the trained sufficient commodity pairs, are more likely to participate in the alignment training. This is because there is a lot of noise information in the traditional recommendation system, and if the item itself is a cold-start commodity, its embedding information is unreliable.
[0089] S300, joint training phase: by jointly optimizing the similarity alignment loss and the standard training target of the language model, complete end-to-end model training to generate the recommendation result.
[0090] The application jointly optimizes the similarity alignment loss and the next word prediction loss to realize end-to-end training:
[0091] ;
[0092] ;
[0093] ;
[0094] where CE represents the cross-entropy loss, i.e. given a text information , based on the parameters of the large model , we can get the prediction result of the next word , then we need to use CE, i.e. cross-entropy loss, to calculate the difference between the prediction result and the correct result . And , N represents the total number of samples, L represents the number of words in the text information within a sample, so represents the predicted word for each sample in all samples The sum of the differences between them is the standard training target of the language model, and is the similarity alignment loss, which has been described in detail above, is the hyperparameter for balancing the two.
[0095] The present application proposes a novel similarity-aware large model recommendation framework structure to seamlessly integrate the rich information contained in collaborative similarity. Specifically, the present application first introduces an alignment module, which includes extracting embeddings from the large language model and the user space, calculating the respective similarities, and finally aligning the similarities, thereby avoiding the limitations of the adapter in the traditional method that only converts embeddings and cannot fully understand the collaborative signal. In addition, to improve the robustness of the large model, the present application further designs a quality evaluation module, which evaluates the quality of item embeddings from the statistical and collaborative dual perspectives, accurately filters and filters noise information, and ensures that the large model can learn stable and reliable collaborative knowledge, thereby significantly improving the accuracy and generalization ability of the recommendation.
[0096] As can be seen from the technical solutions provided by the present application, compared with other embedding conversion methods of large model recommendation, the present application explores more essential collaborative similarity signals to guide the large model to learn recommendation knowledge, avoiding information loss. In addition, the quality evaluation module introduced by the present application can accurately filter noise data and only retain high-quality collaborative signals, thereby improving the accuracy and generalization of the recommendation results.
[0097] The embodiment of the present application also provides a large language model recommendation device based on collaborative similarity alignment, which is used to implement the above-mentioned method embodiment and has been described. The terms "module", "unit", "sub-unit" and the like used below can be a combination of software and / or hardware that realizes the predetermined function. Although the device described in the following embodiment is preferably realized in software, hardware or a combination of software and hardware is also possible and is conceived.
[0098] As Figure 3 shown, Figure 3 is the structure block diagram of the large language model recommendation device based on collaborative similarity alignment in the present application, which comprises:
[0099] The similarity alignment module 101 is used to extract the vector representation of the item from the language space embedding generated by the large language model and the user space embedding generated by the collaborative filtering method, respectively.
[0100] The first similarity matrix between the language space embeddings and the second similarity matrix between the user space embeddings are calculated, and by minimizing the difference between the first similarity matrix and the second similarity matrix, the parameters of the large language model are adjusted to make the language space embedding reflect the similarity relationship of the user space embedding.
[0101] The quality evaluation module 102 is configured to perform quality evaluation on the row space embedding based on a statistical perspective and a collaborative perspective, and filter out high-quality collaborative signals meeting pre-trial conditions, wherein the statistical perspective adjusts the weight of collaborative similarity by the historical interaction frequency of the items, and the collaborative perspective filters low-quality similar item pairs by setting a preset threshold.
[0102] The joint training module 103 is configured to perform complete end-to-end model training by jointly optimizing the similarity alignment loss and the standard training target of the language model, to generate a recommendation result.
[0103] Figure 4 The structure block diagram of the electronic device provided by the embodiment of the present application is shown in Figure 4 The electronic device can include a processor 610, a communications interface 620, a memory 630 and a communications bus 640, wherein the processor 610, the communications interface 620 and the memory 630 complete mutual communication through the communications bus 640. The processor 610 can invoke the logical instructions in the memory 630 to execute the following method:
[0104] S100, similarity alignment stage: extracting vector representations of items from language space embeddings generated by a large language model and row space embeddings generated by a collaborative filtering method, respectively;
[0105] calculating a first similarity matrix between the language space embeddings and a second similarity matrix between the row space embeddings, adjusting parameters of the large language model by minimizing the difference between the first similarity matrix and the second similarity matrix, so that the language space embeddings reflect the similarity relationship of the row space embeddings;
[0106] S200, quality evaluation stage: performing quality evaluation on the row space embedding based on a statistical perspective and a collaborative perspective, and filtering out high-quality collaborative signals meeting pre-trial conditions, wherein the statistical perspective adjusts the weight of collaborative similarity by the historical interaction frequency of the items, and the collaborative perspective filters low-quality similar item pairs by setting a preset threshold.
[0107] S300, joint training stage: performing complete end-to-end model training by jointly optimizing the similarity alignment loss and the standard training target of the language model, to generate a recommendation result.
[0108] In addition, the logic instructions in the memory 630 described above can be implemented in the form of software function units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0109] The embodiments of the present application also provide a non-transitory computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method provided by the above-mentioned embodiments.
[0110] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus necessary universal hardware platforms, and of course, can also be implemented by hardware. Based on this understanding, the above technical solutions essentially or the parts that contribute to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the method of each embodiment or some parts of the embodiment.
[0111] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A large language model recommendation method based on collaborative similarity alignment, characterized in that, The large language model recommendation method based on collaborative similarity alignment comprises: S100, a similarity alignment stage: extracting vector representations of items from language space embeddings generated by a large language model and row space embeddings generated by a collaborative filtering method; calculating a first similarity matrix between the language space embeddings and a second similarity matrix between the row space embeddings, and adjusting parameters of the large language model to make the language space embeddings reflect the similarity relationship of the row space embeddings by minimizing the difference between the first similarity matrix and the second similarity matrix; S200, a quality evaluation stage: quality evaluation of the row space embedding based on a statistical perspective and a collaborative perspective, screening out high-quality collaborative signals meeting pre-trial conditions, wherein the statistical perspective adjusts the weight of collaborative similarity by the historical interaction frequency of the item, and the collaborative perspective filters low-quality similar item pairs by setting a preset threshold; S300, a joint training stage: completing end-to-end model training by jointly optimizing the similarity alignment loss and the standard training target of the language model to generate a recommendation result.
2. The large language model recommendation method based on cooperative similarity alignment according to claim 1, characterized in that, The extraction method of the language space embedding comprises: encoding the text information of the item by using the large language model to generate a semantic embedding vector; The extraction method of the row space embedding is: based on the user-item interaction matrix, the ID embedding vector of the item is obtained by training the collaborative filtering model.
3. The large language model recommendation method based on cooperative similarity alignment according to claim 1, characterized in that, The first similarity matrix and the second similarity matrix are calculated by using the cosine similarity algorithm.
4. The large language model recommendation method based on cooperative similarity alignment according to claim 1, characterized in that, The optimization of the difference uses Manhattan distance as a loss function, and directly adjusts the embedding parameters of the large language model to minimize the difference.
5. The large language model recommendation method based on cooperative similarity alignment according to claim 1, characterized in that, The statistical perspective screening specifically calculates the popularity weight of the item according to the historical interaction frequency, and weights the collaborative similarity based on the popularity weight to reduce the influence of cold start item pairs on similarity alignment.
6. The large language model recommendation method based on cooperative similarity alignment according to claim 1, characterized in that, The collaborative perspective filters low-quality similar item pairs by setting a preset threshold, which is formalized as follows: ; wherein, represents a similarity of the items i and j in the action space, is a set threshold value, represents a weight coefficient of the coupling information between i and j.
7. The large language model recommendation method based on cooperative similarity alignment according to claim 1, characterized in that, The collaborative perspective screening comprises: Set a similarity threshold, reduce the weight of the item pair with a similarity lower than the threshold in the alignment process or directly exclude it.
8. The large language model recommendation method based on cooperative similarity alignment according to claim 1, characterized in that, The loss function of the joint training is: ; wherein, is the standard training loss for the language model, is the similarity alignment loss, is the balancing hyperparameter.
9. The large language model recommendation method based on cooperative similarity alignment according to claim 2, characterized in that, The collaborative filtering model is selected from one of LightGCN or SASRec.
10. The large language model recommendation method based on cooperative similarity alignment according to claim 7, characterized in that, The setting method of the similarity threshold is: according to the distribution characteristics of the row space similarity matrix, dynamically adjusting the threshold to adapt to the noise level of different data sets.
Citation Information
Patent Citations
Cross-domain sequence recommendation method and system based on sequence perception article feature alignment
CN118132846A
Graph denoising collaborative filtering recommendation method based on alignment and uniformity
CN120541312A