A product recommendation network hyperparameter optimization method and device, and electronic equipment
By using the Large Language Model (LLM) and Low-Rank Adaptive LoRa module for hyperparameter optimization in the product recommendation network, the problems of high cost and reliance on manual intervention are solved, resulting in faster optimization and higher accuracy, making it suitable for product recommendation tasks in big data scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-05-01
AI Technical Summary
In big data scenarios, the optimization of hyperparameters for product recommendation networks suffers from high computational costs, excessive reliance on human experts' knowledge, and the inability to generalize across different types of tasks.
By obtaining the hyperparameter space from historical tuning logs based on the Large Language Model (LLM), clustering is performed using a surrogate model, and the LLM is enhanced by combining a low-rank adaptive LoRa module, thus optimizing hyperparameter selection, reducing manual intervention, and improving the efficiency of automated tuning.
It enables faster convergence to the global optimum in big data scenarios, reduces computational load, improves the accuracy and robustness of the product recommendation network, and reduces reliance on human experts.
Smart Images

Figure CN121390216B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning technology, and in particular to a method, apparatus and electronic device for optimizing hyperparameters of a product recommendation network. Background Technology
[0002] Hyperparameters (or simply hyperparameters) are configuration options manually set before model training begins, such as learning rate, regularization strength, and number of training epochs. These parameters control the model's structure, the details of the training process, and the behavior of the optimization algorithm. The choice of hyperparameters affects the final performance of a deep learning model; therefore, inappropriate hyperparameter selection may lead to underfitting or overfitting, resulting in poor performance. Manually adjusting hyperparameters is inefficient and prone to inaccuracies.
[0003] For product recommendation networks in big data scenarios, the types of products involved vary greatly, and the evaluation of product recommendation results requires a large number of complete test sets. Moreover, some specific hyperparameters are very sensitive, and slight changes can significantly affect the product recommendation results. In order to find suitable hyperparameters, a single model training may require processing hundreds of millions of user-product interaction data, and the resulting hyperparameters are also extremely high-dimensional. Different scenarios may require different hyperparameters to allow the product recommendation network to reach its maximum potential.
[0004] Therefore, this ultra-high-dimensional hyperparameter optimization suffers from high computational costs, excessive reliance on human experts' knowledge, and inability to generalize across different types of tasks. Summary of the Invention
[0005] This application provides a product recommendation network hyperparameter optimization method, apparatus, and electronic device to address the problems of high cost of ultra-high-dimensional hyperparameter optimization, excessive reliance on human experts' knowledge, and inability to generalize across different types of tasks.
[0006] In a first aspect, embodiments of this application provide a method for optimizing hyperparameters of a product recommendation network, including:
[0007] Based on the Large Language Model (LLM), multiple hyperparameter spaces of multiple product recommendation networks are obtained from historical tuning logs. For each of the multiple hyperparameter spaces, the hyperparameter space is clustered according to the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster.
[0008] The hyperparameter spaces after multiple clustering and the corresponding cluster-level evaluation scores are used as sample data;
[0009] Based on the low-rank adaptive LoRa module and the sample data, the LLM is enhanced to obtain the enhanced LLM;
[0010] For the product recommendation network to be optimized, the model type, hyperparameter combination and corresponding product recommendation results in the historical tuning log of the product recommendation network to be optimized are obtained based on the enhanced LLM, and the hyperparameter combination is clustered to obtain several candidate hyperparameter clusters;
[0011] Based on the proxy model of the product recommendation network to be optimized, the hyperparameter prediction value and spatial exploration value of each candidate hyperparameter cluster are obtained from the plurality of candidate hyperparameter clusters. The intra-cluster prediction score of the candidate hyperparameter cluster is obtained by weighting the hyperparameter prediction value and spatial exploration value.
[0012] The enhanced LLM determines the sampling ratio of each candidate hyperparameter cluster based on its intra-cluster prediction score. The hyperparameter weights in the candidate hyperparameter cluster are obtained by sampling according to the sampling ratio. The number of candidate samples corresponding to the hyperparameter cluster is calculated by weighting the hyperparameter weights, and the optimized hyperparameters of the product recommendation network are obtained.
[0013] Optionally, for each of the plurality of hyperparameter spaces, clustering is performed on the hyperparameter space according to the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster, including:
[0014] Based on LLM, obtain the historical tuning logs of the product recommendation strategy network, obtain the hyperparameter combinations in the historical tuning logs, and obtain the product recommendation results output by the proxy model of the product recommendation strategy network corresponding to each hyperparameter combination.
[0015] The combined evaluation index of the hyperparameter combination and the corresponding product recommendation result is used as the feature pair, and all hyperparameter combinations of the product recommendation strategy network are used as the hyperparameter space.
[0016] The density-based clustering algorithm DBSCAN is used to cluster multiple feature pairs to obtain several hyperparameter clusters with similar features;
[0017] Calculate the cluster-level evaluation score for each hyperparameter cluster.
[0018] Optionally, the calculation of the cluster-level evaluation score for each hyperparameter cluster includes:
[0019] For each hyperparameter cluster, based on the list of recommended products for each hyperparameter combination, obtain the hit rate of the recommended products corresponding to each hyperparameter combination within that hyperparameter cluster;
[0020] The cluster-level evaluation score of the hyperparameter cluster is calculated based on the recommended product hit rate corresponding to each hyperparameter combination and the weighted sum of the derivatives of the distance of the hyperparameter combination from the cluster center.
[0021] Optionally, obtaining the product recommendation result output by the proxy model of the product recommendation strategy network corresponding to each hyperparameter combination includes:
[0022] Based on the proxy model of the product recommendation network corresponding to all hyperparameter combinations within the hyperparameter cluster, multiple predicted product recommendation results are obtained, and the mean of the multiple predicted product recommendation results is calculated.
[0023] The combined evaluation index, which uses the hyperparameter combination and the corresponding product recommendation result as a feature pair, includes:
[0024] The difference between the predicted product recommendation result corresponding to each hyperparameter combination and the mean is used as the combination evaluation index of the hyperparameter combination, and each hyperparameter combination and its corresponding combination evaluation index are used as feature pairs.
[0025] Optionally, based on the proxy model of the product recommendation network to be optimized, the predicted hyperparameter value and spatial exploration value of each candidate hyperparameter cluster among the plurality of candidate hyperparameter clusters are obtained, including:
[0026] Based on Bayesian estimation, the time variation trend of all hyperparameter combinations within the candidate hyperparameter cluster is obtained, and the time expectation between the time variation trend of all prediction results output by the cost model is obtained. The time expectation is used as the hyperparameter prediction value of the candidate hyperparameter cluster.
[0027] The maximum likelihood estimate between the sequence of all hyperparameter combinations within the candidate hyperparameter cluster and the sequence of all prediction results output by the cost model is obtained and used as the spatial exploration value of the candidate hyperparameter cluster.
[0028] Optionally, the step of clustering multiple feature pairs according to the density-based clustering DBSCAN algorithm to obtain several hyperparameter clusters with similar features includes:
[0029] The multiple feature pairs are uniformly meshed to obtain multiple subspaces.
[0030] Calculate the Euclidean distance between the center of each subspace and every feature pair in the neighboring subspaces of that subspace;
[0031] The neighboring subspaces of the subspace are traversed recursively, and the feature pairs in the neighboring subspaces that are closest to the center of the subspace by Euclidean distance are classified into the hyperparameter cluster corresponding to the center of the subspace.
[0032] By traversing the subspace centers of the multiple subspaces, several hyperparameter clusters with similar characteristics are obtained.
[0033] Optionally, the sampling ratio of each candidate hyperparameter cluster is determined based on the intra-cluster prediction score of each candidate hyperparameter cluster using the enhanced LLM, including:
[0034] Based on the agent model of the product recommendation network, predict the performance expectation of each hyperparameter combination in the candidate hyperparameter cluster, and use it as the hyperparameter prediction value corresponding to the hyperparameter combination.
[0035] Based on the spatial distance between the predicted product recommendation results and the corresponding product recommendation results in the sample data, the spatial exploration value corresponding to the hyperparameter combination is obtained;
[0036] The weighted coefficient values of each candidate hyperparameter cluster are obtained by performing a linear transformation on the profile coefficients of each candidate hyperparameter cluster.
[0037] Based on the weighted coefficient values of each candidate hyperparameter cluster, the hyperparameter prediction values and spatial exploration values of each hyperparameter combination of the candidate hyperparameter cluster are weighted and summed to obtain the intra-cluster prediction score of the candidate hyperparameter cluster.
[0038] By combining the target task information, candidate hyperparameter clusters, historical tuning logs, and intra-cluster prediction scores with the Prompt input to the enhanced LLM, the sampling ratio of the candidate hyperparameter cluster is obtained.
[0039] Optionally, the hyperparameter weights in the candidate hyperparameter cluster are obtained by sampling according to the sampling ratio, and the number of candidate samples corresponding to the hyperparameter cluster is calculated based on the weighted hyperparameter weights to obtain the optimized hyperparameters of the product recommendation network, including:
[0040] Based on the sampling ratio, the sampling probability P(R) of each candidate hyperparameter cluster in each hyperparameter space is calculated according to the following formula. i ):
[0041]
[0042] Among them, R i S(R) represents the candidate hyperparameter cluster, γ represents the sampling ratio of the candidate hyperparameter cluster, and S(R) represents the sampling ratio of the candidate hyperparameter cluster. i ) represents the intra-cluster prediction score of the candidate hyperparameter cluster;
[0043] Based on the sampling probability of each candidate hyperparameter cluster and the total number of hyperparameter combinations required by the product recommendation network, the hyperparameter weight of each candidate hyperparameter cluster is calculated. The TopK parameters are then selected from the candidate hyperparameter cluster according to the hyperparameter weights as the optimized hyperparameters of the product recommendation network.
[0044] This application provides an electronic device, including:
[0045] Processor and memory;
[0046] The memory stores computer-readable instructions, which, when executed by the processor, implement the above method.
[0047] This application provides a product recommendation network hyperparameter optimization device, including:
[0048] The first clustering module is used to obtain multiple hyperparameter spaces of multiple product recommendation networks from historical tuning logs based on the large language model LLM. For each of the multiple hyperparameter spaces, the hyperparameter space is clustered according to the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster.
[0049] The training module is used to take the hyperparameter spaces after multiple clustering and the corresponding cluster-level evaluation scores as sample data; and to enhance the LLM based on the LoRa module and the sample data to obtain the enhanced LLM.
[0050] The second clustering module is used to obtain the model type, hyperparameter combination and corresponding product recommendation results in the historical tuning log of the product recommendation network to be optimized based on the enhanced LLM, and to cluster the hyperparameter combination to obtain several candidate hyperparameter clusters.
[0051] The optimization module is used to obtain the hyperparameter prediction value and spatial exploration value of each candidate hyperparameter cluster among several candidate hyperparameter clusters based on the proxy model of the product recommendation network to be optimized; weight the hyperparameter prediction value and spatial exploration value to obtain the intra-cluster prediction score of the candidate hyperparameter cluster; determine the sampling ratio of the candidate hyperparameter cluster based on the intra-cluster prediction score of each candidate hyperparameter cluster through the enhanced LLM; obtain the hyperparameter weights in the candidate hyperparameter cluster according to the sampling ratio; calculate the candidate sampling number corresponding to the hyperparameter cluster based on the weighted hyperparameter weights; and obtain the optimized hyperparameters of the product recommendation network.
[0052] In this embodiment, the hyperparameter space is obtained from historical tuning logs based on LLM. According to the output of the surrogate model of the corresponding product recommendation network, the hyperparameter space is clustered to obtain hyperparameter clusters and corresponding cluster-level evaluation scores, thereby enhancing the LLM. Thus, the enhanced LLM learns the tuning experience from the historical tuning logs and the correlation between the cluster-level evaluation scores of different hyperparameter clusters. Therefore, manual parameter tuning by experts is unnecessary, reducing human intervention and tuning time. When optimizing the product recommendation network, the hyperparameter clusters obtained from clustering can be evaluated more accurately, allowing for sampling of the hyperparameter space at a reasonable sampling ratio. This reduces the computational load of hyperparameter performance prediction while enabling the enhanced LLM to converge to the global optimum faster, better balancing optimization efficiency and accuracy. It can also generalize to product recommendation tasks in big data scenarios and has better robustness. Attached Figure Description
[0053] Figure 1 This is a flowchart of a product recommendation network hyperparameter optimization method provided in an embodiment of this application;
[0054] Figure 2 This is a flowchart of obtaining hyperparameter clusters and cluster-level evaluation scores based on a large language model LLM, provided in an embodiment of this application;
[0055] Figure 3 This is a flowchart illustrating the calculation of cluster-level evaluation scores for hyperparameter clusters, provided in an embodiment of this application.
[0056] Figure 4 This is a schematic flowchart of a product recommendation network hyperparameter optimization method provided in an embodiment of this application. Detailed Implementation
[0057] The present application will be described in detail below with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present application. Any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the protection scope of the present application.
[0058] In large-scale dataset scenarios, the complexity and uncertainty of ultra-high-dimensional hyperparameter spaces are high. Random selection for optimization leads to high uncertainty and can easily cause optimization to get trapped in local optima, making it difficult to quickly locate truly effective hyperparameter regions. To effectively reduce the uncertainty of ultra-high-dimensional hyperparameter spaces and specifically improve search efficiency and resource utilization, the method in this application uses a fine-tuned large language model (LLM) to provide sampling ratios, combined with historical tuning information and predicted hyperparameter combinations and their evaluation metrics, to achieve hyperparameter optimization of the product recommendation network. Figure 1 As shown in the figure, the steps of a product recommendation network hyperparameter optimization method provided in this application embodiment are as follows:
[0059] Step 101: Based on the Large Language Model (LLM), obtain multiple hyperparameter spaces of multiple product recommendation networks from historical tuning logs. For each hyperparameter space, cluster the hyperparameter space according to the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster.
[0060] Step 102: Use the hyperparameter spaces after multiple clustering and the corresponding cluster-level evaluation scores as sample data;
[0061] Step 103: Based on the LoRa function and the sample data, enhance the LLM to obtain the enhanced LLM;
[0062] Step 104: For the product recommendation network to be optimized, based on the enhanced LLM, obtain the model type, hyperparameter combination and corresponding product recommendation results in the historical tuning log of the product recommendation network to be optimized, and cluster the hyperparameter combination to obtain several candidate hyperparameter clusters;
[0063] Step 105: Based on the proxy model of the product recommendation network to be optimized, obtain the hyperparameter prediction value and spatial exploration value of each candidate hyperparameter cluster among the several candidate hyperparameter clusters, and weight the hyperparameter prediction value and spatial exploration value to obtain the intra-cluster prediction score of the candidate hyperparameter cluster.
[0064] Step 106: Using the enhanced LLM, based on the intra-cluster prediction score of each candidate hyperparameter cluster, determine the sampling ratio of the candidate hyperparameter cluster, sample according to the sampling ratio to obtain the hyperparameter weights in the candidate hyperparameter cluster, and calculate the candidate sampling number corresponding to the hyperparameter cluster based on the weighted hyperparameter weights to obtain the optimized hyperparameters of the product recommendation network.
[0065] In this embodiment, the hyperparameter space is obtained from historical tuning logs based on LLM. According to the output of the surrogate model of the corresponding product recommendation network, the hyperparameter space is clustered to obtain hyperparameter clusters and corresponding cluster-level evaluation scores, thereby enhancing the LLM. Thus, the enhanced LLM learns the tuning experience from the historical tuning logs and the correlation between the cluster-level evaluation scores of different hyperparameter clusters. Therefore, manual parameter tuning by experts is unnecessary, reducing human intervention and tuning time. When optimizing the product recommendation network, the hyperparameter clusters obtained from clustering can be evaluated more accurately, allowing for sampling of the hyperparameter space at a reasonable sampling ratio. This reduces the computational load of hyperparameter performance prediction while enabling the enhanced LLM to converge to the global optimum faster, better balancing optimization efficiency and accuracy. It can also generalize to product recommendation tasks in big data scenarios and has better robustness.
[0066] For example, step 101 can be adopted as follows: Figure 2 The process shown has the following steps:
[0067] Step 201: Obtain the historical tuning logs of the product recommendation strategy network based on LLM, obtain the hyperparameter combinations in the historical tuning logs, and obtain the product recommendation results output by the proxy model of the product recommendation strategy network corresponding to each hyperparameter combination;
[0068] Step 202: Use the combined evaluation index of the hyperparameter combination and the corresponding product recommendation result as feature pairs, and use all hyperparameter combinations of the product recommendation strategy network as the hyperparameter space;
[0069] Step 203: Cluster multiple feature pairs according to the density-based clustering DBSCAN algorithm to obtain several hyperparameter clusters with similar features;
[0070] Step 204: Calculate the cluster-level evaluation score for each hyperparameter cluster.
[0071] Optionally, the historical tuning log of the product recommendation strategy network in this embodiment includes model type, product recommendation results, hyperparameter combinations, and corresponding combination evaluation metrics. The combination evaluation metrics in the historical tuning log can be, but are not limited to, the difference between the predicted product recommendation results for each hyperparameter combination and the mean of the product recommendation results for that combination, as the combination evaluation metric for that hyperparameter combination.
[0072] Optionally, the sample data used to train the LLM in step 102 is obtained by summarizing the hyperparameter spatial information after multiple clustering and the corresponding cluster-level evaluation scores.
[0073] The cluster-level evaluation score for each hyperparameter cluster can be calculated, but is not limited to, in the following ways:
[0074] For each hyperparameter cluster, based on the list of recommended products for each hyperparameter combination, obtain the hit rate of the recommended products corresponding to each hyperparameter combination within that hyperparameter cluster;
[0075] The cluster-level evaluation score of the hyperparameter cluster is calculated based on the recommended product hit rate corresponding to each hyperparameter combination and the weighted sum of the derivatives of the distance of the hyperparameter combination from the cluster center.
[0076] For example, the hyperparameter space in the hyperparameter space information can contain the following hyperparameters:
[0077] For proxy model A, obtain the first set of hyperparameters.
[0078] learning_rate: 0.001
[0079] Batch size: 32
[0080] Cluster label: 1,
[0081] Cluster score: 0.85
[0082] Sampling frequency: 0.3.
[0083] For proxy model A, obtain the second set of hyperparameters.
[0084] learning_rate: 0.002
[0085] Batch size: 64
[0086] Cluster label: 2,
[0087] Cluster score: 0.75
[0088] Sampling frequency: 0.20.
[0089] For proxy model B, obtain the third set of hyperparameters.
[0090] learning_rate: 0.003
[0091] Batch size: 32
[0092] Cluster label: 1,
[0093] Cluster score: 0.90
[0094] Sampling frequency: 0.40.
[0095] For proxy model B, obtain the third set of hyperparameters.
[0096] learning_rate: 0.004
[0097] Batch size: 64
[0098] Cluster label: 2,
[0099] Cluster score: 0.80
[0100] Sampling frequency: 0.30.
[0101] Optionally, in step 103, the LLM can be enhanced by introducing and training a set of low-rank matrices on the weights of the pre-trained LLM, and then adjusting the model parameters using sample data to obtain the enhanced LLM. This method does not require updating all the original parameters of the LLM; it only uses LoRa to fine-tune the LLM with sample data to make it more suitable for the current task, so that the enhanced LLM can accurately provide the sampling ratio of different clusters in subsequent model optimization.
[0102] For example, see Figure 3 As shown, the sampling ratio of the candidate hyperparameter cluster can be calculated by referring to the following steps:
[0103] S301: Based on the agent model of the product recommendation network, predict the performance expectation of each hyperparameter combination in the candidate hyperparameter cluster, and use it as the hyperparameter prediction value corresponding to the hyperparameter combination.
[0104] S302: Based on the spatial distance between the predicted product recommendation result and the corresponding product recommendation result in the sample data, obtain the spatial exploration value corresponding to the hyperparameter combination;
[0105] S303: Perform a linear transformation on the profile coefficients of each candidate hyperparameter cluster to obtain the weighted coefficient values of that candidate hyperparameter cluster;
[0106] S304: The hyperparameter prediction value and spatial exploration value of each hyperparameter combination are weighted and summed according to the weighted coefficient value of each candidate hyperparameter cluster to obtain the intra-cluster prediction score of the hyperparameter cluster.
[0107] S305: Combine the target task information, candidate hyperparameter clusters, historical tuning logs, and intra-cluster prediction scores with the Prompt input to the enhanced LLM to obtain the sampling ratio of the candidate hyperparameter cluster.
[0108] For example, for each hyperparameter combination in any candidate hyperparameter cluster, the hyperparameter prediction value and spatial exploration value of each hyperparameter combination are weighted and summed according to the weighting coefficient value of the candidate hyperparameter cluster. The sum of the combined prediction scores of all hyperparameter combinations within the cluster is used as the intra-cluster prediction score of the hyperparameter cluster. This process can be calculated using the following formula:
[0109]
[0110]
[0111]
[0112]
[0113]
[0114] Among them, S(R) i ) represents the intra-cluster prediction score of the hyperparameter cluster. i E(R) represents the weighted coefficient values of the candidate hyperparameter cluster. i (e) represents the predicted hyperparameter value e of the candidate hyperparameter cluster. i The aggregate value, U(R) i ) represents the spatial exploration value u of the candidate hyperparameter cluster. i The aggregate value, SCi denoted as the contour coefficient of the candidate hyperparameter cluster, where i represents the index of the hyperparameter combination in the candidate hyperparameter cluster, and n represents the total number of hyperparameter combinations in the candidate hyperparameter cluster. i and n are positive integers.
[0115] The predicted values of candidate hyperparameters for a candidate hyperparameter family can be obtained in the following way:
[0116] A surrogate model is constructed based on the evaluated hyperparameter combinations and their combined evaluation metrics. A kernel function is used to define the similarity relationship between hyperparameters and calculate the covariance structure. This kernel function generates multiple kernel matrices, each representing a set of candidate hyperparameter predictions. For each candidate hyperparameter prediction, the surrogate model uses the covariance vector between historical data and the candidate hyperparameter predictions, along with the inverse of the kernel matrix, to derive the mean and variance of the posterior distribution using conditional probability formulas. After an iterative optimization, the current candidate hyperparameter predictions are expanded and stored as historical data, and the corresponding kernel matrix is dynamically updated, thereby gradually optimizing the prediction accuracy. Finally, through probabilistic generalization, the model achieves the ability to infer from local observations to global generalization.
[0117] For example, when the quantification value of the combined evaluation index is 20%, the above process of constructing the surrogate model selects the top 20% of hyperparameter combinations from all hyperparameter combinations to construct the surrogate model.
[0118] The spatial exploration value represents the search space of the hyperparameter cluster, which can be obtained, but is not limited to, through a list of discrete values of hyperparameters in the hyperparameter cluster, a continuous distribution range, or a mixed distribution type.
[0119] The method in this application uses a dynamic sampling ratio generated by LLM to screen candidate hyperparameter clusters from each subspace. Combining the scores of these candidate clusters, the top K hyperparameter combinations are weighted and selected as the input for the next round. This method can simultaneously cover regions with good prediction performance and exploration regions with potential optimal solutions. Furthermore, because it does not rely on a single optimal solution, it ensures the diversity of candidate clusters. By selecting combinations of different prediction values, it avoids premature convergence and may discover previously unnoticed potential excellent solutions, avoiding getting trapped in local optima. This sampling strategy improves the search efficiency in the Bayesian optimization process, allowing resources to be more concentrated on evaluating hyperparameter combinations most likely to bring performance improvements, thereby achieving better model performance and faster optimization speed.
[0120] Using the enhanced LLM, the sampling ratio of each candidate hyperparameter cluster is determined based on its intra-cluster prediction score. The number of candidate samples corresponding to each hyperparameter cluster is calculated according to this sampling ratio, and the optimized hyperparameters of the product recommendation network are obtained, including:
[0121] Based on the agent model of the product recommendation network, predict the performance expectation of each hyperparameter combination in the candidate hyperparameter cluster, and use it as the hyperparameter prediction value corresponding to the hyperparameter combination.
[0122] Based on the spatial distance between the predicted product recommendation results and the corresponding product recommendation results in the sample data, the spatial exploration value corresponding to the hyperparameter combination is obtained;
[0123] The weighted coefficient values of each candidate hyperparameter cluster are obtained by performing a linear transformation on the profile coefficients of each candidate hyperparameter cluster.
[0124] Based on the weighted coefficient values of each candidate hyperparameter cluster, the hyperparameter prediction value and spatial exploration value of each hyperparameter combination are weighted and summed to obtain the combination prediction score of the hyperparameter combination.
[0125] The target task information, candidate hyperparameter clusters, historical tuning logs, and combined prediction scores are combined with the Prompt input into the enhanced LLM to obtain the sampling ratio of the candidate hyperparameter cluster.
[0126] Based on the sampling ratio, the sampling probability P(R) of each candidate hyperparameter cluster in each hyperparameter space is calculated according to the following formula. i ):
[0127]
[0128] Among them, R i S(R) represents the candidate hyperparameter cluster, γ represents the sampling ratio of the candidate hyperparameter cluster, and S(R) represents the sampling ratio of the candidate hyperparameter cluster. i ) represents the intra-cluster prediction score of the candidate hyperparameter cluster;
[0129] Based on the sampling probability of each candidate hyperparameter cluster and the total number of hyperparameter combinations required by the product recommendation network, the hyperparameter weight of each candidate hyperparameter cluster is calculated. TopK parameters are then selected from the candidate hyperparameter cluster according to these weights as the optimized hyperparameters for the product recommendation network. For example, the combined prediction score of the optimized hyperparameters and their corresponding hyperparameter combinations can be stored as part of the historical tuning data in the historical tuning log.
[0130] Alternatively, the TopK hyperparameters can be output through weighted sampling using the following formula:
[0131]
[0132] Wherein, P(R) i ) is a candidate hyperparameter cluster The sampling probability is given by the number of hyperparameters sampled from this candidate hyperparameter cluster. The hyperparameter weights of this candidate hyperparameter cluster are w. i .
[0133] For example, step 203 DBSCAN (Density-Based Spatial Clustering of Applications with Noise) can be calculated as follows;
[0134] The multiple feature pairs are uniformly meshed to obtain multiple subspaces.
[0135] Calculate the Euclidean distance between the center of each subspace and every feature pair in the neighboring subspaces of that subspace;
[0136] The neighboring subspaces of the subspace are traversed recursively, and the feature pairs in the neighboring subspaces that are closest to the center of the subspace by Euclidean distance are classified into the hyperparameter cluster corresponding to the center of the subspace.
[0137] By traversing the subspace centers of the multiple subspaces, several hyperparameter clusters with similar characteristics are obtained.
[0138] For example, using hyperparameter combinations and corresponding product recommendation results As feature pairs, the DBSCAN algorithm is used to cluster the feature pairs to obtain... A number of different initial hyperparameter clusters and their corresponding hyperparameter cluster centers. ;
[0139] The hyperparameter space is defined by all combinations of hyperparameters in the product recommendation strategy network. For hyperparameter space Perform uniform meshing to obtain Subspace, i.e. and its corresponding subspace center ;
[0140] Subspace Center To the hyperparameter cluster center Euclidean distance The calculation formula is:
[0141]
[0142] Where τ represents the feature dimension, c kj Indicates the hyperparameter cluster center The distance to the j-th hyperparameter, c mj Represents the center of the subspace The distance to the j-th hyperparameter. Following the cluster center homogenization method, based on the distance d... km The subspaces are classified into different hyperparameter clusters, resulting in k hyperparameter clusters.
[0143] The method in this embodiment performs uniform gridding on the hyperparameter space, cluster analysis based on the existing evaluated hyperparameter results, and accurately divides the entire hyperparameter space into different hyperparameter clusters by calculating the distance from each grid center point to the cluster center. In this way, hyperparameter combinations within each cluster are considered to have similar performance characteristics, significantly reducing the uncertainty of high-dimensional hyperparameter spaces and overcoming the problem of random sampling easily getting trapped in local optima. By dividing the hyperparameter space into subspaces with similar characteristics, searches can be performed more specifically within each subspace, avoiding blind global exploration. Furthermore, guided by cluster centers, the method in this embodiment can more efficiently locate potential high-performance regions, greatly reducing invalid searches.
[0144] In this embodiment, the hyperparameter prediction value corresponding to the hyperparameter combination is used to evaluate the availability of the hyperparameter combination. High availability indicates that the hyperparameter combination can be used to accelerate convergence. The hyperparameter prediction value can be the mean or expected value of the hyperparameters in the hyperparameter combination. The spatial exploration value corresponding to the hyperparameter combination is used to evaluate the explorability of the hyperparameter combination. High explorability indicates that the availability of the hyperparameter combination is not high, and it is necessary to explore new regions to find the globally optimal combination. The spatial exploration value can be the variance or standard deviation of the hyperparameters in the hyperparameter combination. The method provided in this embodiment obtains the combination prediction score corresponding to the hyperparameter combination by weighted summing of the hyperparameter prediction value and the spatial exploration value, thereby balancing the proportion of expectation and exploration in the parameter optimization process, realizing the finding of the globally optimal solution with fewer evaluation times, and preventing getting trapped in local optima.
[0145] For example, the expected performance corresponding to the hyperparameter combination in step 301 can be calculated as follows:
[0146] Based on the proxy model of the product recommendation network corresponding to all hyperparameter combinations within the hyperparameter cluster, multiple predicted product recommendation results are obtained, and the mean of the multiple predicted product recommendation results is calculated.
[0147] The difference between the predicted product recommendation result corresponding to each hyperparameter combination and the mean is taken as the expected performance of the hyperparameter combination.
[0148] In this embodiment, the hyperparameter space is obtained from historical tuning logs based on LLM. According to the output of the surrogate model of the corresponding product recommendation network, the hyperparameter space is clustered to obtain hyperparameter clusters and corresponding cluster-level evaluation scores, thereby enhancing the LLM. Thus, the enhanced LLM learns the tuning experience from the historical tuning logs and the correlation between the cluster-level evaluation scores of different hyperparameter clusters. Therefore, manual parameter tuning by experts is unnecessary, reducing human intervention and tuning time. When optimizing the product recommendation network, the hyperparameter clusters obtained from clustering can be evaluated more accurately, allowing for sampling of the hyperparameter space at a reasonable sampling ratio. This reduces the computational load of hyperparameter performance prediction while enabling the enhanced LLM to converge to the global optimum faster, better balancing optimization efficiency and accuracy. It can also generalize to product recommendation tasks in big data scenarios and has better robustness, ultimately improving the accuracy of the final product recommendation network and enabling it to adapt to various recommendation tasks.
[0149] See Figure 4 As shown, the product recommendation network hyperparameter optimization method of this application embodiment can optimize the hyperparameter combination collected by LLM by combining the output of the surrogate model and the clustering results of the hyperparameter space based on the improved Bayesian network process.
[0150] History tuning logs can include:
[0151] Iteration record information:
[0152] Opt1: {
[0153] Hyperparameter combination: {learning rate: 0.01, ...}, result: {F1: 0.72, ACC: 0.68, ...}
[0154] },
[0155] Opt2: {
[0156] Hyperparameter combination: {learning rate: 0.02, ...}, result: {F1: 0.71, ACC: 0.68, ...}
[0157] The prompt word "Prompt" can be as follows:
[0158] {You are a hyperparameter optimization expert. Refer to the following content for sampling coefficients and adjust the sampling probability to obtain a better combination of hyperparameters.}
[0159] 1. Task Information
[0160] 2. Hyperparameter clustering space
[0161] 3. History
[0162] 4. Predicted values from the surrogate model
[0163] Points to note:
[0164] 1. The sampling coefficient ranges from 0 to 1. A larger value indicates that the hyperparameter effect in the cluster is better.
[0165] 2. The exploration and utilization functions need to be comprehensively considered.
[0166] The process of selecting hyperparameter combinations using the enhanced LLM can be as follows:
[0167] 1. Determine the sampling coefficients
[0168] 2. Calculate the sampling probability for each hyperparameter cluster;
[0169]
[0170] Among them, R i Representing candidate hyperparameter clusters, S(R) represents the sampling coefficient of the candidate hyperparameter cluster. i ) represents the intra-cluster prediction score of the candidate hyperparameter cluster; Indicates to With S(R) i The product of () is given by exponent with the natural constant e as the base.
[0171] 3. Sample each cluster according to the sampling probability.
[0172] 4. Combine and output the sampled Topk hyperparameters.
[0173] Thus, in this embodiment of the application, the LLM sampling function can adapt to different task requirements, learn from historical optimization experience, deepen the understanding of parameter optimization by historical information, thereby improving the optimization accuracy, identify better regions from the parameter space, namely TopK hyperparameter combinations, realize multi-space exploration, improve global optimization capability, and thus realize batch optimization iteration and improve hyperparameter optimization efficiency.
[0174] Similarly, embodiments of this application provide a product recommendation network hyperparameter optimization device, comprising:
[0175] The first clustering module is used to obtain multiple hyperparameter spaces of multiple product recommendation networks from historical tuning logs based on the large language model LLM. For each of the multiple hyperparameter spaces, the hyperparameter space is clustered according to the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster.
[0176] The training module is used to take the hyperparameter spaces after multiple clustering and the corresponding cluster-level evaluation scores as sample data; and to enhance the LLM based on the LoRa module and the sample data to obtain the enhanced LLM.
[0177] The second clustering module is used to obtain the model type, hyperparameter combination and corresponding product recommendation results in the historical tuning log of the product recommendation network to be optimized based on the enhanced LLM, and to cluster the hyperparameter combination to obtain several candidate hyperparameter clusters.
[0178] The optimization module is used to obtain the hyperparameter prediction value and spatial exploration value of each candidate hyperparameter cluster among several candidate hyperparameter clusters based on the proxy model of the product recommendation network to be optimized; weight the hyperparameter prediction value and spatial exploration value to obtain the intra-cluster prediction score of the candidate hyperparameter cluster; determine the sampling ratio of the candidate hyperparameter cluster based on the intra-cluster prediction score of each candidate hyperparameter cluster through the enhanced LLM; obtain the hyperparameter weights in the candidate hyperparameter cluster according to the sampling ratio; calculate the candidate sampling number corresponding to the hyperparameter cluster based on the weighted hyperparameter weights; and obtain the optimized hyperparameters of the product recommendation network.
[0179] Optionally, the second clustering module described above is also used for:
[0180] Based on LLM, obtain the historical tuning logs of the product recommendation strategy network, obtain the hyperparameter combinations in the historical tuning logs, and obtain the product recommendation results output by the proxy model of the product recommendation strategy network corresponding to each hyperparameter combination.
[0181] The combined evaluation index of the hyperparameter combination and the corresponding product recommendation result is used as the feature pair, and all hyperparameter combinations of the product recommendation strategy network are used as the hyperparameter space.
[0182] The density-based clustering algorithm DBSCAN is used to cluster multiple feature pairs to obtain several hyperparameter clusters with similar features;
[0183] Calculate the cluster-level evaluation score for each hyperparameter cluster.
[0184] Optionally, the second clustering module described above is also used for:
[0185] For each hyperparameter cluster, based on the list of recommended products for each hyperparameter combination, obtain the hit rate of the recommended products corresponding to each hyperparameter combination within that hyperparameter cluster;
[0186] The cluster-level evaluation score of the hyperparameter cluster is calculated based on the recommended product hit rate corresponding to each hyperparameter combination and the weighted sum of the derivatives of the distance of the hyperparameter combination from the cluster center.
[0187] Optionally, the second clustering module described above is also used for:
[0188] Based on the proxy model of the product recommendation network corresponding to all hyperparameter combinations within the hyperparameter cluster, multiple predicted product recommendation results are obtained, and the mean of the multiple predicted product recommendation results is calculated.
[0189] The combined evaluation index, which uses the hyperparameter combination and the corresponding product recommendation result as a feature pair, includes:
[0190] The difference between the predicted product recommendation result corresponding to each hyperparameter combination and the mean is used as the combination evaluation index of the hyperparameter combination, and each hyperparameter combination and its corresponding combination evaluation index are used as feature pairs.
[0191] Optionally, the above optimization module is also used for:
[0192] Based on Bayesian estimation, the time variation trend of all hyperparameter combinations within the candidate hyperparameter cluster is obtained, and the time expectation between the time variation trend of all prediction results output by the cost model is obtained. The time expectation is used as the hyperparameter prediction value of the candidate hyperparameter cluster.
[0193] The maximum likelihood estimate between the sequence of all hyperparameter combinations within the candidate hyperparameter cluster and the sequence of all prediction results output by the cost model is obtained and used as the spatial exploration value of the candidate hyperparameter cluster.
[0194] Optionally, the second clustering module described above is also used for:
[0195] The multiple feature pairs are uniformly meshed to obtain multiple subspaces.
[0196] Calculate the Euclidean distance between the center of each subspace and every feature pair in the neighboring subspaces of that subspace;
[0197] The neighboring subspaces of the subspace are traversed recursively, and the feature pairs in the neighboring subspaces that are closest to the center of the subspace by Euclidean distance are classified into the hyperparameter cluster corresponding to the center of the subspace.
[0198] By traversing the subspace centers of the multiple subspaces, several hyperparameter clusters with similar characteristics are obtained.
[0199] Optionally, the second clustering module described above is also used for:
[0200] Based on the agent model of the product recommendation network, predict the performance expectation of each hyperparameter combination in the candidate hyperparameter cluster, and use it as the hyperparameter prediction value corresponding to the hyperparameter combination.
[0201] Based on the spatial distance between the predicted product recommendation results and the corresponding product recommendation results in the sample data, the spatial exploration value corresponding to the hyperparameter combination is obtained;
[0202] The weighted coefficient values of each candidate hyperparameter cluster are obtained by performing a linear transformation on the profile coefficients of each candidate hyperparameter cluster.
[0203] Based on the weighted coefficient values of each candidate hyperparameter cluster, the hyperparameter prediction values and spatial exploration values of each hyperparameter combination of the candidate hyperparameter cluster are weighted and summed to obtain the intra-cluster prediction score of the candidate hyperparameter cluster.
[0204] By combining the target task information, candidate hyperparameter clusters, historical tuning logs, and intra-cluster prediction scores with the Prompt input to the enhanced LLM, the sampling ratio of the candidate hyperparameter cluster is obtained.
[0205] Optionally, the second clustering module described above is also used for:
[0206] Based on the sampling ratio, the sampling probability P(R) of each candidate hyperparameter cluster in each hyperparameter space is calculated according to the following formula. i ):
[0207]
[0208] Among them, R i S(R) represents the candidate hyperparameter cluster, γ represents the sampling ratio of the candidate hyperparameter cluster, and S(R) represents the sampling ratio of the candidate hyperparameter cluster. i ) represents the intra-cluster prediction score of the candidate hyperparameter cluster;
[0209] Based on the sampling probability of each candidate hyperparameter cluster and the total number of hyperparameter combinations required by the product recommendation network, the hyperparameter weight of each candidate hyperparameter cluster is calculated. The TopK parameters are then selected from the candidate hyperparameter cluster according to the hyperparameter weights as the optimized hyperparameters of the product recommendation network.
[0210] Based on the same inventive concept, embodiments of this application provide an electronic device, including:
[0211] Processor and memory;
[0212] The memory stores computer-readable instructions, which, when executed by the processor, implement the above method.
[0213] The memory can be random access memory, read-only memory, non-volatile, programmable ROM, erasable PROM, electrically erasable memory, flash memory, optical memory, and registers, etc. The processor can be a general-purpose processor, which is a processor that performs specific steps and / or operations by reading and executing computer programs stored in the memory. The general-purpose processor may use the memory during the execution of these steps and / or operations. The general-purpose processor can be a central processing unit, ASIC, and FPGA, etc. In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor.
[0214] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0215] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0216] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The above descriptions are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for optimizing hyperparameters of a product recommendation network, characterized in that, The method includes: Based on the Large Language Model (LLM), multiple hyperparameter spaces of multiple product recommendation networks are obtained from historical tuning logs. For each of the multiple hyperparameter spaces, the hyperparameter space is clustered according to the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster. The hyperparameter spaces after multiple clustering and the corresponding cluster-level evaluation scores are used as sample data; Based on the low-rank adaptive LoRa module and the sample data, the LLM is enhanced to obtain the enhanced LLM; For the product recommendation network to be optimized, the model type, hyperparameter combination and corresponding product recommendation results in the historical tuning log of the product recommendation network to be optimized are obtained based on the enhanced LLM, and the hyperparameter combination is clustered to obtain several candidate hyperparameter clusters; Based on the proxy model of the product recommendation network to be optimized, the hyperparameter prediction value and spatial exploration value of each candidate hyperparameter cluster are obtained from the plurality of candidate hyperparameter clusters. The intra-cluster prediction score of the candidate hyperparameter cluster is obtained by weighting the hyperparameter prediction value and spatial exploration value. The enhanced LLM determines the sampling ratio of each candidate hyperparameter cluster based on its intra-cluster prediction score. The hyperparameter weights in the candidate hyperparameter cluster are obtained by sampling according to the sampling ratio. The number of candidate samples corresponding to the hyperparameter cluster is calculated by weighting the hyperparameter weights, and the optimized hyperparameters of the product recommendation network are obtained. The product recommendation network with optimized hyperparameters processes user-product interaction data.
2. The method as described in claim 1, characterized in that, For each of the multiple hyperparameter spaces, clustering is performed based on the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster, including: Based on LLM, obtain the historical tuning logs of the product recommendation strategy network, obtain the hyperparameter combinations in the historical tuning logs, and obtain the product recommendation results output by the proxy model of the product recommendation strategy network corresponding to each hyperparameter combination. The combined evaluation index of the hyperparameter combination and the corresponding product recommendation result is used as the feature pair, and all hyperparameter combinations of the product recommendation strategy network are used as the hyperparameter space. The density-based clustering algorithm DBSCAN is used to cluster multiple feature pairs to obtain several hyperparameter clusters with similar features; Calculate the cluster-level evaluation score for each hyperparameter cluster.
3. The method as described in claim 2, characterized in that, The calculation of the cluster-level evaluation score for each hyperparameter cluster includes: For each hyperparameter cluster, based on the list of recommended products for each hyperparameter combination, obtain the hit rate of the recommended products corresponding to each hyperparameter combination within that hyperparameter cluster; The cluster-level evaluation score of the hyperparameter cluster is calculated based on the recommended product hit rate corresponding to each hyperparameter combination and the weighted sum of the derivatives of the distance of the hyperparameter combination from the cluster center.
4. The method as described in claim 3, characterized in that, The step of obtaining the product recommendation results output by the proxy model of the product recommendation strategy network corresponding to each hyperparameter combination includes: Based on the proxy model of the product recommendation network corresponding to all hyperparameter combinations within the hyperparameter cluster, multiple predicted product recommendation results are obtained, and the mean of the multiple predicted product recommendation results is calculated. The combined evaluation index, which uses the hyperparameter combination and the corresponding product recommendation result as a feature pair, includes: The difference between the predicted product recommendation result corresponding to each hyperparameter combination and the mean is used as the combination evaluation index of the hyperparameter combination, and each hyperparameter combination and its corresponding combination evaluation index are used as feature pairs.
5. The method as described in claim 1, characterized in that, Based on the proxy model of the product recommendation network to be optimized, the hyperparameter prediction value and spatial exploration value of each candidate hyperparameter cluster in the plurality of candidate hyperparameter clusters are obtained, including: Based on Bayesian estimation, the time variation trend of all hyperparameter combinations within the candidate hyperparameter cluster is obtained, and the time expectation between the time variation trend of all prediction results output by the cost model is obtained. The time expectation is used as the hyperparameter prediction value of the candidate hyperparameter cluster. The maximum likelihood estimate between the sequence of all hyperparameter combinations within the candidate hyperparameter cluster and the sequence of all prediction results output by the cost model is obtained and used as the spatial exploration value of the candidate hyperparameter cluster.
6. The method as described in claim 2, characterized in that, The method of clustering multiple feature pairs using the density-based clustering (DBSCAN) algorithm to obtain several hyperparameter clusters with similar features includes: The multiple feature pairs are uniformly meshed to obtain multiple subspaces. Calculate the Euclidean distance between the center of each subspace and every feature pair in the neighboring subspaces of that subspace; The neighboring subspaces of the subspace are traversed recursively, and the feature pairs in the neighboring subspaces that are closest to the center of the subspace by Euclidean distance are classified into the hyperparameter cluster corresponding to the center of the subspace. By traversing the subspace centers of the multiple subspaces, several hyperparameter clusters with similar characteristics are obtained.
7. The method as described in claim 1, characterized in that, The enhanced LLM determines the sampling ratio of each candidate hyperparameter cluster based on its intra-cluster prediction score, including: Based on the agent model of the product recommendation network, predict the performance expectation of each hyperparameter combination in the candidate hyperparameter cluster, and use it as the hyperparameter prediction value corresponding to the hyperparameter combination. Based on the spatial distance between the predicted product recommendation results and the corresponding product recommendation results in the sample data, the spatial exploration value corresponding to the hyperparameter combination is obtained; The weighted coefficient values of each candidate hyperparameter cluster are obtained by performing a linear transformation on the profile coefficients of each candidate hyperparameter cluster. Based on the weighted coefficient values of each candidate hyperparameter cluster, the hyperparameter prediction values and spatial exploration values of each hyperparameter combination of the candidate hyperparameter cluster are weighted and summed to obtain the intra-cluster prediction score of the candidate hyperparameter cluster. By combining the target task information, candidate hyperparameter clusters, historical tuning logs, and intra-cluster prediction scores with the Prompt input to the enhanced LLM, the sampling ratio of the candidate hyperparameter cluster is obtained.
8. The method as described in claim 7, characterized in that, The process involves sampling according to the stated sampling ratio to obtain the hyperparameter weights within the candidate hyperparameter cluster, weighting these weights to calculate the number of candidate samples corresponding to the hyperparameter cluster, and then obtaining the optimized hyperparameters of the product recommendation network. This includes: Based on the sampling ratio, the sampling probability P(R) of each candidate hyperparameter cluster in each hyperparameter space is calculated according to the following formula. i ): Among them, R i S(R) represents the candidate hyperparameter cluster, γ represents the sampling ratio of the candidate hyperparameter cluster, and S(R) represents the sampling ratio of the candidate hyperparameter cluster. i ) represents the intra-cluster prediction score of the candidate hyperparameter cluster; Based on the sampling probability of each candidate hyperparameter cluster and the total number of hyperparameter combinations required by the product recommendation network, the hyperparameter weight of each candidate hyperparameter cluster is calculated. The TopK parameters are then selected from the candidate hyperparameter cluster according to the hyperparameter weights as the optimized hyperparameters of the product recommendation network.
9. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-readable instructions, which, when executed by the processor, implement the method as described in any one of claims 1 to 8.
10. A product recommendation network hyperparameter optimization device, characterized in that, include: The first clustering module is used to obtain multiple hyperparameter spaces of multiple product recommendation networks from historical tuning logs based on the large language model LLM. For each of the multiple hyperparameter spaces, the hyperparameter space is clustered according to the output of the proxy model of the corresponding product recommendation network to obtain several hyperparameter clusters and a cluster-level evaluation score for each hyperparameter cluster. The training module is used to take the hyperparameter spaces after multiple clustering and the corresponding cluster-level evaluation scores as sample data; Based on the Lora module and the sample data, the LLM is enhanced to obtain the enhanced LLM; The second clustering module is used to obtain the model type, hyperparameter combination and corresponding product recommendation results in the historical tuning log of the product recommendation network to be optimized based on the enhanced LLM, and to cluster the hyperparameter combination to obtain several candidate hyperparameter clusters. The optimization module is used to calculate the hyperparameter prediction value and spatial exploration value of each of the several candidate hyperparameter clusters based on the proxy model of the product recommendation network to be optimized, and to obtain the combined prediction score of the hyperparameter combination in the candidate hyperparameter cluster by weighting the hyperparameter prediction value and spatial exploration value. The enhanced LLM determines the sampling ratio of each candidate hyperparameter cluster based on the combined prediction score of the hyperparameter combinations in each candidate hyperparameter cluster. The hyperparameter weights in the candidate hyperparameter cluster are obtained by sampling according to the sampling ratio. The number of candidate samples corresponding to the hyperparameter cluster is calculated by weighting the hyperparameter weights. The optimized hyperparameters of the product recommendation network are obtained. The optimized product recommendation network is used to process user-product interaction data.
Citation Information
Patent Citations
Deep learning algorithm hyper-parameter optimization method based on agent model
CN111738406A
User terminal flow prediction method, medium and system
CN120692558A