Fine arrangement model optimization method and device, storage medium and electronic equipment

By dynamically calculating the weights of negative samples during the training of the fine-ranking model, the problem of imbalance between positive and negative samples is solved, the model's discrimination ability and ranking accuracy are improved, the short video recommendation effect is enhanced, and the user experience is improved.

CN122087209APending Publication Date: 2026-05-26BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-28
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing fine-grained ranking models suffer from an extreme imbalance in the number of positive and negative samples during training, with the number of negative samples far exceeding that of positive samples. Furthermore, most training methods fail to effectively distinguish the differences in importance between different negative samples, resulting in insufficient model discrimination ability, difficulty in accurately distinguishing between positive and negative samples, and limitations in ranking accuracy and generalization performance.

Method used

By acquiring user behavior data of target users, clicked objects are marked as positive samples and unclicked objects as negative samples. The model prediction probability, exposure frequency and sample characteristics of each negative sample are calculated, the weight of the negative sample is dynamically calculated and introduced into the basic loss function to form a weighted loss function, and the fine ranking model parameters are iteratively updated.

Benefits of technology

It improved the model's ability to distinguish between positive and negative samples and its ranking accuracy, enhanced the model's generalization performance, optimized the short video recommendation effect, and improved user click-through rate and viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122087209A_ABST
    Figure CN122087209A_ABST
Patent Text Reader

Abstract

The invention relates to an optimization method and device of a fine arrangement model, a storage medium and electronic equipment. The method comprises the following steps: acquiring user behavior data, marking an object clicked by a target user in the user behavior data as a positive sample, and marking an object which is not clicked as a negative sample; obtaining a model prediction probability, an exposure frequency and a sample feature of each negative sample, and calculating a dynamic weight of each negative sample; inputting all browsing objects and object information thereof in the user behavior data into a fine arrangement model to perform recommendation probability prediction on all the browsing objects to obtain a prediction result, and calculating to obtain a basic loss function according to the prediction result and click information of all the browsing objects; and performing weighted calculation on the basic loss function according to the dynamic weight of each negative sample to obtain a weighted loss function, and iteratively updating parameters of the fine arrangement model according to the weighted loss function. The technical problems that an existing fine ranking model does not make full use of difficult-to-load samples, and the judgment and ranking precision is limited are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of recommendation system technology, and in particular to an optimization method, apparatus, storage medium, and electronic device for a fine ranking model. Background Technology

[0002] In short video recommendation scenarios, fine-grained ranking models are typically used to predict and rank click probabilities for candidate videos. Their ranking accuracy and discriminative ability directly impact user click-through rates, viewing time, and the overall recommendation experience. However, existing fine-grained ranking models commonly suffer from an extreme imbalance between positive and negative samples during training, with negative samples far outnumbering positive samples. Furthermore, most training methods apply equal weights to all negative samples in loss calculations, relying solely on the overall loss function to update model parameters, failing to effectively distinguish the differences in importance between different negative samples. Particularly concerning are negative samples with high exposure frequency but no user clicks; these often contain strong discriminative information. Treating them as ordinary negative samples during training can lead to underutilization of this information, resulting in insufficient model discriminative ability, difficulty in accurately distinguishing between positive and negative samples, and limitations on ranking accuracy and generalization performance. Summary of the Invention

[0003] This application provides an optimization method, apparatus, storage medium, and electronic device for a fine-ranking model to solve the technical problem that existing fine-ranking models do not fully utilize hard-bearing samples and have limited discrimination and ranking accuracy.

[0004] In a first aspect, this application provides an optimization method for a fine-ranking model, comprising: acquiring user behavior data of a target user, and marking objects clicked by the target user in the user behavior data as positive samples and objects not clicked as negative samples, wherein the user behavior data includes all browsing objects of the target user and their object information and click information; acquiring the model prediction probability, exposure frequency and sample features of each negative sample from the user behavior data, and calculating the dynamic weight of each negative sample based on the model prediction probability, the exposure frequency and the sample features; inputting all browsing objects and their object information in the user behavior data into the fine-ranking model, so that the fine-ranking model performs recommendation probability prediction on all browsing objects, obtains prediction results, and calculates a basic loss function based on the prediction results and the click information of all browsing objects; performing a weighted calculation on the basic loss function based on the dynamic weight of each negative sample, obtaining a weighted loss function, and iteratively updating the parameters of the fine-ranking model based on the weighted loss function to obtain an optimized fine-ranking model.

[0005] Secondly, this application provides an optimization apparatus for a fine-ranking model, comprising: a labeling module, configured to acquire user behavior data of a target user, and label objects clicked by the target user in the user behavior data as positive samples and objects not clicked as negative samples, wherein the user behavior data includes all browsing objects of the target user and their object information and click information; a calculation module, configured to acquire the model prediction probability, exposure frequency and sample features of each negative sample from the user behavior data, and calculate the dynamic weight of each negative sample based on the model prediction probability, the exposure frequency and the sample features; a prediction module, configured to input all browsing objects and their object information from the user behavior data into the fine-ranking model, so that the fine-ranking model predicts the recommendation probability of all browsing objects, obtains the prediction result, and calculates the basic loss function based on the prediction result and the click information of all browsing objects; and an update module, configured to perform weighted calculation on the basic loss function based on the dynamic weight of each negative sample, obtain a weighted loss function, and iteratively update the parameters of the fine-ranking model based on the weighted loss function to obtain the optimized fine-ranking model.

[0006] As an optional example, the above calculation module includes: a first processing unit, configured to determine the unprocessed negative sample as the current negative sample, and perform the following processing on the current negative sample: using the above-mentioned fine ranking model to predict the recommendation probability of the current negative sample, to obtain the model prediction probability of the current negative sample; counting the number of times the current negative sample appears in the above-mentioned user behavior data to determine the exposure frequency of the current negative sample; and extracting the sample features of the current negative sample from the above-mentioned user behavior data, wherein the sample features include object category, duration, and matching degree with the preferences of the target user.

[0007] As an optional example, the above calculation module includes: a second processing unit, configured to determine the unprocessed negative sample as the current negative sample, and perform the following processing on the current negative sample: determining the corresponding prediction probability sub-weight based on the probability interval to which the model prediction probability of the current negative sample belongs, wherein the prediction probability sub-weight of the current negative sample is directly proportional to the model prediction probability of the current negative sample; determining the corresponding exposure frequency sub-weight based on the frequency interval to which the exposure frequency of the current negative sample belongs, wherein the exposure frequency sub-weight of the current negative sample is directly proportional to the exposure frequency of the current negative sample; mapping the sample feature values ​​to the sample feature sub-weights of the current negative sample based on the sample features of the current negative sample; and weighting or multiplying the prediction probability sub-weight, exposure frequency sub-weight, and sample feature sub-weight of the current negative sample to obtain the dynamic weight of the current negative sample.

[0008] As an optional example, the above-mentioned update module includes: a retention unit, used to directly retain the basic loss of each positive sample in the above-mentioned basic loss function as a weighted loss; a first calculation unit, used to multiply the basic loss of each negative sample in the above-mentioned basic loss function by its corresponding dynamic weight to obtain the corresponding weighted loss; and a second calculation unit, used to sum or average the weighted losses of all positive samples with the weighted losses of all negative samples to obtain the above-mentioned weighted loss function.

[0009] As an optional example, the above-mentioned update module includes: an update unit, used to update the parameters of the above-mentioned fine-ranking model according to the preset optimization algorithm and the above-mentioned weighted loss function, and recalculate the dynamic weight of each negative sample and the above-mentioned weighted loss function until the training stopping condition is met, so as to obtain the optimized fine-ranking model.

[0010] As an optional example, the above apparatus further includes: a deployment module, configured to deploy the optimized ranking model to the recommendation system after obtaining the optimized ranking model, so that the optimized ranking model receives candidate video data through an interface or message queue, performs recommendation probability prediction on the candidate video data, and generates recommendation results.

[0011] As an optional example, the above deployment module includes: a prediction unit, used to predict the recommendation probability of each candidate video in the above candidate video data using the optimized ranking model, to obtain the model prediction probability of each candidate video; and a sorting unit, used to sort all candidate videos in the above candidate video data according to the model prediction probability, to obtain the above recommendation result.

[0012] Thirdly, this application provides a storage medium storing a computer program, wherein the computer program is executed by a processor to perform the optimization method of the above-described ranking model.

[0013] Fourthly, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the optimization method of the above-described fine-ranking model through the computer program.

[0014] The technical solutions provided in this application have the following advantages compared with the prior art: This application employs the method of acquiring user behavior data of target users, and marking the objects clicked by the target users in the aforementioned user behavior data as positive samples and the objects not clicked as negative samples. The aforementioned user behavior data includes all browsing objects of the target user, their object information, and click information. The application then obtains the model prediction probability, exposure frequency, and sample features of each negative sample from the aforementioned user behavior data, and calculates the dynamic weight of each negative sample based on the aforementioned model prediction probability, exposure frequency, and sample features. Finally, the application inputs all browsing objects and their object information from the aforementioned user behavior data into a refined ranking model, enabling the refined ranking model to predict the recommendation probability of all browsing objects, thus obtaining... The method involves predicting the results and calculating the basic loss function based on these predictions and click information of all viewed objects. A weighted loss function is then calculated by dynamically weighting each negative sample. The parameters of the refined ranking model are iteratively updated based on this weighted loss function to obtain the optimized refined ranking model. This method involves acquiring target user behavior data and labeling clicked objects as positive samples and unclicked objects as negative samples. During training, the model prediction probability, exposure frequency, and sample features of negative samples are further extracted, and the weights of the negative samples are dynamically calculated. These weights are then incorporated into the basic loss function to form the weighted loss function, which is used to iteratively update the refined ranking model parameters. By assigning higher weights to difficult negative samples and lower weights to easy negative samples, the model focuses on high-value negative samples during training. This improves the ability to distinguish between positive and negative samples and the ranking accuracy, enhances the model's generalization performance, and optimizes the short video recommendation effect. This solves the technical problem of existing refined ranking models not fully utilizing difficult negative samples, resulting in limited discrimination and ranking accuracy. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0018] Figure 1This is a flowchart of an optional fine-ranking model optimization method according to an embodiment of this application; Figure 2 This is a schematic diagram of the structure of an optional fine-ranking model optimization device according to an embodiment of this application; Figure 3 This is a schematic diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0021] According to a first aspect of the embodiments of this application, an optimization method for a fine-grained ranking model is provided, optionally, as follows: Figure 1 As shown, the above method includes: S102, acquire user behavior data of the target user, and mark the objects clicked by the target user in the user behavior data as positive samples and the objects not clicked as negative samples. The user behavior data includes all the objects browsed by the target user and their object information and click information. S104: Obtain the model prediction probability, exposure frequency, and sample characteristics of each negative sample from user behavior data, and calculate the dynamic weight of each negative sample based on the model prediction probability, exposure frequency, and sample characteristics. S106, input all browsing objects and their information from the user behavior data into the fine ranking model so that the fine ranking model can predict the recommendation probability of all browsing objects, obtain the prediction result, and calculate the basic loss function based on the prediction result and the click information of all browsing objects; S108: The basic loss function is weighted according to the dynamic weight of each negative sample to obtain the weighted loss function. The parameters of the fine-ranking model are then iteratively updated according to the weighted loss function to obtain the optimized fine-ranking model.

[0022] Optionally, in this embodiment, an optimization method for a fine-grained ranking model is provided, which aims to solve the problem of extreme imbalance in the number of positive and negative samples and the ineffective utilization of the differences in negative samples during the training process of existing fine-grained ranking models, thereby improving the model's ability to discriminate user click behavior and its ranking accuracy.

[0023] Specifically, firstly, user behavior data of the target users is acquired and then processed for sample labeling. Specifically, user behavior data includes all objects viewed by the target user in the recommendation scenario, along with their information and click details, such as video ID, category, duration, content features, exposure location, and user interactions like clicks, completions, and skips. Objects clicked by the target user are marked as positive samples, and objects not clicked are marked as negative samples, thus constructing a set of positive and negative samples for training the fine-tuning model. Since the number of unclicked objects is much greater than the number of clicked objects in short video scenarios, this step provides fundamental data support for subsequent sample differentiation and weight adjustment.

[0024] Secondly, the model prediction probability, exposure frequency, and sample features of each negative sample are extracted from user behavior data, and dynamic weights are calculated for each negative sample based on these factors. The model prediction probability characterizes the current model's judgment on the likelihood of the negative sample being clicked; a higher prediction probability indicates that the negative sample is closer to a positive sample and is considered a difficult negative sample. Exposure frequency reflects the degree to which the object has been seen by the user multiple times without being clicked; samples with multiple exposures without clicks have stronger discriminative value. Sample features include information such as video content attributes and user interest matching, used to further characterize the difficulty of the negative sample. By combining these three factors, difficult negative samples are assigned higher weights, and easy negative samples are assigned lower weights. Furthermore, the dynamic weights can be updated iteratively during training, allowing the model to continuously focus on the most challenging negative samples.

[0025] Then, all browsed objects and their information from the user behavior data are input into the fine-ranking model, enabling the model to predict the recommendation probability of all browsed objects and obtain the prediction results. The fine-ranking model can employ a deep neural network structure to interactively model user features and object features, outputting the click probability or ranking score for each object. Further, a basic loss function, such as cross-entropy loss or ranking loss, is calculated based on the prediction results and corresponding click information to measure the deviation between the model's predictions and actual user behavior.

[0026] Finally, the base loss function is weighted according to the dynamic weight of each negative sample to obtain a weighted loss function, and the parameters of the fine-ranking model are iteratively updated based on the weighted loss function. Specifically, during the loss calculation process, a dynamic weight coefficient is introduced for the negative sample term, so that hard-to-negative samples occupy a larger proportion in the overall gradient update, thereby driving the model to focus on optimizing the discrimination boundary of hard-to-distinguish samples; while easy-to-negative samples have a lower weight to avoid their large presence interfering with training. Through multiple rounds of iterative training, the optimized fine-ranking model is finally obtained, which can be deployed in online recommendation systems for fine-ranking prediction and ranking output of candidate videos.

[0027] Optionally, by introducing a dynamic negative sample weighting mechanism in this embodiment, the discriminative information of difficult negative samples can be fully explored, the training bias caused by the imbalance of positive and negative samples can be alleviated, and the model can automatically focus on high-value negative samples during training, thereby improving the ability of the fine ranking model to distinguish between positive and negative samples and the ranking accuracy, enhancing the model's generalization performance, and ultimately improving the short video recommendation effect and user viewing experience.

[0028] As an optional example, obtaining the model prediction probability, exposure frequency, and sample features for each negative sample from user behavior data includes: The unprocessed negative sample is identified as the current negative sample, and the following processing is performed on the current negative sample: The recommendation probability of the current negative sample is predicted by using the fine-ranking model. The frequency of exposure of the current negative sample is determined by counting the number of times it appears in user behavior data. Extract sample features from user behavior data for current negative samples, where sample features include object category, duration, and degree of matching with the target user's preferences.

[0029] Optionally, in this embodiment, during the training of the fine-ranking model, in order to achieve a fine characterization of the differences in negative samples, the model prediction probability, exposure frequency, and sample features of each negative sample are obtained from user behavior data. First, feature extraction and statistical analysis are performed for each negative sample. Specifically, the constructed fine-ranking model is used to predict the recommendation probability of the object information corresponding to the current negative sample, and the probability that the object will be clicked by the target user is output, thereby obtaining the model prediction probability of the current negative sample. This prediction probability is used to reflect the difficulty of the model in distinguishing negative samples. The higher the prediction probability, the closer the negative sample is to the positive sample, and the more challenging the negative sample.

[0030] Secondly, the frequency of the current negative sample in user behavior data is counted to determine its exposure frequency. Exposure frequency characterizes the extent to which the object has been viewed multiple times by users but not clicked. Negative samples with multiple unclicked exposures typically contain richer discriminative information, providing stronger distinguishing criteria for model training. Furthermore, sample features of the current negative sample are extracted from the user behavior data to form a multi-dimensional description of the negative sample. These features may include object category, video duration, and matching degree with target user preferences, such as the similarity between the object's content theme, playback length, user historical interest distribution, and the object's features.

[0031] Optionally, this embodiment can construct comprehensive information for each negative sample, including model prediction probability, exposure frequency, and sample features, to provide a reliable data foundation for subsequent dynamic weight calculation, enabling the fine-ranking model to more accurately distinguish the importance of different negative samples and focus on high-value difficult negative samples during training.

[0032] As an optional example, calculating the dynamic weights of each negative sample based on the model's predicted probability, exposure frequency, and sample features includes: The unprocessed negative sample is identified as the current negative sample, and the following processing is performed on the current negative sample: Based on the probability interval to which the model prediction probability of the current negative sample belongs, the corresponding prediction probability sub-weight is determined, wherein the prediction probability sub-weight of the current negative sample is directly proportional to the model prediction probability of the current negative sample. Based on the frequency range to which the current negative sample's exposure frequency belongs, the corresponding exposure frequency sub-weight is determined, wherein the exposure frequency sub-weight of the current negative sample is directly proportional to the exposure frequency of the current negative sample. Based on the sample features of the current negative sample, map the sample feature values ​​to the sample feature sub-weights of the current negative sample; The dynamic weight of the current negative sample is obtained by weighting or multiplying the predicted probability sub-weight, exposure frequency sub-weight, and sample feature sub-weight.

[0033] Optionally, in this embodiment, during the training of the fine-ranking model, in order to more fully distinguish the training value of different negative samples, the dynamic weight of each negative sample is calculated based on the model prediction probability, exposure frequency, and sample characteristics. First, sub-weight determination and aggregation calculation operations are performed on each negative sample to generate the dynamic weight corresponding to that negative sample.

[0034] Specifically, the corresponding prediction probability sub-weights are determined based on the probability interval to which the model's predicted probability of the current negative sample belongs. For example, multiple probability intervals can be pre-set, and a larger sub-weight can be assigned when the predicted probability falls into a higher interval, reflecting the characteristic that the negative sample is closer to a positive sample and belongs to the category of difficult negative samples. The prediction probability sub-weights are directly proportional to the model's predicted probability, causing the model to give more attention to negative samples with high predicted probabilities.

[0035] Secondly, based on the frequency range to which the current negative sample's exposure frequency belongs, the corresponding exposure frequency sub-weight is determined. Exposure frequency reflects the degree to which the object has been seen multiple times by the target user but not clicked. By dividing the frequency range and setting corresponding weights, negative samples with higher exposure frequencies receive larger sub-weights, thereby highlighting the discriminative information contained in samples with multiple exposures but no clicks. The exposure frequency sub-weight is directly proportional to the exposure frequency.

[0036] Furthermore, based on the sample characteristics of the current negative sample, the sample feature values ​​are mapped to sample feature sub-weights. Sample features may include object category, duration, and matching degree with target user preferences, etc. Through feature mapping functions or lookup tables, different feature combinations are converted into corresponding weight values ​​to reflect the difficulty differences of the negative sample in terms of content attributes and user interest matching.

[0037] Finally, the predicted probability sub-weights, exposure frequency sub-weights, and sample feature sub-weights of the current negative sample are weighted and summed or multiplied to obtain the dynamic weight of the current negative sample. This multi-factor sub-weight fusion method enables a dynamic characterization of the difficulty of negative samples, providing a basis for subsequent weighted loss training and allowing the model to focus on optimizing high-value, difficult negative samples during iteration.

[0038] As an optional example, the base loss function is weighted according to the dynamic weights of each negative sample, resulting in a weighted loss function including: The basic loss of each positive sample in the basic loss function is directly retained as the weighted loss. Multiply the base loss of each negative sample in the base loss function by its corresponding dynamic weight to obtain the corresponding weighted loss; The weighted loss function is obtained by summing or averaging the weighted losses of all positive samples and all negative samples.

[0039] Optionally, in this embodiment, during the training of the fine-ranking model, in order to fully utilize the discriminative information of negative samples and distinguish the importance of positive and negative samples, the basic loss function is weighted according to the dynamic weight of each negative sample to obtain a weighted loss function. First, for each positive sample in the basic loss function, its corresponding basic loss is directly retained as the weighted loss without additional adjustment to ensure that the contribution of positive samples remains stable in the loss function. Retaining the loss of positive samples ensures that the model continuously learns the feature patterns of positive samples and user click preferences during training.

[0040] Secondly, for each negative sample in the base loss function, its base loss is multiplied by the corresponding dynamic weight to obtain the weighted loss of that negative sample. The dynamic weight is calculated in the previous steps based on the model's predicted probability, exposure frequency, and sample characteristics, and can reflect the difficulty of the negative sample and its importance to model training. By introducing dynamic weights, difficult negative samples will have a greater impact on the loss function during training, thus prompting the model to pay more attention to the discrimination boundary of difficult negative samples when updating parameters, while easy negative samples have a relatively smaller impact on gradient updates, avoiding interference caused by an excessive number of negative samples during training.

[0041] Furthermore, the weighted losses of all positive samples and the weighted losses of all negative samples are summed or averaged within a single training batch to obtain the overall weighted loss function. This weighted loss function comprehensively considers the information from both positive and weighted negative samples, balancing the imbalanced sample problem while ensuring that the model pays sufficient attention to high-value negative samples during training. In subsequent training iterations, this weighted loss function will be used for gradient calculation and parameter updates, enabling the fine-grained ranking model to progressively optimize its ability to distinguish between positive and negative samples and its ranking accuracy.

[0042] As an optional example, the optimized ranking model is obtained by iteratively updating the parameters of the fine-ranking model based on the weighted loss function, including: Based on the preset optimization algorithm and weighted loss function, the parameters of the fine-ranking model are updated, and the dynamic weights and weighted loss function of each negative sample are recalculated until the training stopping condition is met, thus obtaining the optimized fine-ranking model.

[0043] Optionally, in this embodiment, during the training of the fine-ranking model, in order to fully utilize dynamic negative sample information and improve the model's ranking accuracy and discriminative ability, the parameters of the fine-ranking model are iteratively updated according to the weighted loss function to obtain the optimized fine-ranking model. First, the weighted loss function is used as the objective function, and the parameters of the fine-ranking model are updated in conjunction with a preset optimization algorithm. The optimization algorithm may include common optimization methods such as gradient descent, stochastic gradient descent, Adam, and RMSProp, which are used to adjust the model weights according to the gradient information calculated by the weighted loss function, thereby minimizing the deviation between the model prediction and the actual user behavior.

[0044] After each parameter update, the recommendation probability is re-predicted for each negative sample in the training data based on the latest ranking model, thus updating the model's predicted probability. The dynamic weights of each negative sample are then recalculated, incorporating exposure frequency and sample features. Subsequently, the updated dynamic weights are applied to the base loss function, recalculating the weighted loss function to reflect the latest difficulty distribution and importance of negative samples in the current model state. This dynamic update mechanism ensures that the training process continuously focuses on high-value, difficult negative samples in each iteration, guaranteeing that the model's ability to distinguish between positive and negative samples during optimization always targets the most challenging samples.

[0045] This iterative process will continue until training termination conditions are met, such as reaching a preset number of training rounds, convergence of the weighted loss function, validation set performance metrics meeting expectations, or other custom termination conditions. When training stops, the final refined ranking model is the optimized refined ranking model, whose parameters have been fully learned through multiple iterations, incorporating positive sample features and difficult-to-negative sample information.

[0046] Through the above steps, the optimized ranking model can not only accurately distinguish between positive and negative samples, but also effectively utilize the discriminative information provided by the difficult negative samples, thereby improving the model's ranking accuracy, generalization ability, and online recommendation effect. This provides more accurate and personalized recommendation services for short video recommendation systems, and optimizes users' click-through rates and viewing experience.

[0047] As an optional example, after obtaining the optimized ranking model, the above method also includes: The optimized ranking model is deployed to the recommendation system so that it can receive candidate video data through an interface or message queue, predict the recommendation probability of the candidate video data, and generate recommendation results.

[0048] Optionally, in this embodiment, after obtaining the optimized ranking model, it is deployed to the recommendation system, enabling it to perform refined ranking and prediction of candidate videos in actual recommendation scenarios. Specifically, the optimized ranking model receives video data to be recommended from the candidate pool, as well as object information related to each candidate video, such as video ID, category, duration, content features, and user profile information, through a system interface or message queue. In this way, the model can obtain complete input data for personalized recommendations.

[0049] Subsequently, the optimized ranking model predicts the recommendation probability of the received candidate video data, outputting the probability value of each candidate video being clicked by the target user. This prediction process utilizes the positive sample feature patterns and hard negative sample information learned by the model during training, enabling the model to accurately assess the attractiveness of videos to users and their potential click likelihood. Based on the predicted recommendation probabilities, the candidate videos are further ranked, placing videos with a high probability of clicking at the top, forming a ranked recommendation list, thereby ensuring that the recommended content has a high click-through rate and viewing value when displayed to users.

[0050] Finally, the generated ranking results are returned to the front-end recommendation module or other consumer terminals via an interface or message queue, enabling online refined display of video content. This deployment process not only supports real-time recommendations but also dynamically updates the input based on the latest user behavior data, allowing the recommendation system to quickly respond to changes in user interests and provide more accurate and personalized recommendation services. Furthermore, the deployment mechanism is compatible with distributed system architectures, ensuring stability and efficiency under high-concurrency access scenarios.

[0051] As an optional example, the recommendation probability prediction is performed on candidate video data, and the generated recommendation results include: The optimized ranking model predicts the recommendation probability for each candidate video in the candidate video data, and obtains the model prediction probability for each candidate video. Based on the probabilities predicted by the model, all candidate videos in the candidate video data are sorted to obtain the recommendation results.

[0052] Optionally, in this embodiment, after the fine-ranking model is deployed, recommendation probability prediction is performed on the candidate video data, and recommendation results are generated. First, the candidate video data is input into the optimized fine-ranking model. Each candidate video carries its relevant feature information, including video ID, category, duration, content features, and matching degree with the target user's profile. Internally, by performing multi-dimensional interactive modeling of user features and candidate video features, the fine-ranking model performs recommendation probability prediction for each video in the candidate video data, outputting the predicted probability that each candidate video will be clicked or viewed by the target user. This predicted probability not only reflects the potential attractiveness of the video but also reflects the learning effect on positive and difficult-to-negative sample information during training.

[0053] Subsequently, the candidate video set is sorted based on the predicted probability of each video. Typically, a descending sorting method is used, placing videos with higher predicted click probabilities at the top of the recommendation list to ensure users are exposed to content most likely to be of interest. Other business rules, such as exposure control, content diversity, or deduplication strategies, can be incorporated into the sorting process, but the core sorting criterion remains the recommendation probability output by the refined ranking model. This step ensures that the recommendation list presented to users has a high click-through rate and a positive user experience.

[0054] The optimized ranking model can fully leverage the ability to distinguish between positive and negative samples and the information to identify difficult negative samples learned during training, making the recommendations generated by the system more accurate and personalized, while also increasing user click-through rates and viewing time.

[0055] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0056] According to another aspect of the embodiments of this application, an optimization apparatus for a fine-ranking model is also provided, such as... Figure 2 As shown, it includes: The tagging module 202 is used to acquire user behavior data of the target user and mark the objects clicked by the target user in the user behavior data as positive samples and the objects not clicked as negative samples. The user behavior data includes all the objects browsed by the target user and their object information and click information. The calculation module 204 is used to obtain the model prediction probability, exposure frequency and sample features of each negative sample from user behavior data, and calculate the dynamic weight of each negative sample based on the model prediction probability, exposure frequency and sample features. The prediction module 206 is used to input all browsing objects and their object information from the user behavior data into the fine ranking model, so that the fine ranking model can predict the recommendation probability of all browsing objects, obtain the prediction result, and calculate the basic loss function based on the prediction result and the click information of all browsing objects. The update module 208 is used to perform weighted calculation of the basic loss function according to the dynamic weight of each negative sample to obtain the weighted loss function, and to iteratively update the parameters of the fine ranking model according to the weighted loss function to obtain the optimized fine ranking model.

[0057] It should be noted that the marking module 202 in this embodiment can be used to execute step S102 in this application embodiment, the calculation module 204 in this embodiment can be used to execute step S104 in this application embodiment, the prediction module 206 in this embodiment can be used to execute step S106 in this application embodiment, and the update module 208 in this embodiment can be used to execute step S108 in this application embodiment.

[0058] As an optional example, the computation module includes: The first processing unit is used to identify unprocessed negative samples as the current negative samples and perform the following processing on the current negative samples: The recommendation probability of the current negative sample is predicted using a fine-ranking model to obtain the model prediction probability of the current negative sample; the number of times the current negative sample appears in user behavior data is counted to determine the exposure frequency of the current negative sample. Extract sample features from user behavior data for current negative samples, where sample features include object category, duration, and degree of matching with the target user's preferences.

[0059] As an optional example, the computation module includes: The second processing unit is used to identify unprocessed negative samples as the current negative samples and perform the following processing on the current negative samples: Based on the probability interval to which the model prediction probability of the current negative sample belongs, the corresponding prediction probability sub-weight is determined, wherein the prediction probability sub-weight of the current negative sample is directly proportional to the model prediction probability of the current negative sample. Based on the frequency range to which the current negative sample's exposure frequency belongs, the corresponding exposure frequency sub-weight is determined, wherein the exposure frequency sub-weight of the current negative sample is directly proportional to the exposure frequency of the current negative sample. Based on the sample features of the current negative sample, map the sample feature values ​​to the sample feature sub-weights of the current negative sample; The dynamic weight of the current negative sample is obtained by weighting or multiplying the predicted probability sub-weight, exposure frequency sub-weight, and sample feature sub-weight.

[0060] As an optional example, the update module includes: The retention unit is used to directly retain the base loss of each positive sample in the base loss function as the weighted loss. The first calculation unit is used to multiply the basic loss of each negative sample in the basic loss function by its corresponding dynamic weight to obtain the corresponding weighted loss. The second calculation unit is used to sum or average the weighted loss of all positive samples with the weighted loss of all negative samples to obtain the weighted loss function.

[0061] As an optional example, the update module includes: The update unit is used to update the parameters of the fine-ranking model according to the preset optimization algorithm and weighted loss function, and recalculate the dynamic weight and weighted loss function of each negative sample until the training stopping condition is met, so as to obtain the optimized fine-ranking model.

[0062] As an optional example, the above-described apparatus further includes: The deployment module is used to deploy the optimized ranking model to the recommendation system after obtaining the optimized ranking model. This allows the optimized ranking model to receive candidate video data through an interface or message queue, perform recommendation probability prediction on the candidate video data, and generate recommendation results.

[0063] As an optional example, the deployment module includes: The prediction unit is used by the optimized ranking model to predict the recommendation probability of each candidate video in the candidate video data, and obtain the model prediction probability of each candidate video. The sorting unit is used to sort all candidate videos in the candidate video data according to the probabilities predicted by the model, and obtain the recommendation results.

[0064] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.

[0065] Figure 3 This is a schematic diagram of an optional electronic device according to an embodiment of this application, such as... Figure 3 As shown, it includes a processor 302, a communication interface 304, a memory 306, and a communication bus 308. The processor 302, communication interface 304, and memory 306 communicate with each other via the communication bus 308. Memory 306 is used to store computer programs; When processor 302 executes a computer program stored in memory 306, it performs the following steps: Acquire user behavior data of the target user, and mark the objects clicked by the target user in the user behavior data as positive samples and the objects not clicked as negative samples. The user behavior data includes all the objects browsed by the target user and their object information and click information. The model prediction probability, exposure frequency, and sample characteristics of each negative sample are obtained from user behavior data, and the dynamic weight of each negative sample is calculated based on the model prediction probability, exposure frequency, and sample characteristics. All browsing objects and their information in the user behavior data are input into the fine ranking model so that the fine ranking model can predict the recommendation probability of all browsing objects, obtain the prediction results, and calculate the basic loss function based on the prediction results and the click information of all browsing objects. The base loss function is weighted according to the dynamic weight of each negative sample to obtain the weighted loss function. The parameters of the fine ranking model are then iteratively updated according to the weighted loss function to obtain the optimized fine ranking model.

[0066] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0067] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0068] As an example, the memory 306 described above may include, but is not limited to, the tagging module 202, calculation module 204, prediction module 206, and update module 208 from the optimization device for the fine-ranking model described above. Furthermore, it may include, but is not limited to, other module units from the optimization device for the fine-ranking model described above, which will not be elaborated upon in this example.

[0069] The processor mentioned above can be a general-purpose processor, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0070] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0071] Those skilled in the art will understand that Figure 3The structure shown is for illustrative purposes only. The device implementing the optimization method of the above-mentioned fine ranking model can be a terminal device, such as a smartphone (e.g., Android phone, iOS phone), tablet computer, handheld computer, mobile internet device (MID), PAD, etc. Figure 3 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 3 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 3 The different configurations shown.

[0072] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.

[0073] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, which, when executed by a processor, performs the steps in the optimization method of the above-described fine-ranking model.

[0074] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0075] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0076] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0077] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0078] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0079] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0080] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0081] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. An optimization method for a fine-grained ranking model, characterized in that, include: Acquire user behavior data of the target user, and mark the objects clicked by the target user in the user behavior data as positive samples and the objects not clicked as negative samples. The user behavior data includes all the objects browsed by the target user and their object information and click information. The model prediction probability, exposure frequency, and sample features of each negative sample are obtained from the user behavior data, and the dynamic weight of each negative sample is calculated based on the model prediction probability, the exposure frequency, and the sample features. All browsing objects and their information in the user behavior data are input into the fine ranking model so that the fine ranking model can predict the recommendation probability of all browsing objects, obtain the prediction result, and calculate the basic loss function based on the prediction result and the click information of all browsing objects. The base loss function is weighted according to the dynamic weight of each negative sample to obtain a weighted loss function. The parameters of the fine-ranking model are then iteratively updated according to the weighted loss function to obtain the optimized fine-ranking model.

2. The method according to claim 1, characterized in that, The step of obtaining the model prediction probability, exposure frequency, and sample features for each negative sample from the user behavior data includes: The unprocessed negative sample is identified as the current negative sample, and the following processing is performed on the current negative sample: The recommended probability of the current negative sample is predicted using the fine-ranking model to obtain the model predicted probability of the current negative sample. The frequency of the current negative sample is determined by counting the number of times it appears in the user behavior data. Extract sample features of the current negative sample from the user behavior data, wherein the sample features include object category, duration, and degree of matching with the target user's preferences.

3. The method according to claim 1, characterized in that, The calculation of the dynamic weight of each negative sample based on the model's predicted probability, the exposure frequency, and the sample features includes: The unprocessed negative sample is identified as the current negative sample, and the following processing is performed on the current negative sample: Based on the probability interval to which the model prediction probability of the current negative sample belongs, the corresponding prediction probability sub-weight is determined, wherein the prediction probability sub-weight of the current negative sample is positively proportional to the model prediction probability of the current negative sample. Based on the frequency range to which the exposure frequency of the current negative sample belongs, the corresponding exposure frequency sub-weight is determined, wherein the exposure frequency sub-weight of the current negative sample is positively proportional to the exposure frequency of the current negative sample. Based on the sample features of the current negative sample, the sample feature values ​​are mapped to the sample feature sub-weights of the current negative sample; The predicted probability sub-weight, exposure frequency sub-weight, and sample feature sub-weight of the current negative sample are weighted or multiplied together to obtain the dynamic weight of the current negative sample.

4. The method according to claim 1, characterized in that, The weighted loss function, obtained by weighting the basic loss function according to the dynamic weights of each negative sample, includes: The basic loss of each positive sample in the basic loss function is directly retained as the weighted loss. Multiply the base loss of each negative sample in the base loss function by its corresponding dynamic weight to obtain the corresponding weighted loss. The weighted loss function is obtained by summing or averaging the weighted losses of all positive samples and all negative samples.

5. The method according to claim 1, characterized in that, The step of iteratively updating the parameters of the fine-ranking model according to the weighted loss function to obtain the optimized fine-ranking model includes: Based on the preset optimization algorithm and the weighted loss function, the parameters of the fine-ranking model are updated, and the dynamic weights of each negative sample and the weighted loss function are recalculated until the training stopping condition is met, thus obtaining the optimized fine-ranking model.

6. The method according to claim 1, characterized in that, After obtaining the optimized ranking model, the method further includes: The optimized ranking model is deployed to the recommendation system so that the optimized ranking model receives candidate video data through an interface or message queue, performs recommendation probability prediction on the candidate video data, and generates recommendation results.

7. The method according to claim 6, characterized in that, The step of predicting the recommendation probability from the candidate video data and generating recommendation results includes: The optimized ranking model predicts the recommendation probability for each candidate video in the candidate video data, and obtains the model prediction probability for each candidate video. Based on the probabilities predicted by the model, all candidate videos in the candidate video data are sorted to obtain the recommendation results.

8. An optimization device for a fine-ranking model, characterized in that, include: The tagging module is used to acquire user behavior data of the target user and mark the objects clicked by the target user in the user behavior data as positive samples and the objects not clicked as negative samples. The user behavior data includes all the browsing objects of the target user and their object information and click information. The calculation module is used to obtain the model prediction probability, exposure frequency and sample features of each negative sample from the user behavior data, and calculate the dynamic weight of each negative sample based on the model prediction probability, the exposure frequency and the sample features. The prediction module is used to input all browsing objects and their object information from the user behavior data into the fine ranking model, so that the fine ranking model can predict the recommendation probability of all browsing objects, obtain the prediction result, and calculate the basic loss function based on the prediction result and the click information of all browsing objects. The update module is used to perform weighted calculation on the basic loss function according to the dynamic weight of each negative sample to obtain a weighted loss function, and to iteratively update the parameters of the fine ranking model according to the weighted loss function to obtain the optimized fine ranking model.

9. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the method described in any one of claims 1 to 7.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.