Recommendation service decoupling granularity adjustment method and system based on sparsity adaptation
Patent Information
- Application Number
- CN202611444299.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-17
- Publication Date
- 2026-10-20
AI Technical Summary
[0006]然而,现有偏好解耦推荐方法存在一个现有技术未曾揭示的深层次技术问题:解耦粒度的固定设置与用户数据稀疏程度之间存在“失配”关系
(1)稀疏度自适应粒度调节:根据用户交互稀疏度动态调节解耦粒度,采用修正对数映射(含交互质量因子)使粒度调节同时考虑交互数量与交互质量两个维度,稀疏用户采用粗粒度解耦避免过度分解,密集用户采用细粒度解耦充分表达,有效缓解稀疏数据推荐瓶颈。同时,引入非线性指数参数后,可在极稀疏端获得更保守的粗粒度分配,在密集端获得更激进的细粒度分配,进一步增强自适应调节的灵活性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for decoupling granularity adjustment of recommendation services based on sparsity adaptiveness. Background Technology
[0002] E-commerce recommendation systems are one of the core technologies of modern internet commerce. Their fundamental task is to establish precise information matching between users and merchants—users search for items of interest from a vast array of products, while merchants aim to efficiently showcase their goods to potential consumers. The system predicts products that users might be interested in based on their historical behavior (such as clicks, browsing, and purchases) and pushes the predictions to the user, thereby shortening user search time and improving merchants' conversion rates.
[0003] However, recommender systems face a common and challenging technical problem in practical applications: data sparsity. Data sparsity refers to a situation where the vast majority of elements in the "user-item" interaction matrix of a recommender system are zero. Taking a typical small-to-medium-sized e-commerce platform as an example: the platform may have tens of thousands of products, but a single user typically only interacts with a very small portion of them (including browsing, clicking, or purchasing). The direct technical consequence of data sparsity is that traditional collaborative filtering algorithms, which infer preferences based on the fullness of the interaction matrix, cannot establish accurate user-item associations when data is insufficient, resulting in recommendation results that deviate significantly from the user's true interests.
[0004] The main reasons for data sparsity include: a lack of historical behavior records after new user registration (i.e., the cold start problem); no user interaction data in the early stages of new product listings; and the inherently low user traffic and interaction frequency on small and medium-sized e-commerce platforms. These factors combined make it difficult for recommendation systems on small and medium-sized e-commerce platforms to operate effectively under sparse data conditions.
[0005] To address the problem of data sparsity, a technical approach that incorporates the concept of decoupling user preferences into recommender systems has emerged in recent years. Preference decoupling refers to separating a user's various preferences (such as price sensitivity, brand preference, and style preference) that are initially "mixed together" into several independent preference factors. Each factor represents a preference dimension, thereby providing a more refined characterization of the user's interest structure. Existing research has shown that designing decoupling modules to decompose user preferences into multiple independent factors can yield more accurate user representations even with sparse data.
[0006] However, existing preference decoupling recommendation methods have a deep-seated technical problem that has not been revealed by existing technologies: there is a "mismatch" between the fixed setting of decoupling granularity and the sparsity of user data.
[0007] Specifically, existing preference decoupling recommendation methods generally preset the decoupling granularity to a fixed value, meaning that regardless of whether a user is new or active, preferences are uniformly decomposed into a fixed number of K factors. This strategy has the following inherent drawbacks: (1) Over-decomposition of sparse users. For new users with only 2-3 interaction records, if fine-grained decoupling is used (such as splitting into 8 factors), each factor will be allocated less than 1 training sample on average, making it impossible to effectively learn meaningful preference representations. This makes decoupling not only useless but also harmful to sparse users.
[0008] (2) Insufficient representation of intensive users. For active users with hundreds of interaction records, if coarse-grained decoupling (such as splitting into 3 factors) is adopted, a large amount of detailed preference information is lost, and the multidimensional preference structure of users cannot be fully expressed.
[0009] (3) Fixed granularity cannot adapt to differences in data distribution. In real-world scenarios, the amount of interaction data from different users can vary by several orders of magnitude. Using a single fixed granularity to adapt to all users will inevitably lead to a "one-size-fits-all" adaptation dilemma.
[0010] The above problems are particularly prominent on small and medium-sized e-commerce platforms. These platforms have low user traffic and interaction frequency, and a high proportion of "cold start users." Fixed-granularity decoupling methods will further exacerbate the dilemma of sparse user preferences not being effectively learned. Summary of the Invention
[0011] Therefore, the purpose of this invention is to provide a method and system for decoupling granularity adjustment of recommendation services based on sparsity adaptation, so as to at least solve the shortcomings of the above-mentioned technologies.
[0012] This invention proposes a sparsity-adaptive method for decoupling the granularity of recommendation services, comprising: Obtain the number of interactive items for the target user, and dynamically calculate the decoupling granularity based on the number of interactive items using a preset mapping function; Based on the decoupling granularity, the original embedding vector of the target user is mapped to a corresponding number of preference factors through several independent linear transformation networks; Orthogonality constraints are applied to each of the preference factors to ensure that each preference factor is independent of the others in the feature space, so as to obtain the corresponding orthogonality constraint loss. Based on the decoupling granularity, a sparsity consistency loss is constructed, and a recommendation prediction loss is constructed. Based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss, a multi-task joint optimization objective is constructed. An end-to-end model training is performed using a gradient variance-based dynamic weight adjustment strategy to obtain an optimized model. Personalized recommendation results are then generated using the optimized model.
[0013] Furthermore, the steps of obtaining the number of interactive items for the target user and dynamically calculating the decoupling granularity based on the number of interactive items using a preset mapping function include: Obtain the target user's historical interaction data, and obtain the corresponding number of interactive items and interaction quality factor based on the historical interaction data; The decoupling granularity is dynamically calculated based on the number of interactive items and the interaction quality factor using a preset mapping function.
[0014] Furthermore, the interaction quality factor The calculation formula is: ; In the formula, Represents items The normalized value of global interaction frequency. Indicates user With items Relevance weight of interactions Indicates user The number of interactive items; The decoupling granularity The calculation formula is:
[0015] In the formula, This represents the upper limit of the maximum granularity. This represents the floor function. Represents the logarithmic function with base 2. Indicates the scaling adjustment parameter. This is the intercept adjustment parameter. This is a non-linear exponential adjustment parameter.
[0016] Furthermore, the formula for calculating the preference factor is as follows:
[0017] In the formula, This represents the original embedding vector of the target user. Indicates the embedding dimension. Indicates the first The learnable weight matrix corresponding to each preference factor This represents the bias vector. This represents a non-linear activation function.
[0018] Furthermore, the formula for calculating the orthogonality constraint loss is as follows:
[0019] In the formula, This indicates the decoupling granularity corresponding to the user. Indicates the same user's number A vector representing each preference factor. Indicates the same user's number A vector representing each preference factor. The L2 norm of a vector. It is a very small positive number. Represents the matrix transpose of a vector.
[0020] Furthermore, the formula for calculating the sparsity consistency loss is as follows:
[0021] In the formula, This represents the average decoupling granularity of all users. Represents the square of the L2 norm; The formula for calculating the total loss function, constructed based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss, is as follows:
[0022] In the formula, This represents the recommendation prediction loss, used to measure the accuracy of the recommendation results. This represents the weighting coefficient for the recommended prediction loss. The weighting coefficients represent the orthogonality constraint loss. The weighting coefficients represent the sparsity consistency loss.
[0023] This invention also proposes a sparsity-adaptive recommendation service decoupling granularity adjustment system, comprising: The interactive data acquisition module is used to acquire the number of interactive items of the target user, and dynamically calculate the decoupling granularity based on the number of interactive items using a preset mapping function. The decoupling granularity calculation module is used to map the original embedding vector of the target user into a corresponding number of preference factors through several independent linear transformation networks according to the decoupling granularity. The orthogonality constraint module is used to apply orthogonality constraints to each of the preference factors to ensure that each preference factor is independent of the others in the feature space, so as to obtain the corresponding orthogonality constraint loss. The joint optimization module is used to construct a sparsity consistency loss and a recommendation prediction loss based on the decoupling granularity. It constructs a multi-task joint optimization objective based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss. It performs end-to-end model training through a gradient variance-based dynamic weight adjustment strategy to obtain an optimized model. The optimized model is then used to generate personalized recommendation results.
[0024] Furthermore, the interactive data acquisition module is specifically used for: Obtain the target user's historical interaction data, and obtain the corresponding number of interactive items and interaction quality factor based on the historical interaction data; The decoupling granularity is dynamically calculated based on the number of interactive items and the interaction quality factor using a preset mapping function.
[0025] The present invention also proposes a storage medium on which a computer program is stored, which, when executed by a processor, implements the above-described method for adjusting the decoupling granularity of recommendation services based on sparsity adaptation.
[0026] The present invention also proposes a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for decoupling granularity adjustment of recommendation services based on sparsity adaptation.
[0027] The sparsity-adaptive recommendation service decoupling granularity adjustment method and system of this invention have the following beneficial effects: (1) Sparsity Adaptive Granularity Adjustment: The decoupling granularity is dynamically adjusted according to the sparsity of user interactions. A modified logarithmic mapping (including an interaction quality factor) is used to ensure that the granularity adjustment considers both the quantity and quality of interactions. Coarse-grained decoupling is used for sparse users to avoid over-decomposition, while fine-grained decoupling is used for dense users to fully express their interactions, effectively alleviating the bottleneck of sparse data recommendation. At the same time, a nonlinear exponential parameter is introduced. Subsequently, a more conservative coarse-grained allocation can be obtained at the sparse end, and a more aggressive fine-grained allocation can be obtained at the dense end, further enhancing the flexibility of adaptive adjustment.
[0028] (2) Orthogonality constraint of preference factors: The orthogonality constraint in the form of cosine similarity ensures that different preference factors are independent of each other and are not affected by the vector magnitude, so that the decoupled preference factors can truly express different preference dimensions independently.
[0029] (3) Dynamic weight joint optimization: A dynamic weight adjustment strategy based on gradient variance is adopted, with weight adjustment and decoupling granularity linked to ensure that the contribution of each loss term to the total loss remains balanced, thereby improving the stability and generalization ability of model training. Attached Figure Description
[0030] Figure 1 This is a flowchart of the sparsity-adaptive recommendation service decoupling granularity adjustment method in the first embodiment of the present invention; Figure 2 This is a deployment diagram of the sparsity-adaptive recommendation service decoupling granularity adjustment method in the first embodiment of the present invention; Figure 3This is a structural block diagram of the sparsity-adaptive recommendation service decoupling granularity adjustment system in the second embodiment of the present invention. Figure 4 This is a structural block diagram of the computer in the third embodiment of the present invention.
[0031] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0032] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0034] Example 1 Please see Figure 1 The figure shows a method for decoupling granularity adjustment of recommendation services based on sparsity adaptation in the first embodiment of the present invention. The method specifically includes steps S101 to S104: S101, obtain the number of interactive items for the target user, and dynamically calculate the decoupling granularity based on the number of interactive items using a preset mapping function; Furthermore, step S101 specifically includes steps S1011 to S1012: S1011, Obtain the target user's historical interaction data, and obtain the corresponding number of interactive items and interaction quality factor based on the historical interaction data; S1012, the decoupling granularity is dynamically calculated based on the number of interactive items and the interaction quality factor using a preset mapping function.
[0035] For specific implementation details, please refer to [link / reference]. Figure 2 The method in this embodiment is deployed in the cloud data center of an e-commerce platform. This e-commerce platform targets two user groups: consumers who purchase goods and merchants who operate stores. Both types of users access cloud recommendation services via the internet to obtain personalized product recommendations or manage related functions.
[0036] The complete request path for the user is: User → Internet → Cloud entry point (application load balancer) → Cloud server cluster (running the algorithm module of this invention) → Data storage center.
[0037] User devices (APP / webpage / mini-program) send recommendation requests to the cloud via the internet using the HTTP / HTTPS protocol. After the request arrives at the cloud, it is first received by the application load balancer located at the cloud entry point, and then distributed to the backend servers with lower loads for processing based on the current load status of each server in the cloud server cluster (such as CPU utilization, memory utilization, number of active connections, etc.).
[0038] The cloud server cluster consists of multiple high-configuration servers (equipped with CPU / GPU). The method in this embodiment is deployed and runs in a virtual computing instance of the server cluster. During execution, the server cluster reads user-item interaction history data from the data storage center (composed of a distributed storage array) through a high-speed internal network. After completing decoupled granularity calculation, preference factor decomposition, and model optimization, it generates personalized recommendation results and returns them to the user's end via the Internet.
[0039] The decoupling granularity determines the fineness of user preference decomposition and is a key parameter affecting recommendation performance under sparse data conditions. For users with sparse interaction records, excessively fine decoupling granularity leads to insufficient training samples for each preference factor and invalidation of representation learning; for users with dense interaction records, excessively coarse decoupling granularity results in the loss of preference details and limited expressive power. Therefore, the decoupling granularity should be set differently according to the actual distribution characteristics of user interaction data. This embodiment proposes to dynamically determine the decoupling granularity based on the quantity and quality of user interactions, that is, the fewer the interactions and the lower the quality, the coarser the granularity, and the more the interactions and the higher the quality, the finer the granularity.
[0040] Get the number of interactive items for the target user The decoupling granularity of the user is determined by a preset mapping function. Utilizing the optimal fit between decoupling granularity and the number of user interactions—that is, coarse granularity results in insufficient expressive power, while fine granularity leads to scattered training signals—a dynamic correction factor based on interaction quality is introduced into the mapping process to improve the accuracy and flexibility of granularity adjustment. This allows granularity adjustment to consider both the number and quality of interactions simultaneously. The interaction quality factor... The calculation formula is: ; In the formula, Represents items The normalized value of global interaction frequency. Indicates user With items Relevance weight of interactions Indicates user The number of interactive items, The closer it is to 1, the more granular the adjustment; the lower the interaction quality (such as accidental clicks, brief browsing). The smaller the size, the more conservative the granularity adjustment; The decoupling granularity The calculation formula is:
[0041] In the formula, This represents the upper limit of the maximum granularity. This represents the floor function. Represents the logarithmic function with base 2. Indicates the scaling adjustment parameter. In this embodiment, the intercept adjustment parameter is used. The value is 3.0. The value is 2.0. This is a non-linear exponential adjustment parameter, and in this embodiment, its value is 0.9.
[0042] A logarithmic mapping is used to gradually slow down the rate at which the decoupling granularity increases with the number of interactions, avoiding overfitting caused by excessively large granularity for active users. A nonlinear exponent is introduced. Subsequently, a more conservative coarse-grained allocation can be obtained at the extremely sparse end (where user interaction is minimal), and a more aggressive fine-grained allocation can be obtained at the dense end (where user interaction is high), thereby further enhancing the flexibility of adaptive adjustment.
[0043] Furthermore, the granularity adjustment mechanism in this embodiment includes three levels: the first level is a coarse-grained baseline setting driven by the number of user interactions (logarithmic mapping); the second level is a fine-grained correction driven by the interaction quality factor (…). The third layer is a linkage mechanism between decoupling granularity and preference factor learning network parameter initialization: the larger the granularity, the larger the initialization range of network parameters corresponding to each preference factor, in order to adapt to coarser-grained preference expressions; the smaller the granularity, the smaller the initialization range, in order to adapt to finer preference differentiation. The three-layer mechanism works synergistically to achieve a complete adaptive link from "quantity perception - quality perception - parameter adaptation," that is, decoupling granularity. The granularity determines the parameter initialization range of the preference factor network; a larger granularity results in a larger initialization range, and a smaller granularity results in a smaller initialization range. For example: set up , , The correspondence between the number of user interactions and the decoupling granularity is shown in Table 1 below: Table 1
[0044] In the table above, "number of interactions" refers to... "Interaction quality" means "Effective interaction count" = number of interactions × interaction quality; "Decoupling granularity" is... It can be seen that the decoupling granularity increases with the number of user interactions (effective interactions). At the same time, it is affected by the interaction quality factor. Under the same number of interactions, high-quality users get finer granularity, while low-quality users get coarser granularity.
[0045] S102, according to the decoupling granularity, the original embedding vector of the target user is mapped to a corresponding number of preference factors through several independent linear transformation networks; In practical implementation, the decoupling granularity is determined. Next, the user's high-dimensional original embedding vector needs to be decomposed into... Each of the several low-dimensional preference factors corresponds to an independent preference dimension. This decomposition process is achieved through... Each network is implemented using an independent linear transformation network, and each network learns feature maps for different preference dimensions, so that each decomposed preference factor can independently express different aspects of user preferences.
[0046] In the process of preference factor learning, according to the decoupling granularity The parameter initialization range of the network corresponding to each preference factor is dynamically adjusted: the larger the granularity, the larger the initialization range, in order to adapt to coarser-grained preference expression; the smaller the granularity, the smaller the initialization range, in order to adapt to finer preference differentiation.
[0047] The user's original embedding vector is passed through Each independent linear transformation network is mapped to Each preference factor represents:
[0048] Among them, the initialization range and decoupling granularity of each network parameter Collaboration: Initialization range In other words, the larger the granularity, the larger the parameter initialization range, enabling the model to express preferences with coarser granularity, and each factor network has a larger parameter space to adapt to more refined preference differentiation; the smaller the granularity, the smaller the parameter initialization range, enabling the model to differentiate preferences with finer granularity, and the parameter space of each factor network is correspondingly compressed. The linkage between granularity and network parameter initialization range extends adaptive adjustment from the numerical level to the model structure level.
[0049] In the formula, This represents the original embedding vector of the target user. Indicates the embedding dimension. Indicates the first The learnable weight matrix corresponding to each preference factor This represents the bias vector. This represents a non-linear activation function, using the ReLU activation function.
[0050] S103, apply orthogonality constraints to each of the preference factors to ensure that each of the preference factors is independent of each other in the feature space, so as to obtain the corresponding orthogonality constraint loss; In practical implementation, to ensure that each decomposed preference factor can independently express different preference dimensions, constraints need to be imposed on the correlation between different factors. Without this constraint, different preference factors may overlap in the feature space, making it impossible for each factor to independently distinguish different preference types, thus affecting the accuracy of the recommender system in characterizing user preferences. Orthogonality constraints ensure that different preference factors are independent in the feature space. The formula for calculating the orthogonality constraint loss is:
[0051] In the formula, This indicates the decoupling granularity corresponding to the user. Indicates the same user's number A vector representing each preference factor. Indicates the same user's number A vector representing each preference factor. The L2 norm of a vector. It is a very small positive number; in this embodiment, it is taken as 10. -8 This constraint, used to prevent the denominator from being zero, takes the form of cosine similarity and is unaffected by the vector magnitude after normalization. Represents the matrix transpose of a vector.
[0052] S104. Construct a sparsity consistency loss and a recommendation prediction loss based on the decoupling granularity. Construct a multi-task joint optimization objective based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss. Perform end-to-end model training using a gradient variance-based dynamic weight adjustment strategy to obtain an optimized model. Use the optimized model to generate personalized recommendation results.
[0053] In practical implementation, steps S101-S103 address the three sub-problems of "adaptive determination of decoupling granularity," "independent decomposition of preference factors," and "guarantee of orthogonality between factors," respectively. However, the ultimate goal of a recommender system is to generate accurate recommendation results, not merely to complete preference decomposition. Therefore, these three steps need to be integrated into a unified optimization framework, enabling the model to simultaneously optimize both recommendation accuracy and decoupling quality during training, thereby achieving overall optimal recommendation performance. A dynamic weight adjustment mechanism based on gradient variance is introduced into the joint optimization objective. This mechanism adaptively adjusts the weight coefficients according to the changing trends of each loss term during training, preventing any single loss term from dominating the training process. This weight adjustment mechanism is related to the decoupling granularity. Linkage: When When the orthogonality constraint weights are large, they are considered more important to control the independence among multiple factors; when When the value is small, the weight of the recommendation prediction loss is relatively increased to ensure the basic recommendation performance. The formula for calculating the sparsity consistency loss (which constrains the decoupling granularity of different users to fluctuate within a reasonable range) is as follows:
[0054] In the formula, This represents the average decoupling granularity of all users. Represents the square of the L2 norm; The formula for calculating the total loss function, constructed based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss, is as follows:
[0055] In the formula, This represents the recommendation prediction loss (such as BPR loss or cross-entropy loss), used to measure the accuracy of the recommendation results. This represents the weighting coefficient for the recommended prediction loss. The weighting coefficients represent the orthogonality constraint loss. The weighting coefficients represent the sparsity consistency loss.
[0056] The weight coefficients of each loss term are dynamically adjusted based on gradient variance.
[0057] In the formula, For the first The variance of the gradient of each loss term; This is the temperature coefficient.
[0058] After training, personalized recommendation results, such as a Top-N recommendation list (i.e., a list of the top N recommended items), are generated based on the optimized model and displayed to the user.
[0059] To verify the effectiveness and practicality of the method proposed in the above embodiments, a complete experimental verification scheme was constructed on a publicly available recommender system dataset. The experiment was carried out sequentially according to the four steps proposed in the above embodiments; Two sets of comparative experiments were designed, corresponding to the two core innovations of the methods in the above embodiments. Experiment 1 verifies the effectiveness of the sparsity adaptive adjustment mechanism. By dividing users into three groups based on the number of interactions—extremely sparse, moderately sparse, and relatively dense—the recommendation accuracy of the fixed-granularity method and the method in the above embodiments was tested, comparing and verifying the performance advantage of "dynamically adjusting decoupling granularity based on the number of user interactions" compared to the "fixed-granularity method." Experiment 2 verifies the contribution of the interaction quality factor. By comparing two configurations—introducing and not introducing the interaction quality factor—it verifies whether introducing quality correction based on the number of interactions can further optimize the fineness of the decoupling granularity. Both sets of experiments use the same dataset partitioning scheme and evaluation metrics, verifying the technical effects of the above embodiments from the two dimensions of "quantity adaptation" and "quality correction," complementing each other and jointly proving the effectiveness of the methods in the above embodiments.
[0060] Experiment 1: Verification of the effectiveness of sparsity adaptive decoupling granularity adjustment Objective: To verify the core innovation of the method in the above embodiments. The method dynamically adjusts the decoupling granularity based on the sparsity of user interactions, demonstrating performance advantages compared to existing fixed-granularity methods.
[0061] The specific experimental logic is as follows: Users are divided into three groups based on the number of interactions: extremely sparse, medium sparse, and relatively dense. The recommendation accuracy of the fixed-granularity method and the method described in the above embodiment are tested on each group. If the improvement of the adaptive method on the sparse group is significantly greater than that on the dense group, it proves that the strategy of "using coarse-grained methods for sparse users and fine-grained methods for dense users" is indeed effective.
[0062] Experimental Environment: This experiment was validated on the MovieLens-1M dataset. Released by GroupLens, the MovieLens-1M dataset contains 1 million rating records from 6040 users for approximately 3900 movies, ranging from 1 to 5 stars. The dataset has a sparsity of approximately 95.5%, with a cold-start user ratio of approximately 23.7%, making it one of the most widely used benchmark datasets in the recommender system field. The sparsity of this dataset is similar to the actual situation of small and medium-sized e-commerce platforms, and therefore it is used in this invention to simulate the sparse data scenario of small and medium-sized e-commerce platforms. The experimental hardware platform consisted of an Intel Xeon Gold 6248 CPU (2.5GHz) and an NVIDIA Tesla T4 GPU, while the software environment included Ubuntu 20.04 LTS, Python 3.9, and PyTorch 2.0.1.
[0063] Experimental setup: Users were divided into three groups based on the number of interactions: extremely sparse group (1-2 interactions), medium sparse group (3-5 interactions), and relatively dense group (6-10 interactions). The reason for choosing these three groups is that the vast majority of users on small and medium-sized e-commerce platforms belong to the first two categories (very few interactions), which is also the core problem that the above implementation aims to solve. A fixed granularity method uniformly uses K=5; the adaptive method dynamically adjusts according to the interaction sparsity. value( , , The evaluation metric used is Hit@10, which measures whether the top 10 items in the recommendation list contain items that the user actually likes. It is a standard metric in the recommendation system field for measuring the accuracy of Top-N recommendations. This metric reflects the recommendation system's ability to prioritize positive samples and is a standard metric in the recommendation system field for measuring the accuracy of Top-N recommendations (i.e., outputting a recommendation list of the top N items).
[0064] Experimental process and results: The experiment was divided into two phases: training and testing. During the training phase, the following operations were performed on each user: (1) Count the number of interactive items. Calculate the interaction quality factor (2) Substitute into the formula Calculate decoupling granularity (3) Decompose the user embedding vector into (4) In the total loss function, there are independent preference factors; The model is trained under constraints. During the testing phase, for each user, one interaction record is randomly selected from the test set as a positive sample, and 99 non-interacted items are randomly selected as negative samples. The trained model is used to rate and rank these 100 candidate items, and the positive sample is checked to see if it appears in the Top-10 recommendation list. This process is repeated 5 times and the average is taken to eliminate the influence of randomness on the results.
[0065] The specific experimental data are as follows: User B is a new user with only 2 interaction records. The system automatically sets the decoupling granularity to 3 (coarse granularity), avoiding the problem of insufficient training samples for each preference factor due to excessive preference decomposition. User C is an active user with 50 interaction records. The system automatically sets the decoupling granularity to 8 (fine granularity), fully expressing its multidimensional preferences. The Hit@10 of the method in the above embodiments on the three groups are 0.142, 0.221, and 0.278, respectively, which are improvements of 19.3%, 12.2%, and 8.6% compared to the fixed granularity method. It can be clearly seen from the data that the sparser the users, the greater the improvement of the adaptive method. The improvement is 19.3% for extremely sparse users (1-2 interactions), 12.2% for medium sparse users (3-5 interactions), and 8.6% for relatively dense users (6-10 interactions). This monotonically decreasing trend proves that the sparser the user base, the more severe the "over-decomposition" problem caused by fixed granularity, and the more significant the protective effect of adaptive coarse granularity. This verifies the effectiveness of the strategy of "using coarse granularity for sparse users and fine granularity for dense users" in the above embodiments.
[0066] Experiment 2: Validation of the effectiveness of the interaction quality factor The purpose of this experiment is to verify the interaction quality factor in the above embodiments. . contributions.
[0067] The specific experimental logic is as follows: Introduction through comparison (The complete solution of the above embodiments) and without introducing Recommended performance for two configurations (using only the number of interactions). If introducing... The significant performance improvement proves that the "interaction quality" dimension can indeed provide additional effective information for granular adjustment.
[0068] Experimental Environment: This experiment was also validated on the MovieLens-1M dataset, using the same dataset partitioning scheme as Experiment 1 (80% training set, 10% validation set, 10% test set). This dataset has a sparsity of 95.5% and contains a large number of cold-start users, making it suitable for validating the effectiveness of the interaction quality factor under sparse conditions.
[0069] Experimental setup: Test the introduction of... (The complete solution of the above embodiments) and without introducing Recommended performance for two configurations (using only the number of interactions). Both configurations use the same... , , The same number of training epochs, learning rate, and other hyperparameters were used to ensure fairness in the comparison. The evaluation metric used was Hit@10.
[0070] Experimental Procedure and Results: The experimental procedure was the same as in Experiment 1, the only difference being whether or not the decoupling granularity calculation formula was introduced. No introduction At that time, the decoupling granularity calculation formula degenerates into The granularity is determined solely by the number of interactions; [introduction] Subsequently, the granularity is adjusted by both the number of interactions and the quality of interactions.
[0071] Experimental results show that introducing Hit@10 then improved from 0.265 to 0.278, an increase of approximately 4.9%. This improvement stems from... Fine-grained correction: For two users with the same 3 interaction records, if user A's 3 interactions are all highly rated (high quality), Approaching 1.0, the decoupling granularity is adjusted to 5; if user B's 3 interactions are all low-scoring evaluations (low quality). Approaching 0.5, the decoupling granularity was adjusted to 3. This distinction allows for a more refined characterization of the preferences of high-quality users, while preventing over-decomposition of the preferences of low-quality users, thereby improving overall recommendation accuracy. The experimental results fully demonstrate that the dual-dimensional adjustment strategy of "interaction quantity + interaction quality" in the above embodiments has significant advantages over the single-dimensional strategy using only the number of interactions.
[0072] In summary, the sparsity-adaptive recommendation service decoupling granularity adjustment method in the above embodiments of the present invention has the following beneficial effects: (1) Sparsity Adaptive Granularity Adjustment: The decoupling granularity is dynamically adjusted according to the sparsity of user interactions. A modified logarithmic mapping (including an interaction quality factor) is used to ensure that the granularity adjustment considers both the quantity and quality of interactions. Coarse-grained decoupling is used for sparse users to avoid over-decomposition, while fine-grained decoupling is used for dense users to fully express their interactions, effectively alleviating the bottleneck of sparse data recommendation. At the same time, a nonlinear exponential parameter is introduced. Subsequently, a more conservative coarse-grained allocation can be obtained at the sparse end, and a more aggressive fine-grained allocation can be obtained at the dense end, further enhancing the flexibility of adaptive adjustment.
[0073] (2) Orthogonality constraint of preference factors: The orthogonality constraint in the form of cosine similarity ensures that different preference factors are independent of each other and are not affected by the vector magnitude, so that the decoupled preference factors can truly express different preference dimensions independently.
[0074] (3) Dynamic weight joint optimization: A dynamic weight adjustment strategy based on gradient variance is adopted, with weight adjustment and decoupling granularity linked to ensure that the contribution of each loss term to the total loss remains balanced, thereby improving the stability and generalization ability of model training.
[0075] Example 2 In another aspect, this invention proposes a sparsity-adaptive recommendation service decoupling granularity adjustment system, please refer to [link / reference]. Figure 3 The figure shows a sparsity-adaptive recommendation service decoupling granularity adjustment system according to the second embodiment of the present invention. The system includes: The interactive data acquisition module 11 is used to acquire the number of interactive items of the target user and dynamically calculate the decoupling granularity based on the number of interactive items using a preset mapping function. The decoupling granularity calculation module 12 is used to map the original embedding vector of the target user into a corresponding number of preference factors through several independent linear transformation networks according to the decoupling granularity. The orthogonality constraint module 13 is used to apply orthogonality constraints to each of the preference factors to ensure that each of the preference factors is independent of each other in the feature space, so as to obtain the corresponding orthogonality constraint loss. The joint optimization module 14 is used to construct a sparsity consistency loss and a recommendation prediction loss based on the decoupling granularity. It constructs a multi-task joint optimization objective based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss. It performs end-to-end model training through a gradient variance-based dynamic weight adjustment strategy to obtain an optimized model and uses the optimized model to generate personalized recommendation results.
[0076] Furthermore, the interactive data acquisition module 11 is specifically used for: Obtain the target user's historical interaction data, and obtain the corresponding number of interactive items and interaction quality factor based on the historical interaction data; The decoupling granularity is dynamically calculated based on the number of interactive items and the interaction quality factor using a preset mapping function.
[0077] The functions or operation steps implemented by the above modules and units are largely the same as those in the above method embodiments, and will not be repeated here.
[0078] The sparsity-adaptive recommendation service decoupling granularity adjustment system provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0079] Example 3 This invention also proposes a computer, please refer to [link / reference]. Figure 4 The computer shown in the third embodiment of the present invention includes a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, it implements the above-described method for decoupling granularity adjustment of recommendation services based on sparsity adaptation.
[0080] The memory 10 includes at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10 can be an internal storage unit of a computer, such as the computer's hard disk. In other embodiments, the memory 10 can be an external storage device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Furthermore, the memory 10 can include both internal and external storage units of the computer. The memory 10 can be used not only to store application software and various types of data installed on the computer, but also to temporarily store data that has been output or will be output.
[0081] In some embodiments, the processor 20 may be an electronic control unit (ECU), a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, used to run program code stored in the memory 10 or process data, such as executing access restriction programs.
[0082] It should be pointed out that, Figure 4 The structure shown does not constitute a limitation on the computer. In other embodiments, the computer may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0083] This invention also proposes a storage medium storing a computer program that, when executed by a processor, implements the above-described method for adjusting the decoupling granularity of recommendation services based on sparsity adaptiveness.
[0084] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0085] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0086] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0087] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0088] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for decoupling granularity adjustment of recommendation services based on sparsity adaptive design, characterized in that, include: Obtain the number of interactive items for the target user, and dynamically calculate the decoupling granularity based on the number of interactive items using a preset mapping function; Based on the decoupling granularity, the original embedding vector of the target user is mapped to a corresponding number of preference factors through several independent linear transformation networks; Orthogonality constraints are applied to each of the preference factors to ensure that each preference factor is independent of the others in the feature space, so as to obtain the corresponding orthogonality constraint loss. Based on the decoupling granularity, a sparsity consistency loss is constructed, and a recommendation prediction loss is constructed. Based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss, a multi-task joint optimization objective is constructed. An end-to-end model training is performed using a gradient variance-based dynamic weight adjustment strategy to obtain an optimized model. Personalized recommendation results are then generated using the optimized model.
2. The method for decoupling granularity adjustment of recommendation services based on sparsity adaptive adjustment according to claim 1, characterized in that, The steps of obtaining the number of interactive items for the target user and dynamically calculating the decoupling granularity based on the number of interactive items using a preset mapping function include: Obtain the target user's historical interaction data, and obtain the corresponding number of interactive items and interaction quality factor based on the historical interaction data; The decoupling granularity is dynamically calculated based on the number of interactive items and the interaction quality factor using a preset mapping function.
3. The method for decoupling granularity adjustment of recommendation services based on sparsity adaptive optimization according to claim 2, characterized in that, The interaction quality factor The calculation formula is: ; In the formula, Represents items The normalized value of global interaction frequency. Indicates user With items Relevance weight of interactions Indicates user The number of interactive items; The decoupling granularity The calculation formula is: In the formula, This represents the upper limit of the maximum granularity. This represents the floor function. Represents the logarithmic function with base 2. Indicates the scaling adjustment parameter. This is the intercept adjustment parameter. This is a non-linear exponential adjustment parameter.
4. The method for decoupling granularity adjustment of recommendation services based on sparsity adaptive adjustment according to claim 1, characterized in that, The formula for calculating the preference factor is: In the formula, This represents the original embedding vector of the target user. Indicates the embedding dimension. Indicates the first The learnable weight matrix corresponding to each preference factor This represents the bias vector. This represents a non-linear activation function.
5. The method for decoupling granularity adjustment of recommendation services based on sparsity adaptive adjustment according to claim 2, characterized in that, The formula for calculating the orthogonality constraint loss is as follows: In the formula, This indicates the decoupling granularity corresponding to the user. Indicates the same user's number A vector representing each preference factor. Indicates the same user's number A vector representing each preference factor. The L2 norm of a vector. It is a very small positive number. Represents the matrix transpose of a vector.
6. The method for decoupling granularity adjustment of recommendation services based on sparsity adaptive adjustment according to claim 5, characterized in that, The formula for calculating the sparsity consistency loss is as follows: In the formula, This represents the average decoupling granularity of all users. Represents the square of the L2 norm; The formula for calculating the total loss function, constructed based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss, is as follows: In the formula, This represents the recommendation prediction loss, used to measure the accuracy of the recommendation results. This represents the weighting coefficient for the recommended prediction loss. The weighting coefficients represent the orthogonality constraint loss. The weighting coefficients represent the sparsity consistency loss.
7. A sparsity-adaptive recommendation service decoupling granularity adjustment system, characterized in that, include: The interactive data acquisition module is used to acquire the number of interactive items of the target user, and dynamically calculate the decoupling granularity based on the number of interactive items using a preset mapping function. The decoupling granularity calculation module is used to map the original embedding vector of the target user into a corresponding number of preference factors through several independent linear transformation networks according to the decoupling granularity. The orthogonality constraint module is used to apply orthogonality constraints to each of the preference factors to ensure that each preference factor is independent of the others in the feature space, so as to obtain the corresponding orthogonality constraint loss. The joint optimization module is used to construct a sparsity consistency loss and a recommendation prediction loss based on the decoupling granularity. It constructs a multi-task joint optimization objective based on the recommendation prediction loss, the sparsity consistency loss, and the orthogonality constraint loss. It performs end-to-end model training through a gradient variance-based dynamic weight adjustment strategy to obtain an optimized model. The optimized model is then used to generate personalized recommendation results.
8. The sparsity-adaptive recommendation service decoupling granularity adjustment system according to claim 7, characterized in that, The interactive data acquisition module is specifically used for: Obtain the target user's historical interaction data, and obtain the corresponding number of interactive items and interaction quality factor based on the historical interaction data; The decoupling granularity is dynamically calculated based on the number of interactive items and the interaction quality factor using a preset mapping function.
9. A readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the sparsity-adaptive recommendation service decoupling granularity adjustment method as described in any one of claims 1 to 6.
10. A computer 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 computer program, it implements the sparsity-adaptive recommendation service decoupling granularity adjustment method as described in any one of claims 1 to 6.